diff --git a/package.json b/package.json index 1bdad80..b7e98a4 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "electron-updater": "^6.1.7", "element-plus": "^2.7.6", "fabric": "^5.3.0", + "im_electron_sdk": "^8.0.5904", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", "jsondiffpatch": "0.6.0", diff --git a/src/main/chat.js b/src/main/chat.js new file mode 100644 index 0000000..b6700f2 --- /dev/null +++ b/src/main/chat.js @@ -0,0 +1,20 @@ +/** + * @description 腾讯云-即时通讯-sdkID + */ +// import { ipcMain } from 'electron' +// const TimMain = require('im_electron_sdk/dist/main') +import TimMain from 'im_electron_sdk/dist/main' +// import {TIMErrCode} from 'im_electron_sdk/dist/enumbers' +const sdkappidDef = 1600034736 // 可以去腾讯云即时通信IM控制台申请 + +// 初始化 +function init(sdkappid = sdkappidDef) { + return new TimMain({sdkappid}) +} +export function initialize(){ + // ipcMain.handle('im-chat:init', (event, sdkappid) => { + // return init(sdkappid) + // }) + return init() +} +export default { initialize, init } diff --git a/src/main/index.js b/src/main/index.js index c6313dd..9a64088 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -3,6 +3,7 @@ import { join } from 'path' import { electronApp, optimizer, is } from '@electron-toolkit/utils' import icon from '../../resources/icon.png?asset' import File from './file' +import chat from './chat' // chat封装 // 代理 electron/remote // 第一步:引入remote import remote from '@electron/remote/main' @@ -227,12 +228,15 @@ app.on('window-all-closed', () => { // 监听全局事件 function handleAll() { + // chat.initialize() // im-chat 实例 + const chatInstance = chat.initialize() // im-chat 实例 // 新窗口创建-监听 ipcMain.on('new-window', (e, data) => { const { id, type } = data const win = BrowserWindow.fromId(id) win.type = type // 绑定独立标识 - remote.enable(win.webContents) // 开启远程服务 + remote.enable(win.webContents) // 开启远程服务 + chatInstance.enable(win.webContents) // 开启im-chat }) // 用于监听-状态管理变化-同步所有窗口 ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => { @@ -246,16 +250,8 @@ function handleAll() { }) // 用于监听-状态管理变化-初始同步 ipcMain.handle('pinia-state-init', (e, wid, storeName, jsonStr) => { - // for(const curWin of BrowserWindow.getAllWindows()){ - // const id = curWin.webContents.id - // const bool = id !== e.sender.id && !curWin.isDestroyed() - // if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送 - // curWin.webContents.send('pinia-state-set', storeName, jsonStr) - // } - // } // console.log('pinia-state-init', jsonStr) const win = BrowserWindow.fromId(wid) - // console.log(win) win.webContents.send('pinia-state-set', storeName, jsonStr) }) } diff --git a/src/main/tool.js b/src/main/tool.js deleted file mode 100644 index 8be3a66..0000000 --- a/src/main/tool.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @description: electron 封装的工具函数 - * 消息整理 - * tool-sphere:create 创建-悬浮球-窗口 - */ -import { app, shell, BrowserWindow, ipcMain } from 'electron' -import { is } from '@electron-toolkit/utils' - -// const baseUrl = 'http://localhost:5173/#' // 开发环境使用 -const baseUrl = process.env['ELECTRON_RENDERER_URL']+'/#' // 开发环境使用 -// 所有窗口 -let allWindow = {} -// 其他已有窗口 wins -export function init() { - // 创建工具-悬浮球 - ipcMain.on('tool-sphere:create', async(e, data) => { - // console.log('测试xxxx', data) - await createTools(data) // 执行逻辑 - e.reply('tool-sphere:create-reply', {code: 200, msg: 'success'}) // 返回结果 - }) -} -/** - * @description: 创建工具 - * @param {*} url 路由地址 - * @param {number} [width=800] 窗口宽度 - * @param {number} [height=600] 窗口高度 - * @param {{}} [option={}] 自定义选项 - * @author: zdg - * @date 2021-07-05 14:07:01 - */ - export function createTools({url, width = 800, height = 600, option={}}) { - const { mainWindow } = allWindow||{} // 获取主窗口 - const devUrl = `${baseUrl}${url}` - const buildUrl = `file://${__dirname}/index.html${url}` - const urlAll = is.dev ? devUrl : buildUrl - return new Promise((resolve) => { - let win = new BrowserWindow({ - width, height, - type: 'toolbar', // 创建的窗口类型为工具栏窗口 - frame: false, // 要创建无边框窗口 - resizable: false, // 禁止窗口大小缩放 - transparent: true, // 设置透明 - alwaysOnTop: true, // 窗口是否总是显示在其他窗口之前 - - parent: mainWindow, // 父窗口 - autoClose: true, // 关闭窗口后自动关闭 - webPreferences: { - nodeIntegration: true, // nodeApi调用 - contextIsolation: false, // 沙箱取消 - webSecurity: false // 跨域关闭 - }, - ...option - }) - // console.log(urlAll) - // url = 'https://www.baidu.com' - console.log(urlAll) - win.loadURL(urlAll) - win.setFullScreen(true) // 设置窗口为全屏 - win.setIgnoreMouseEvents(true) // 忽略鼠标事件|使窗口不可选中 - win.once('ready-to-show', () => { - win.show() - resolve(win) - }) - win.on('closed', () => { - win = null - }) - }) -} -// 保存窗口 -export function setWin(win = {}) { - if (win && Object.keys(win).length){ - Object.keys(win).forEach(key => { - if (!allWindow[key]) { // 不存在就保存 - allWindow[key] = win[key] - } - }) - } -} diff --git a/src/preload/index.js b/src/preload/index.js index 9da4869..ffdb7a0 100644 --- a/src/preload/index.js +++ b/src/preload/index.js @@ -1,8 +1,10 @@ import { contextBridge } from 'electron' import { electronAPI } from '@electron-toolkit/preload' - +import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例 // Custom APIs for renderer const api = { + preloadPath: __dirname, // 当前preload地址 + getTimRender: () => new TimRender(), // im渲染部分实例 } // Use `contextBridge` APIs to expose Electron APIs to // renderer only if context isolation is enabled, otherwise diff --git a/src/renderer/src/api/apiService.js b/src/renderer/src/api/apiService.js new file mode 100644 index 0000000..b487ad8 --- /dev/null +++ b/src/renderer/src/api/apiService.js @@ -0,0 +1,26 @@ +/** + * @description: 后端接口api + * @author zdg + * @date 2023-07-03 + */ +import request from '@/utils/request' +// /system/user/txCloudSign +export class ApiService { + // zdg: 公共请求-处理(可进行特殊处理) + static publicHttp(url, data, method, option = {}, type) { + method = method || 'get' // 默认GET + const config = { url, method } + if (!!data) basic[method=='get'?'params':'data'] = data + if (!!option) Object.assign(config, option) + // 特殊格式处理 + if (type == 'file') config.headers = { 'Content-Type': 'multipart/form-data' } + else if (type == 'json') config.headers = { 'Content-Type': 'application/json' } + else if (type == 'form') config.headers = { 'Content-Type': 'application/x-www-form-urlencoded' } + return request(config) + } +} +// zdg: 腾讯云-即时通讯 +export class imChat { + // 获取腾讯im-chat appid 签名 + static getTxCloudSign = data => ApiService.publicHttp('/system/user/txCloudSign', data) +} diff --git a/src/renderer/src/plugins/imChat/enumbers.js b/src/renderer/src/plugins/imChat/enumbers.js new file mode 100644 index 0000000..0145323 --- /dev/null +++ b/src/renderer/src/plugins/imChat/enumbers.js @@ -0,0 +1,1267 @@ +/** + * @brief 错误码 + * 详细 [错误码](https://cloud.tencent.com/document/product/269/1671),请您移步官网查看 + */ +const TIMErrCode= { + ERR_SUCC : 0, + ERR_IN_PROGESS : 6015, + ERR_INVALID_PARAMETERS : 6017, + ERR_IO_OPERATION_FAILED : 6022, + ERR_INVALID_JSON : 6027, + ERR_OUT_OF_MEMORY : 6028, + ERR_PARSE_RESPONSE_FAILED : 6001, + ERR_SERIALIZE_REQ_FAILED : 6002, + ERR_SDK_NOT_INITIALIZED : 6013, + ERR_LOADMSG_FAILED : 6005, + ERR_DATABASE_OPERATE_FAILED : 6019, + ERR_SDK_COMM_CROSS_THREAD : 7001, + ERR_SDK_COMM_TINYID_EMPTY : 7002, + ERR_SDK_COMM_INVALID_IDENTIFIER : 7003, + ERR_SDK_COMM_FILE_NOT_FOUND : 7004, + ERR_SDK_COMM_FILE_TOO_LARGE : 7005, + ERR_SDK_COMM_FILE_SIZE_EMPTY : 7006, + ERR_SDK_COMM_FILE_OPEN_FAILED : 7007, + ERR_SDK_COMM_API_CALL_FREQUENCY_LIMIT : 7008, + ERR_SDK_COMM_INTERRUPT : 7009, + ERR_SDK_COMM_DATABASE_FAILURE : 7010, + ERR_SDK_COMM_DATABASE_NOTFOUND : 7011, + ERR_SDK_INTERNAL_ERROR : 7012, + ERR_SDK_NOT_LOGGED_IN : 6014, + ERR_NO_PREVIOUS_LOGIN : 6026, + ERR_USER_SIG_EXPIRED : 6206, + ERR_LOGIN_KICKED_OFF_BY_OTHER : 6208, + ERR_SDK_ACCOUNT_LOGIN_IN_PROCESS : 7501, + ERR_SDK_ACCOUNT_LOGOUT_IN_PROCESS : 7502, + ERR_SDK_ACCOUNT_TLS_INIT_FAILED : 7503, + ERR_SDK_ACCOUNT_TLS_NOT_INITIALIZED : 7504, + ERR_SDK_ACCOUNT_TLS_TRANSPKG_ERROR : 7505, + ERR_SDK_ACCOUNT_TLS_DECRYPT_FAILED : 7506, + ERR_SDK_ACCOUNT_TLS_REQUEST_FAILED : 7507, + ERR_SDK_ACCOUNT_TLS_REQUEST_TIMEOUT : 7508, + ERR_INVALID_CONVERSATION : 6004, + ERR_FILE_TRANS_AUTH_FAILED : 6006, + ERR_FILE_TRANS_NO_SERVER : 6007, + ERR_FILE_TRANS_UPLOAD_FAILED : 6008, + ERR_IMAGE_UPLOAD_FAILED_NOTIMAGE : 6031, + ERR_FILE_TRANS_DOWNLOAD_FAILED : 6009, + ERR_HTTP_REQ_FAILED : 6010, + ERR_INVALID_MSG_ELEM : 6016, + ERR_INVALID_SDK_OBJECT : 6021, + ERR_SDK_MSG_BODY_SIZE_LIMIT : 8001, + ERR_SDK_MSG_KEY_REQ_DIFFER_RSP : 8002, + ERR_SDK_IMAGE_CONVERT_ERROR : 8003, + ERR_SDK_IMAGE_CI_BLOCK : 8004, + ERR_MERGER_MSG_LAYERS_OVER_LIMIT : 8005, + ERR_SDK_SIGNALING_INVALID_INVITE_ID : 8010, + ERR_SDK_SIGNALING_NO_PERMISSION : 8011, + ERR_SDK_INVALID_CANCEL_MESSAGE : 8020, + ERR_SDK_SEND_MESSAGE_FAILED_WITH_CANCEL : 8021, + ERR_SDK_GROUP_INVALID_ID : 8501, + ERR_SDK_GROUP_INVALID_NAME : 8502, + ERR_SDK_GROUP_INVALID_INTRODUCTION : 8503, + ERR_SDK_GROUP_INVALID_NOTIFICATION : 8504, + ERR_SDK_GROUP_INVALID_FACE_URL : 8505, + ERR_SDK_GROUP_INVALID_NAME_CARD : 8506, + ERR_SDK_GROUP_MEMBER_COUNT_LIMIT : 8507, + ERR_SDK_GROUP_JOIN_PRIVATE_GROUP_DENY : 8508, + ERR_SDK_GROUP_INVITE_SUPER_DENY : 8509, + ERR_SDK_GROUP_INVITE_NO_MEMBER : 8510, + ERR_SDK_GROUP_ATTR_FREQUENCY_LIMIT : 8511, + ERR_SDK_GROUP_GET_ONLINE_MEMBER_COUNT_LIMIT : 8512, + ERR_SDK_GROUP_GET_GROUPS_INFO_LIMIT : 8513, + ERR_SDK_GROUP_GET_JOINED_GROUP_LIMIT : 8514, + ERR_SDK_FRIENDSHIP_INVALID_PROFILE_KEY : 9001, + ERR_SDK_FRIENDSHIP_INVALID_ADD_REMARK : 9002, + ERR_SDK_FRIENDSHIP_INVALID_ADD_WORDING : 9003, + ERR_SDK_FRIENDSHIP_INVALID_ADD_SOURCE : 9004, + ERR_SDK_FRIENDSHIP_FRIEND_GROUP_EMPTY : 9005, + ERR_SDK_FRIENDSHIP_EXCEED_THE_LIMIT : 9006, + ERR_SDK_NET_ENCODE_FAILED : 9501, + ERR_SDK_NET_DECODE_FAILED : 9502, + ERR_SDK_NET_AUTH_INVALID : 9503, + ERR_SDK_NET_COMPRESS_FAILED : 9504, + ERR_SDK_NET_UNCOMPRESS_FAILED : 9505, + ERR_SDK_NET_FREQ_LIMIT : 9506, + ERR_SDK_NET_REQ_COUNT_LIMIT : 9507, + ERR_SDK_NET_DISCONNECT : 9508, + ERR_SDK_NET_ALLREADY_CONN : 9509, + ERR_SDK_NET_CONN_TIMEOUT : 9510, + ERR_SDK_NET_CONN_REFUSE : 9511, + ERR_SDK_NET_NET_UNREACH : 9512, + ERR_SDK_NET_SOCKET_NO_BUFF : 9513, + ERR_SDK_NET_RESET_BY_PEER : 9514, + ERR_SDK_NET_SOCKET_INVALID : 9515, + ERR_SDK_NET_HOST_GETADDRINFO_FAILED : 9516, + ERR_SDK_NET_CONNECT_RESET : 9517, + ERR_SDK_NET_WAIT_INQUEUE_TIMEOUT : 9518, + ERR_SDK_NET_WAIT_SEND_TIMEOUT : 9519, + ERR_SDK_NET_WAIT_ACK_TIMEOUT : 9520, + ERR_SDK_NET_WAIT_SEND_REMAINING_TIMEOUT : 9521, + ERR_SDK_NET_PKG_SIZE_LIMIT : 9522, + ERR_SDK_NET_WAIT_SEND_TIMEOUT_NO_NETWORK : 9523, + ERR_SDK_NET_WAIT_ACK_TIMEOUT_NO_NETWORK : 9524, + ERR_SDK_NET_SEND_REMAINING_TIMEOUT_NO_NETWORK : 9525, + ERR_SVR_SSO_CONNECT_LIMIT : -302, + ERR_SVR_SSO_VCODE : -10000, + ERR_SVR_SSO_D2_EXPIRED : -10001, + ERR_SVR_SSO_A2_UP_INVALID : -10003, + ERR_SVR_SSO_A2_DOWN_INVALID : -10004, + ERR_SVR_SSO_EMPTY_KEY : -10005, + ERR_SVR_SSO_UIN_INVALID : -10006, + ERR_SVR_SSO_VCODE_TIMEOUT : -10007, + ERR_SVR_SSO_NO_IMEI_AND_A2 : -10008, + ERR_SVR_SSO_COOKIE_INVALID : -10009, + ERR_SVR_SSO_DOWN_TIP : -10101, + ERR_SVR_SSO_DISCONNECT : -10102, + ERR_SVR_SSO_IDENTIFIER_INVALID : -10103, + ERR_SVR_SSO_CLIENT_CLOSE : -10104, + ERR_SVR_SSO_MSFSDK_QUIT : -10105, + ERR_SVR_SSO_D2KEY_WRONG : -10106, + ERR_SVR_SSO_UNSURPPORT : -10107, + ERR_SVR_SSO_PREPAID_ARREARS : -10108, + ERR_SVR_SSO_PACKET_WRONG : -10109, + ERR_SVR_SSO_APPID_BLACK_LIST : -10110, + ERR_SVR_SSO_CMD_BLACK_LIST : -10111, + ERR_SVR_SSO_APPID_WITHOUT_USING : -10112, + ERR_SVR_SSO_FREQ_LIMIT : -10113, + ERR_SVR_SSO_OVERLOAD : -10114, + ERR_SVR_RES_NOT_FOUND : 114000, + ERR_SVR_RES_ACCESS_DENY : 114001, + ERR_SVR_RES_SIZE_LIMIT : 114002, + ERR_SVR_RES_SEND_CANCEL : 114003, + ERR_SVR_RES_READ_FAILED : 114004, + ERR_SVR_RES_TRANSFER_TIMEOUT : 114005, + ERR_SVR_RES_INVALID_PARAMETERS : 114011, + ERR_SVR_RES_INVALID_FILE_MD5 : 115066, + ERR_SVR_RES_INVALID_PART_MD5 : 115068, + ERR_SVR_COMM_INVALID_HTTP_URL : 60002, + ERR_SVR_COMM_REQ_JSON_PARSE_FAILED : 60003, + ERR_SVR_COMM_INVALID_ACCOUNT : 60004, + ERR_SVR_COMM_INVALID_ACCOUNT_EX : 60005, + ERR_SVR_COMM_INVALID_SDKAPPID : 60006, + ERR_SVR_COMM_REST_FREQ_LIMIT : 60007, + ERR_SVR_COMM_REQUEST_TIMEOUT : 60008, + ERR_SVR_COMM_INVALID_RES : 60009, + ERR_SVR_COMM_ID_NOT_ADMIN : 60010, + ERR_SVR_COMM_SDKAPPID_FREQ_LIMIT : 60011, + ERR_SVR_COMM_SDKAPPID_MISS : 60012, + ERR_SVR_COMM_RSP_JSON_PARSE_FAILED : 60013, + ERR_SVR_COMM_EXCHANGE_ACCOUNT_TIMEUT : 60014, + ERR_SVR_COMM_INVALID_ID_FORMAT : 60015, + ERR_SVR_COMM_SDKAPPID_FORBIDDEN : 60016, + ERR_SVR_COMM_REQ_FORBIDDEN : 60017, + ERR_SVR_COMM_REQ_FREQ_LIMIT : 60018, + ERR_SVR_COMM_REQ_FREQ_LIMIT_EX : 60019, + ERR_SVR_COMM_INVALID_SERVICE : 60020, + ERR_SVR_COMM_SENSITIVE_TEXT : 80001, + ERR_SVR_COMM_BODY_SIZE_LIMIT : 80002, + ERR_SVR_ACCOUNT_USERSIG_EXPIRED : 70001, + ERR_SVR_ACCOUNT_USERSIG_EMPTY : 70002, + ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED : 70003, + ERR_SVR_ACCOUNT_USERSIG_CHECK_FAILED_EX : 70005, + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_PUBLICKEY : 70009, + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_ID : 70013, + ERR_SVR_ACCOUNT_USERSIG_MISMATCH_SDKAPPID : 70014, + ERR_SVR_ACCOUNT_USERSIG_PUBLICKEY_NOT_FOUND : 70016, + ERR_SVR_ACCOUNT_SDKAPPID_NOT_FOUND : 70020, + ERR_SVR_ACCOUNT_INVALID_USERSIG : 70052, + ERR_SVR_ACCOUNT_NOT_FOUND : 70107, + ERR_SVR_ACCOUNT_SEC_RSTR : 70114, + ERR_SVR_ACCOUNT_INTERNAL_TIMEOUT : 70169, + ERR_SVR_ACCOUNT_INVALID_COUNT : 70206, + ERR_SVR_ACCOUNT_INVALID_PARAMETERS : 70402, + ERR_SVR_ACCOUNT_ADMIN_REQUIRED : 70403, + ERR_SVR_ACCOUNT_FREQ_LIMIT : 70050, + ERR_SVR_ACCOUNT_BLACKLIST : 70051, + ERR_SVR_ACCOUNT_COUNT_LIMIT : 70398, + ERR_SVR_ACCOUNT_INTERNAL_ERROR : 70500, + ERR_SVR_PROFILE_INVALID_PARAMETERS : 40001, + ERR_SVR_PROFILE_ACCOUNT_MISS : 40002, + ERR_SVR_PROFILE_ACCOUNT_NOT_FOUND : 40003, + ERR_SVR_PROFILE_ADMIN_REQUIRED : 40004, + ERR_SVR_PROFILE_SENSITIVE_TEXT : 40005, + ERR_SVR_PROFILE_INTERNAL_ERROR : 40006, + ERR_SVR_PROFILE_READ_PERMISSION_REQUIRED : 40007, + ERR_SVR_PROFILE_WRITE_PERMISSION_REQUIRED : 40008, + ERR_SVR_PROFILE_TAG_NOT_FOUND : 40009, + ERR_SVR_PROFILE_SIZE_LIMIT : 40601, + ERR_SVR_PROFILE_VALUE_ERROR : 40605, + ERR_SVR_PROFILE_INVALID_VALUE_FORMAT : 40610, + ERR_SVR_FRIENDSHIP_INVALID_PARAMETERS : 30001, + ERR_SVR_FRIENDSHIP_INVALID_SDKAPPID : 30002, + ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND : 30003, + ERR_SVR_FRIENDSHIP_ADMIN_REQUIRED : 30004, + ERR_SVR_FRIENDSHIP_SENSITIVE_TEXT : 30005, + ERR_SVR_FRIENDSHIP_INTERNAL_ERROR : 30006, + ERR_SVR_FRIENDSHIP_NET_TIMEOUT : 30007, + ERR_SVR_FRIENDSHIP_WRITE_CONFLICT : 30008, + ERR_SVR_FRIENDSHIP_ADD_FRIEND_DENY : 30009, + ERR_SVR_FRIENDSHIP_COUNT_LIMIT : 30010, + ERR_SVR_FRIENDSHIP_GROUP_COUNT_LIMIT : 30011, + ERR_SVR_FRIENDSHIP_PENDENCY_LIMIT : 30012, + ERR_SVR_FRIENDSHIP_BLACKLIST_LIMIT : 30013, + ERR_SVR_FRIENDSHIP_PEER_FRIEND_LIMIT : 30014, + ERR_SVR_FRIENDSHIP_IN_SELF_BLACKLIST : 30515, + ERR_SVR_FRIENDSHIP_ALLOW_TYPE_DENY_ANY : 30516, + ERR_SVR_FRIENDSHIP_IN_PEER_BLACKLIST : 30525, + ERR_SVR_FRIENDSHIP_ALLOW_TYPE_NEED_CONFIRM : 30539, + ERR_SVR_FRIENDSHIP_ADD_FRIEND_SEC_RSTR : 30540, + ERR_SVR_FRIENDSHIP_PENDENCY_NOT_FOUND : 30614, + ERR_SVR_FRIENDSHIP_DEL_NONFRIEND : 31704, + ERR_SVR_FRIENDSHIP_DEL_FRIEND_SEC_RSTR : 31707, + ERR_SVR_FRIENDSHIP_ACCOUNT_NOT_FOUND_EX : 31804, + ERR_SVR_CONV_ACCOUNT_NOT_FOUND : 50001, + ERR_SVR_CONV_INVALID_PARAMETERS : 50002, + ERR_SVR_CONV_ADMIN_REQUIRED : 50003, + ERR_SVR_CONV_INTERNAL_ERROR : 50004, + ERR_SVR_CONV_NET_TIMEOUT : 50005, + ERR_SVR_MSG_PKG_PARSE_FAILED : 20001, + ERR_SVR_MSG_INTERNAL_AUTH_FAILED : 20002, + ERR_SVR_MSG_INVALID_ID : 20003, + ERR_SVR_MSG_NET_ERROR : 20004, + ERR_SVR_MSG_INTERNAL_ERROR1 : 20005, + ERR_SVR_MSG_PUSH_DENY : 20006, + ERR_SVR_MSG_IN_PEER_BLACKLIST : 20007, + ERR_SVR_MSG_BOTH_NOT_FRIEND : 20009, + ERR_SVR_MSG_NOT_PEER_FRIEND : 20010, + ERR_SVR_MSG_NOT_SELF_FRIEND : 20011, + ERR_SVR_MSG_SHUTUP_DENY : 20012, + ERR_SVR_MSG_REVOKE_TIME_LIMIT : 20016, + ERR_SVR_MSG_DEL_RAMBLE_INTERNAL_ERROR : 20018, + ERR_SVR_MSG_JSON_PARSE_FAILED : 90001, + ERR_SVR_MSG_INVALID_JSON_BODY_FORMAT : 90002, + ERR_SVR_MSG_INVALID_TO_ACCOUNT : 90003, + ERR_SVR_MSG_INVALID_RAND : 90005, + ERR_SVR_MSG_INVALID_TIMESTAMP : 90006, + ERR_SVR_MSG_BODY_NOT_ARRAY : 90007, + ERR_SVR_MSG_ADMIN_REQUIRED : 90009, + ERR_SVR_MSG_INVALID_JSON_FORMAT : 90010, + ERR_SVR_MSG_TO_ACCOUNT_COUNT_LIMIT : 90011, + ERR_SVR_MSG_TO_ACCOUNT_NOT_FOUND : 90012, + ERR_SVR_MSG_TIME_LIMIT : 90026, + ERR_SVR_MSG_INVALID_SYNCOTHERMACHINE : 90031, + ERR_SVR_MSG_INVALID_MSGLIFETIME : 90044, + ERR_SVR_MSG_ACCOUNT_NOT_FOUND : 90048, + ERR_SVR_MSG_INTERNAL_ERROR2 : 90994, + ERR_SVR_MSG_INTERNAL_ERROR3 : 90995, + ERR_SVR_MSG_INTERNAL_ERROR4 : 91000, + ERR_SVR_MSG_INTERNAL_ERROR5 : 90992, + ERR_SVR_MSG_BODY_SIZE_LIMIT : 93000, + ERR_SVR_MSG_LONGPOLLING_COUNT_LIMIT : 91101, + ERR_SVR_GROUP_INTERNAL_ERROR : 10002, + ERR_SVR_GROUP_API_NAME_ERROR : 10003, + ERR_SVR_GROUP_INVALID_PARAMETERS : 10004, + ERR_SVR_GROUP_ACOUNT_COUNT_LIMIT : 10005, + ERR_SVR_GROUP_FREQ_LIMIT : 10006, + ERR_SVR_GROUP_PERMISSION_DENY : 10007, + ERR_SVR_GROUP_INVALID_REQ : 10008, + ERR_SVR_GROUP_SUPER_NOT_ALLOW_QUIT : 10009, + ERR_SVR_GROUP_NOT_FOUND : 10010, + ERR_SVR_GROUP_JSON_PARSE_FAILED : 10011, + ERR_SVR_GROUP_INVALID_ID : 10012, + ERR_SVR_GROUP_ALLREADY_MEMBER : 10013, + ERR_SVR_GROUP_FULL_MEMBER_COUNT : 10014, + ERR_SVR_GROUP_INVALID_GROUPID : 10015, + ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY : 10016, + ERR_SVR_GROUP_SHUTUP_DENY : 10017, + ERR_SVR_GROUP_RSP_SIZE_LIMIT : 10018, + ERR_SVR_GROUP_ACCOUNT_NOT_FOUND : 10019, + ERR_SVR_GROUP_GROUPID_IN_USED : 10021, + ERR_SVR_GROUP_SEND_MSG_FREQ_LIMIT : 10023, + ERR_SVR_GROUP_REQ_ALLREADY_BEEN_PROCESSED : 10024, + ERR_SVR_GROUP_GROUPID_IN_USED_FOR_SUPER : 10025, + ERR_SVR_GROUP_SDKAPPID_DENY : 10026, + ERR_SVR_GROUP_REVOKE_MSG_NOT_FOUND : 10030, + ERR_SVR_GROUP_REVOKE_MSG_TIME_LIMIT : 10031, + ERR_SVR_GROUP_REVOKE_MSG_DENY : 10032, + ERR_SVR_GROUP_NOT_ALLOW_REVOKE_MSG : 10033, + ERR_SVR_GROUP_REMOVE_MSG_DENY : 10034, + ERR_SVR_GROUP_NOT_ALLOW_REMOVE_MSG : 10035, + ERR_SVR_GROUP_AVCHATROOM_COUNT_LIMIT : 10036, + ERR_SVR_GROUP_COUNT_LIMIT : 10037, + ERR_SVR_GROUP_MEMBER_COUNT_LIMIT : 10038, + ERR_NO_SUCC_RESULT : 6003, + ERR_TO_USER_INVALID : 6011, + ERR_REQUEST_TIMEOUT : 6012, + ERR_INIT_CORE_FAIL : 6018, + ERR_EXPIRED_SESSION_NODE : 6020, + ERR_LOGGED_OUT_BEFORE_LOGIN_FINISHED : 6023, + ERR_TLSSDK_NOT_INITIALIZED : 6024, + ERR_TLSSDK_USER_NOT_FOUND : 6025, + ERR_BIND_FAIL_UNKNOWN : 6100, + ERR_BIND_FAIL_NO_SSOTICKET : 6101, + ERR_BIND_FAIL_REPEATD_BIND : 6102, + ERR_BIND_FAIL_TINYID_NULL : 6103, + ERR_BIND_FAIL_GUID_NULL : 6104, + ERR_BIND_FAIL_UNPACK_REGPACK_FAILED : 6105, + ERR_BIND_FAIL_REG_TIMEOUT : 6106, + ERR_BIND_FAIL_ISBINDING : 6107, + ERR_PACKET_FAIL_UNKNOWN : 6120, + ERR_PACKET_FAIL_REQ_NO_NET : 6121, + ERR_PACKET_FAIL_RESP_NO_NET : 6122, + ERR_PACKET_FAIL_REQ_NO_AUTH : 6123, + ERR_PACKET_FAIL_SSO_ERR : 6124, + ERR_PACKET_FAIL_REQ_TIMEOUT : 6125, + ERR_PACKET_FAIL_RESP_TIMEOUT : 6126, + ERR_PACKET_FAIL_REQ_ON_RESEND : 6127, + ERR_PACKET_FAIL_RESP_NO_RESEND : 6128, + ERR_PACKET_FAIL_FLOW_SAVE_FILTERED : 6129, + ERR_PACKET_FAIL_REQ_OVER_LOAD : 6130, + ERR_PACKET_FAIL_LOGIC_ERR : 6131, + ERR_FRIENDSHIP_PROXY_NOT_SYNCED : 6150, + ERR_FRIENDSHIP_PROXY_SYNCING : 6151, + ERR_FRIENDSHIP_PROXY_SYNCED_FAIL : 6152, + ERR_FRIENDSHIP_PROXY_LOCAL_CHECK_ERR : 6153, + ERR_GROUP_INVALID_FIELD : 6160, + ERR_GROUP_STORAGE_DISABLED : 6161, + ERR_LOADGRPINFO_FAILED : 6162, + ERR_REQ_NO_NET_ON_REQ : 6200, + ERR_REQ_NO_NET_ON_RSP : 6201, + ERR_SERIVCE_NOT_READY : 6205, + ERR_LOGIN_AUTH_FAILED : 6207, + ERR_NEVER_CONNECT_AFTER_LAUNCH : 6209, + ERR_REQ_FAILED : 6210, + ERR_REQ_INVALID_REQ : 6211, + ERR_REQ_OVERLOADED : 6212, + ERR_REQ_KICK_OFF : 6213, + ERR_REQ_SERVICE_SUSPEND : 6214, + ERR_REQ_INVALID_SIGN : 6215, + ERR_REQ_INVALID_COOKIE : 6216, + ERR_LOGIN_TLS_RSP_PARSE_FAILED : 6217, + ERR_LOGIN_OPENMSG_TIMEOUT : 6218, + ERR_LOGIN_OPENMSG_RSP_PARSE_FAILED : 6219, + ERR_LOGIN_TLS_DECRYPT_FAILED : 6220, + ERR_WIFI_NEED_AUTH : 6221, + ERR_USER_CANCELED : 6222, + ERR_REVOKE_TIME_LIMIT_EXCEED : 6223, + ERR_LACK_UGC_EXT : 6224, + ERR_AUTOLOGIN_NEED_USERSIG : 6226, + ERR_QAL_NO_SHORT_CONN_AVAILABLE : 6300, + ERR_REQ_CONTENT_ATTACK : 80101, + ERR_LOGIN_SIG_EXPIRE : 70101, + ERR_SDK_HAD_INITIALIZED : 90101, + ERR_OPENBDH_BASE : 115000, + ERR_REQUEST_NO_NET_ONREQ : 6250, + ERR_REQUEST_NO_NET_ONRSP : 6251, + ERR_REQUEST_FAILED : 6252, + ERR_REQUEST_INVALID_REQ : 6253, + ERR_REQUEST_OVERLOADED : 6254, + ERR_REQUEST_KICK_OFF : 6255, + ERR_REQUEST_SERVICE_SUSPEND : 6256, + ERR_REQUEST_INVALID_SIGN : 6257, + ERR_REQUEST_INVALID_COOKIE : 6258 +} +/** +* @brief 调用接口的返回值 + +* @note +* 若接口参数中有回调,只有当接口返回TIM_SUCC时,回调才会被调用 +* +* | 名称 | 含义 | 值 | +* | ---- | ---- | ---- | +* | TIM_SUCC | 接口调用成功 | 0 | +* | TIM_ERR_SDKUNINIT | 失败,IM SDK未初始化 | -1 | +* | TIM_ERR_NOTLOGIN | 失败,IM SDK未初始化 | -2 | +* | TIM_ERR_JSON | 接口调用失败,错误的Json格式或Json Key | -3 | +* | TIM_ERR_PARAM | 接口调用失败,参数错误 | -4 | +* | TIM_ERR_CONV | 接口调用失败,无效的会话 | -5 | +* | TIM_ERR_GROUP | 接口调用失败,无效的群组 | -6 | +*/ +const TIMResult= { + TIM_SUCC : 0, + TIM_ERR_SDKUNINIT : -1, + TIM_ERR_NOTLOGIN : -2, + TIM_ERR_JSON : -3, + TIM_ERR_PARAM : -4, + TIM_ERR_CONV : -5, + TIM_ERR_GROUP : -6 +} +/** +* @brief 日志级别 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMLog_Off | 关闭日志输出 | 0 | +* | kTIMLog_Test | 失败,IM SDK未初始化 | 1 | +* | kTIMLog_Verbose | 失败,IM SDK未初始化 | 2 | +* | kTIMLog_Debug | 接口调用失败,错误的Json格式或Json Key | 3 | +* | kTIMLog_Info | 接口调用失败,参数错误 | 4 | +* | kTIMLog_Warn | 接口调用失败,无效的会话 | 5 | +* | kTIMLog_Error | 接口调用失败,无效的群组 | 6 | +* | kTIMLog_Assert | 断言日志| 7 | +*/ +const TIMLogLevel= { + kTIMLog_Off : 0, + kTIMLog_Test : 1, + kTIMLog_Verbose : 2, + kTIMLog_Debug : 3, + kTIMLog_Info : 4, + kTIMLog_Warn : 5, + kTIMLog_Error : 6, + kTIMLog_Assert : 7 +} +/** +* @brief 登陆状态 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMLoginStatus_Logined | 已登陆 | 1 | +* | kTIMLoginStatus_Logining | 登陆中 | 2 | +* | kTIMLoginStatus_UnLogined | 未登陆 | 3 | +* | kTIMLoginStatus_Logouting | 登出中 | 4 | +*/ +const TIMLoginStatus= { + kTIMLoginStatus_Logined : 1, + kTIMLoginStatus_Logining : 2, + kTIMLoginStatus_UnLogined : 3, + kTIMLoginStatus_Logouting : 4 +} +/** +* @brief 连接事件类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMConnected | 已连接 | kTIMConnected | +* | kTIMDisconnected | 失去连接 | kTIMDisconnected | +* | kTIMConnecting | 正在连接 | kTIMConnecting | +* | kTIMConnectFailed | 连接失败 | kTIMConnectFailed | +*/ +const TIMNetworkStatus= { + kTIMConnected : 0, + kTIMDisconnected : 1, + kTIMConnecting : 2, + kTIMConnectFailed : 3 +} +/** +* @brief 会话事件类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMConvEvent_Add | 会话新增,例如收到一条新消息,产生一个新的会话是事件触发 | kTIMConvEvent_Add | +* | kTIMConvEvent_Del | 会话删除,例如自己删除某会话时会触发 | kTIMConvEvent_Del | +* | kTIMConvEvent_Update | 会话更新,会话内消息的未读计数变化和收到新消息时触发 | kTIMConvEvent_Update | +* | kTIMConvEvent_Start | 会话开始 | kTIMConvEvent_Start | +* | kTIMConvEvent_Finish | 会话结束 | kTIMConvEvent_Finish | +*/ +const TIMConvEvent= { + kTIMConvEvent_Add : 0, + kTIMConvEvent_Del : 1, + kTIMConvEvent_Update : 2, + kTIMConvEvent_Start : 3, + kTIMConvEvent_Finish : 4 +} +/** +* @brief 会话类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMConv_Invalid | 无效会话 | kTIMConv_Invalid | +* | kTIMConv_C2C | 个人会话 | kTIMConv_C2C | +* | kTIMConv_Group | 群组会话 | kTIMConv_Group | +* | kTIMConv_System | 系统会话 | kTIMConv_System | +*/ +const TIMConvType= { + kTIMConv_Invalid : 0, + kTIMConv_C2C : 1, + kTIMConv_Group : 2, + kTIMConv_System : 3 +} +/** +* @brief 平台信息 +* +* | 名称 | 含义 | 值(enum/number) | +* | ---- | ---- | ---- | +* | kTIMPlatform_Other | 未知平台 | 0(number) | +* | kTIMPlatform_Windows | Windows平台 | kTIMPlatform_Windows | +* | kTIMPlatform_Android | Android平台 | kTIMPlatform_Android | +* | kTIMPlatform_IOS | iOS平台 | kTIMPlatform_IOS | +* | kTIMPlatform_Mac | MacOS平台 | kTIMPlatform_Mac | +* | kTIMPlatform_Simulator | iOS模拟器平台 | kTIMPlatform_Simulator | +*/ +const TIMPlatform= { + kTIMPlatform_Other : 0, + kTIMPlatform_Windows : 1, + kTIMPlatform_Android : 2, + kTIMPlatform_IOS : 3, + kTIMPlatform_Mac : 4, + kTIMPlatform_Simulator : 5 +} +/** +* @brief 群组成员信息标识 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMPlatform_Other | 无 | 0x00 | +* | kTIMPlatform_Windows | 加入时间 | 0x01 | +* | kTIMPlatform_Android | 群消息接收选项 | 0x01 << 1 | +* | kTIMPlatform_IOS | 成员已读消息seq | 0x01 << 2 | +* | kTIMPlatform_IOS | 成员角色 | 0x01 << 3 | +* | kTIMPlatform_Mac | 禁言时间。当该值为0时表示没有被禁言 | 0x01 << 4, | +* | kTIMPlatform_Simulator | iOS模拟器平台 | 0x01 << 5 | +*/ +const TIMGroupMemberInfoFlag= { + kTIMGroupMemberInfoFlag_None : 0, + kTIMGroupMemberInfoFlag_JoinTime : 1, + kTIMGroupMemberInfoFlag_MsgFlag : 2, + kTIMGroupMemberInfoFlag_MsgSeq : 4, + kTIMGroupMemberInfoFlag_MemberRole : 8, + kTIMGroupMemberInfoFlag_ShutupUntill : 16, + kTIMGroupMemberInfoFlag_NameCard : 32 +} +/** +* @brief 群组成员角色标识 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupMemberRoleFlag_All | 获取全部角色类型 | 0x00 | +* | kTIMGroupMemberRoleFlag_Owner | 获取所有者(群主) | 0x01 | +* | kTIMGroupMemberRoleFlag_Admin | 获取管理员,不包括群主 | 0x01 << 1 | +* | kTIMGroupMemberRoleFlag_Member | 获取普通群成员,不包括群主和管理员 | 0x01 << 2 | +*/ +const TIMGroupMemberRoleFlag= { + kTIMGroupMemberRoleFlag_All : 0, + kTIMGroupMemberRoleFlag_Owner : 1, + kTIMGroupMemberRoleFlag_Admin : 2, + kTIMGroupMemberRoleFlag_Member : 4 +} +/** +* @brief 群组成员信息标识 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupInfoFlag_None | 无 | 0x00 | +* | kTIMGroupInfoFlag_Name | 群组名称 | 0x01 | +* | kTIMGroupInfoFlag_CreateTime | 群组创建时间 | 0x01 << 1 | +* | kTIMGroupInfoFlag_OwnerUin | 群组创建者帐号 | 0x01 << 2 | +* | kTIMGroupInfoFlag_Seq | seq | 0x01 << 3 | +* | kTIMGroupInfoFlag_LastTime | 群组信息最后修改时间 | 0x01 << 4 | +* | kTIMGroupInfoFlag_NextMsgSeq | 下一个消息的seq | 0x01 << 5 | +* | kTIMGroupInfoFlag_LastMsgTime | 最新群组消息时间 | 0x01 << 6 | +* | kTIMGroupInfoFlag_AppId | AppId | 0x01 << 7 | +* | kTIMGroupInfoFlag_MemberNum | 群组成员数量 | 0x01 << 8 | +* | kTIMGroupInfoFlag_MaxMemberNum | 群组成员最大数量 | 0x01 << 9 | +* | kTIMGroupInfoFlag_Notification | 群公告内容 | 0x01 << 10 | +* | kTIMGroupInfoFlag_Introduction | 群简介内容 | 0x01 << 11| +* | kTIMGroupInfoFlag_FaceUrl | 群头像URL | 0x01 << 12 | +* | kTIMGroupInfoFlag_AddOption | 加群选项 | 0x01 << 13 | +* | kTIMGroupInfoFlag_GroupType | 群类型 | 0x01 << 14 | +* | kTIMGroupInfoFlag_LastMsg | 群组内最新一条消息 | 0x01 << 15 | +* | kTIMGroupInfoFlag_OnlineNum | 群组在线成员数 | 0x01 << 16 | +* | kTIMGroupInfoFlag_Visible | 群组是否可见 | 0x01 << 17 | +* | kTIMGroupInfoFlag_Searchable | 群组是否可以搜索 | 0x01 << 18 | +* | kTIMGroupInfoFlag_ShutupAll | 群组是否全禁言 | 0x01 << 19 | +*/ +const TIMGroupGetInfoFlag= { + kTIMGroupInfoFlag_None : 0, + kTIMGroupInfoFlag_Name : 1, + kTIMGroupInfoFlag_CreateTime : 2, + kTIMGroupInfoFlag_OwnerUin : 4, + kTIMGroupInfoFlag_Seq : 8, + kTIMGroupInfoFlag_LastTime : 16, + kTIMGroupInfoFlag_NextMsgSeq : 32, + kTIMGroupInfoFlag_LastMsgTime : 64, + kTIMGroupInfoFlag_AppId : 128, + kTIMGroupInfoFlag_MemberNum : 256, + kTIMGroupInfoFlag_MaxMemberNum : 512, + kTIMGroupInfoFlag_Notification : 1024, + kTIMGroupInfoFlag_Introduction : 2048, + kTIMGroupInfoFlag_FaceUrl : 4096, + kTIMGroupInfoFlag_AddOption : 8192, + kTIMGroupInfoFlag_GroupType : 16384, + kTIMGroupInfoFlag_LastMsg : 32768, + kTIMGroupInfoFlag_OnlineNum : 65536, + kTIMGroupInfoFlag_Visible : 131072, + kTIMGroupInfoFlag_Searchable : 262144, + kTIMGroupInfoFlag_ShutupAll : 524288 +} +/** +* @brief Android离线推送模式 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMAndroidOfflinePushNotifyMode_Normal | 普通通知栏消息模式,离线消息下发后,点击通知栏消息直接启动应用,不会给应用进行回调 | kTIMAndroidOfflinePushNotifyMode_Normal | +* | kTIMAndroidOfflinePushNotifyMode_Custom | 自定义消息模式,离线消息下发后,点击通知栏消息会给应用进行回调 | kTIMAndroidOfflinePushNotifyMode_Custom | +*/ +const TIMAndroidOfflinePushNotifyMode= { + kTIMAndroidOfflinePushNotifyMode_Normal : 0, + kTIMAndroidOfflinePushNotifyMode_Custom : 1 +} +/** +* @brief 推送规则 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMOfflinePushFlag_Default | 按照默认规则进行推送 | kTIMOfflinePushFlag_Default | +* | kTIMOfflinePushFlag_NoPush | 不进行推送 | kTIMOfflinePushFlag_NoPush | +*/ +const TIMOfflinePushFlag= { + kTIMOfflinePushFlag_Default : 0, + kTIMOfflinePushFlag_NoPush : 1 +} +/** +* @brief 消息当前状态定义 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMMsg_Sending | 消息正在发送 | 1 | +* | kTIMMsg_SendSucc | 消息发送成功 | 2 | +* | kTIMMsg_SendFail | 消息发送失败 | 3 | +* | kTIMMsg_Deleted | 消息已删除 | 4 | +* | kTIMMsg_LocalImported | 消息导入状态 | 5 | +* | kTIMMsg_Revoked | 消息撤回状态 | 6 | +* | kTIMMsg_Cancel | 消息取消 | 7 | +*/ +const TIMMsgStatus= { + kTIMMsg_Sending : 1, + kTIMMsg_SendSucc : 2, + kTIMMsg_SendFail : 3, + kTIMMsg_Deleted : 4, + kTIMMsg_LocalImported : 5, + kTIMMsg_Revoked : 6, + kTIMMsg_Cancel : 7 +} +/** +* @brief 标识消息的优先级,数字越大优先级越低 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMMsgPriority_High | 优先级最高,一般为红包或者礼物消息 | kTIMMsgPriority_High | +* | kTIMMsgPriority_Normal | 表示优先级次之,建议为普通消息 | kTIMMsgPriority_Normal | +* | kTIMMsgPriority_Low | 建议为点赞消息等 | kTIMMsgPriority_Low | +* | kTIMMsgPriority_Lowest | 消息发送失败 | kTIMMsgPriority_Lowest | +*/ +const TIMMsgPriority= { + kTIMMsgPriority_High : 0, + kTIMMsgPriority_Normal : 1, + kTIMMsgPriority_Low : 2, + kTIMMsgPriority_Lowest : 3 +} +/** +* @brief 元素的类型 +* +* | 名称 | 含义 | 值(enum/number) | +* | ---- | ---- | ---- | +* | kTIMElem_Text | 文本元素 | kTIMElem_Text | +* | kTIMElem_Image | 图片元素 | kTIMElem_Image | +* | kTIMElem_Sound | 声音元素 | kTIMElem_Sound | +* | kTIMElem_Custom | 自定义元素 | kTIMElem_Custom | +* | kTIMElem_File | 文件元素 | kTIMElem_File | +* | kTIMElem_GroupTips | 群组系统消息元素 | kTIMElem_GroupTips | +* | kTIMElem_Face | 表情元素 | kTIMElem_Face | +* | kTIMElem_Location | 位置元素 | kTIMElem_Location | +* | kTIMElem_GroupReport | 群组系统通知元素 | kTIMElem_GroupReport | +* | kTIMElem_Video | 视频元素 | kTIMElem_Video | +* | kTIMElem_FriendChange | 关系链变更消息元素 | kTIMElem_FriendChange | +* | kTIMElem_ProfileChange | 资料变更消息元素 | kTIMElem_ProfileChange | +* | kTIMElem_Merge | 合并消息素 | kTIMElem_Merge | +* | kTIMElem_Invalid | 未知元素类型 | -1 | +*/ +const TIMElemType= { + kTIMElem_Text : 0, + kTIMElem_Image : 1, + kTIMElem_Sound : 2, + kTIMElem_Custom : 3, + kTIMElem_File : 4, + kTIMElem_GroupTips : 5, + kTIMElem_Face : 6, + kTIMElem_Location : 7, + kTIMElem_GroupReport : 8, + kTIMElem_Video : 9, + kTIMElem_FriendChange : 10, + kTIMElem_ProfileChange : 11, + kTIMElem_Merge : 12, + kTIMElem_Invalid : -1 +} +/** +* @brief 图片质量级别 +* +* | 名称 | 含义 | 值(enum/number) | +* | ---- | ---- | ---- | +* | kTIMImageLevel_Orig | 原图发送 | kTIMImageLevel_Orig | +* | kTIMImageLevel_Compression | 高压缩率图发送(图片较小,默认值) | kTIMImageLevel_Compression | +* | kTIMImageLevel_HD | 高清图发送(图片较大) | kTIMImageLevel_HD | +*/ +const TIMImageLevel= { + kTIMImageLevel_Orig : 0, + kTIMImageLevel_Compression : 1, + kTIMImageLevel_HD : 2 +} +/** +* @brief 群组信息修改的类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroupTipChangeFlag_Unknown | 未知的修改 | kTIMGroupTipChangeFlag_Unknown | +* | kTIMGroupTipChangeFlag_Name | 修改群组名称 | kTIMGroupTipChangeFlag_Name | +* | kTIMGroupTipChangeFlag_Introduction | 修改群简介 | kTIMGroupTipChangeFlag_Introduction | +* | kTIMGroupTipChangeFlag_Notification | 修改群公告 | kTIMGroupTipChangeFlag_Notification | +* | kTIMGroupTipChangeFlag_FaceUrl | 修改群头像URL | kTIMGroupTipChangeFlag_FaceUrl | +* | kTIMGroupTipChangeFlag_Owner | 修改群所有者 | kTIMGroupTipChangeFlag_Owner | +* | kTIMGroupTipChangeFlag_Custom | 修改群自定义信息 | kTIMGroupTipChangeFlag_Custom | +* | kTIMGroupTipChangeFlag_Attribute | 群属性变更 (新增) | kTIMGroupTipChangeFlag_Attribute | +*/ +const TIMGroupTipGroupChangeFlag= { + kTIMGroupTipChangeFlag_Unknown : 0, + kTIMGroupTipChangeFlag_Name : 1, + kTIMGroupTipChangeFlag_Introduction : 2, + kTIMGroupTipChangeFlag_Notification : 3, + kTIMGroupTipChangeFlag_FaceUrl : 4, + kTIMGroupTipChangeFlag_Owner : 5, + kTIMGroupTipChangeFlag_Custom : 6, + kTIMGroupTipChangeFlag_Attribute : 7, + kTIMGroupTipChangeFlag_ShutupAll : 8, + kTIMGroupTipChangeFlag_MessageReceiveOpt : 10, + kTIMGroupTipChangeFlag_GroupAddOpt : 11, + kTIMGroupTipChangeFlag_GroupApproveOpt : 12 +} +/** +* @brief 群组系统消息类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroupTip_None | 无效的群提示 | kTIMGroupTip_None | +* | kTIMGroupTip_Invite | 邀请加入提示 | kTIMGroupTip_Invite | +* | kTIMGroupTip_Quit | 退群提示 | kTIMGroupTip_Quit | +* | kTIMGroupTip_Kick | 踢人提示 | kTIMGroupTip_Kick | +* | kTIMGroupTip_SetAdmin | 设置管理员提示 | kTIMGroupTip_SetAdmin | +* | kTIMGroupTip_CancelAdmin | 取消管理员提示 | kTIMGroupTip_CancelAdmin | +* | kTIMGroupTip_GroupInfoChange | 群信息修改提示 | kTIMGroupTip_GroupInfoChange | +* | kTIMGroupTip_MemberInfoChange | 群成员信息修改提示 | kTIMGroupTip_MemberInfoChange | +*/ +const TIMGroupTipType= { + kTIMGroupTip_None : 0, + kTIMGroupTip_Invite : 1, + kTIMGroupTip_Quit : 2, + kTIMGroupTip_Kick : 3, + kTIMGroupTip_SetAdmin : 4, + kTIMGroupTip_CancelAdmin : 5, + kTIMGroupTip_GroupInfoChange : 6, + kTIMGroupTip_MemberInfoChange : 7 +} +/** +* @brief 群组系统通知类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroupReport_None | 未知类型 | kTIMGroupReport_None | +* | kTIMGroupReport_AddRequest | 申请加群(只有管理员会接收到) | kTIMGroupReport_AddRequest | +* | kTIMGroupReport_AddAccept | 申请加群被同意(只有申请人自己接收到) | kTIMGroupReport_AddAccept | +* | kTIMGroupReport_AddRefuse | 申请加群被拒绝(只有申请人自己接收到) | kTIMGroupReport_AddRefuse | +* | kTIMGroupReport_BeKicked | 被管理员踢出群(只有被踢者接收到) | kTIMGroupReport_BeKicked | +* | kTIMGroupReport_Delete | 群被解散(全员接收) | kTIMGroupReport_AddRefuse | +* | kTIMGroupReport_Create | 创建群(创建者接收, 不展示) | kTIMGroupReport_Create | +* | kTIMGroupReport_Invite | 邀请加群(被邀请者接收) | kTIMGroupReport_Invite | +* | kTIMGroupReport_Quit | 主动退群(主动退出者接收, 不展示) | kTIMGroupReport_Quit | +* | kTIMGroupReport_GrantAdmin | 设置管理员(被设置者接收) | kTIMGroupReport_GrantAdmin | +* | kTIMGroupReport_CancelAdmin | 取消管理员(被取消者接收) | kTIMGroupReport_CancelAdmin | +* | kTIMGroupReport_GroupRecycle | 群已被回收(全员接收, 不展示) | kTIMGroupReport_GroupRecycle | +* | kTIMGroupReport_InviteReq | 邀请加群(只有被邀请者会接收到) | kTIMGroupReport_InviteReq | +* | kTIMGroupReport_InviteAccept | 邀请加群被同意(只有发出邀请者会接收到) | kTIMGroupReport_InviteAccept | +* | kTIMGroupReport_InviteRefuse | 邀请加群被拒绝(只有发出邀请者会接收到) | kTIMGroupReport_InviteRefuse | +* | kTIMGroupReport_ReadReport | 已读上报多终端同步通知(只有上报人自己收到) | kTIMGroupReport_ReadReport | +* | kTIMGroupReport_UserDefine | 用户自定义通知(默认全员接收) | kTIMGroupReport_UserDefine | +*/ +const TIMGroupReportType= { + kTIMGroupReport_None : 0, + kTIMGroupReport_AddRequest : 1, + kTIMGroupReport_AddAccept : 2, + kTIMGroupReport_AddRefuse : 3, + kTIMGroupReport_BeKicked : 4, + kTIMGroupReport_Delete : 5, + kTIMGroupReport_Create : 6, + kTIMGroupReport_Invite : 7, + kTIMGroupReport_Quit : 8, + kTIMGroupReport_GrantAdmin : 9, + kTIMGroupReport_CancelAdmin : 10, + kTIMGroupReport_GroupRecycle : 11, + kTIMGroupReport_InviteReq : 12, + kTIMGroupReport_InviteAccept : 13, + kTIMGroupReport_InviteRefuse : 14, + kTIMGroupReport_ReadReport : 15, + kTIMGroupReport_UserDefine : 16 +} +/** +* @brief 资料变更类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroupReport_None | 未知类型 | kTIMGroupReport_None | +* | kTIMProfileChange_Profile | 资料修改 | kTIMProfileChange_Profile | +*/ +const TIMProfileChangeType= { + kTIMProfileChange_None : 0, + kTIMProfileChange_Profile : 1 +} +/** +* @brief 好友变更类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMFriendChange_None | 未知类型 | kTIMFriendChange_None | +* | kTIMFriendChange_FriendAdd | 好友表增加 | kTIMFriendChange_FriendAdd | +* | kTIMFriendChange_FriendDel | 好友表删除 | kTIMFriendChange_FriendDel | +* | kTIMFriendChange_PendencyAdd | 未决增加 | kTIMFriendChange_PendencyAdd | +* | kTIMFriendChange_PendencyDel | 未决删除 | kTIMFriendChange_PendencyDel | +* | kTIMFriendChange_BlackListAdd | 黑名单添加 | kTIMFriendChange_BlackListAdd | +* | kTIMFriendChange_BlackListDel | 黑名单删除 | kTIMFriendChange_BlackListDel | +* | kTIMFriendChange_PendencyReadedReport | 未决已读上报 | kTIMFriendChange_PendencyReadedReport | +* | kTIMFriendChange_FriendProfileUpdate | 好友数据更新 | kTIMFriendChange_FriendProfileUpdate | +* | kTIMFriendChange_FriendGroupAdd | 分组增加 | kTIMFriendChange_FriendGroupAdd | +* | kTIMFriendChange_FriendGroupDel | 分组删除 | kTIMFriendChange_FriendGroupDel | +* | kTIMFriendChange_FriendGroupModify | 分组修改 | kTIMFriendChange_FriendGroupModify | +*/ +const TIMFriendChangeType= { + kTIMFriendChange_None : 0, + kTIMFriendChange_FriendAdd : 1, + kTIMFriendChange_FriendDel : 2, + kTIMFriendChange_PendencyAdd : 3, + kTIMFriendChange_PendencyDel : 4, + kTIMFriendChange_BlackListAdd : 5, + kTIMFriendChange_BlackListDel : 6, + kTIMFriendChange_PendencyReadedReport : 7, + kTIMFriendChange_FriendProfileUpdate : 8, + kTIMFriendChange_FriendGroupAdd : 9, + kTIMFriendChange_FriendGroupDel : 10, + kTIMFriendChange_FriendGroupModify : 11 +} +/** +* @brief 消息接收选项 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMRecvMsgOpt_Receive | 在线正常接收消息,离线时会进行 APNs 推送 | kTIMRecvMsgOpt_Receive | +* | kTIMRecvMsgOpt_Not_Receive | 不会接收到消息,离线不会有推送通知 | kTIMRecvMsgOpt_Not_Receive | +* | kTIMRecvMsgOpt_Not_Notify | 在线正常接收消息,离线不会有推送通知 | kTIMRecvMsgOpt_Not_Notify | +*/ +const TIMReceiveMessageOpt= { + kTIMRecvMsgOpt_Receive : 0, + kTIMRecvMsgOpt_Not_Receive : 1, + kTIMRecvMsgOpt_Not_Notify : 2 +} +/** +* @brief UUID类型 +* +* | 名称 | 含义 | 值(enum/number) | +* | ---- | ---- | ---- | +* | kTIMDownload_VideoThumb | 视频缩略图 | 0 | +* | kTIMDownload_File | 文件 | kTIMDownload_File | +* | kTIMDownload_Video | 视频 | kTIMDownload_Video | +* | kTIMDownload_Sound | 声音 | kTIMDownload_Sound | +*/ +const TIMDownloadType= { + kTIMDownload_VideoThumb : 0, + kTIMDownload_File : 1, + kTIMDownload_Video : 2, + kTIMDownload_Sound : 3 +} +/** +* @brief @ 类型 +* +* | 名称 | 含义 | 值(enum/number) | +* | ---- | ---- | ---- | +* | kTIMGroup_At_Me | @ 我 | 1 | +* | kTIMGroup_At_All | @ 群里所有人 | kTIMGroup_At_All | +* | kTIMGroup_At_All_At_ME | @ 群里所有人并且单独 @ 我 | kTIMGroup_At_All_At_ME | +*/ +const TIMGroupAtType= { + kTIMGroup_At_Me : 1, + kTIMGroup_At_All : 2, + kTIMGroup_At_All_At_ME : 3 +} +const TIMConversationMarkType= { + kTIMConversationMarkTypeStar : 1, + kTIMConversationMarkTypeUnread : 2, + kTIMConversationMarkTypeFold : 4, + kTIMConversationMarkTypeHide : 8 +} +/** +* @brief 群组加群选项 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupAddOpt_Forbid | 禁止加群 | 0 | +* | kTIMGroupAddOpt_Auth | 需要管理员审批 | 1 | +* | kTIMGroupAddOpt_Any | 任何人都可以加群 | 2 | +*/ +const TIMGroupAddOption= { + kTIMGroupAddOpt_Forbid : 0, + kTIMGroupAddOpt_Auth : 1, + kTIMGroupAddOpt_Any : 2 +} +/** +* @brief 群组类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroup_Public | 公开群 | kTIMGroup_Public | +* | kTIMGroup_Private | 私有群 | kTIMGroup_Private | +* | kTIMGroup_ChatRoom | 聊天室 | kTIMGroup_ChatRoom | +* | kTIMGroup_BChatRoom | 在线成员广播大群 | kTIMGroup_BChatRoom | +* | kTIMGroup_AVChatRoom | 互动直播聊天室 | kTIMGroup_AVChatRoom | +*/ +const TIMGroupType= { + kTIMGroup_Public : 0, + kTIMGroup_Private : 1, + kTIMGroup_ChatRoom : 2, + kTIMGroup_BChatRoom : 3, + kTIMGroup_AVChatRoom : 4, + kTIMGroup_Community : 5 +} +/** +* @brief 群组成员角色类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMMemberRole_None | 未定义 | kTIMMemberRole_None | +* | kTIMMemberRole_Normal | 群成员 | kTIMMemberRole_Normal | +* | kTIMMemberRole_Admin | 管理员 | kTIMMemberRole_Admin | +* | kTIMMemberRole_Owner | 超级管理员(群主) | kTIMMemberRole_Owner | +*/ +const TIMGroupMemberRole= { + kTIMMemberRole_None : 0, + kTIMMemberRole_Normal : 1, + kTIMMemberRole_Admin : 2, + kTIMMemberRole_Owner : 3 +} +/** +* @brief 群组基础信息 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGroupMember_HandledErr | 失败 | kTIMGroupMember_HandledErr | +* | kTIMGroupMember_HandledSuc | 成功 | kTIMGroupMember_HandledSuc | +* | kTIMGroupMember_Included | 已是群成员 | kTIMGroupMember_Included | +* | kTIMGroupMember_Invited | 已发送邀请 | kTIMGroupMember_Invited | +*/ +const HandleGroupMemberResult= { + kTIMGroupMember_HandledErr : 0, + kTIMGroupMember_HandledSuc : 1, + kTIMGroupMember_Included : 2, + kTIMGroupMember_Invited : 3 +} +/** +* @brief 设置(修改)群组信息的类型 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupModifyInfoFlag_None | 无 | 0x00 | +* | kTIMGroupModifyInfoFlag_Name | 修改群组名称 | 0x01 | +* | kTIMGroupModifyInfoFlag_Notification | 修改群公告 | 0x01 << 1 | +* | kTIMGroupModifyInfoFlag_Introduction | 修改群简介 | 0x01 << 2 | +* | kTIMGroupModifyInfoFlag_FaceUrl | 修改群头像URL | 0x01 << 3 | +* | kTIMGroupModifyInfoFlag_AddOption | 修改群组添加选项 | 0x01 << 4 | +* | kTIMGroupModifyInfoFlag_MaxMmeberNum | 修改群最大成员数 | 0x01 << 5 | +* | kTIMGroupModifyInfoFlag_Visible | 修改群是否可见 | 0x01 << 6 | +* | kTIMGroupModifyInfoFlag_Searchable | 修改群是否被搜索 | 0x01 << 7 | +* | kTIMGroupModifyInfoFlag_ShutupAll | 修改群是否全体禁言 | 0x01 << 8 | +* | kTIMGroupModifyInfoFlag_Custom | 修改群自定义信息 | 0x01 << 9 | +* | kTIMGroupModifyInfoFlag_Owner | 修改群主 | 0x01 << 31 | +*/ +const TIMGroupModifyInfoFlag= { + kTIMGroupModifyInfoFlag_None : 0, + kTIMGroupModifyInfoFlag_Name : 1, + kTIMGroupModifyInfoFlag_Notification : 2, + kTIMGroupModifyInfoFlag_Introduction : 4, + kTIMGroupModifyInfoFlag_FaceUrl : 8, + kTIMGroupModifyInfoFlag_AddOption : 16, + kTIMGroupModifyInfoFlag_MaxMemberNum : 32, + kTIMGroupModifyInfoFlag_Visible : 64, + kTIMGroupModifyInfoFlag_Searchable : 128, + kTIMGroupModifyInfoFlag_ShutupAll : 256, + kTIMGroupModifyInfoFlag_Custom : 512, + kTIMGroupTopicModifyInfoFlag_CustomString : 2048, + kTIMGroupModifyInfoFlag_ApproveOption : 4096, + kTIMGroupModifyInfoFlag_Owner : -2147483648 +} +/** +* @brief 设置(修改)群成员信息的类型 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupMemberModifyFlag_None | 无 | 0x00 | +* | kTIMGroupMemberModifyFlag_MsgFlag | 修改消息接收选项 | 0x01 | +* | kTIMGroupMemberModifyFlag_MemberRole | 修改成员角色 | 0x01 << 1 | +* | kTIMGroupMemberModifyFlag_ShutupTime | 修改禁言时间 | 0x01 << 2 | +* | kTIMGroupMemberModifyFlag_NameCard | 修改群名片 | 0x01 << 3 | +* | kTIMGroupMemberModifyFlag_Custom | 修改群成员自定义信息 | 0x01 << 4 | +*/ +const TIMGroupMemberModifyInfoFlag= { + kTIMGroupMemberModifyFlag_None : 0, + kTIMGroupMemberModifyFlag_MsgFlag : 1, + kTIMGroupMemberModifyFlag_MemberRole : 2, + kTIMGroupMemberModifyFlag_ShutupTime : 4, + kTIMGroupMemberModifyFlag_NameCard : 8, + kTIMGroupMemberModifyFlag_Custom : 16 +} +/** +* @brief 未决请求类型 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupPendency_RequestJoin | 请求加群 | 0 | +* | kTIMGroupPendency_InviteJoin | 邀请加群 | 1 | +* | kTIMGroupPendency_ReqAndInvite | 邀请和请求的 | 2 | +*/ +const TIMGroupPendencyType= { + kTIMGroupPendency_RequestJoin : 0, + kTIMGroupPendency_InviteJoin : 1, + kTIMGroupPendency_ReqAndInvite : 2 +} +/** +* @brief 群未决处理状态 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupPendency_NotHandle | 未处理 | 0 | +* | kTIMGroupPendency_OtherHandle | 他人处理 | 1 | +* | kTIMGroupPendency_OperatorHandle | 操作方处理 | 2 | +*/ +const TIMGroupPendencyHandle= { + kTIMGroupPendency_NotHandle : 0, + kTIMGroupPendency_OtherHandle : 1, + kTIMGroupPendency_OperatorHandle : 2 +} +/** +* @brief 群未决处理操作类型 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupPendency_Refuse | 拒绝 | 0 | +* | kTIMGroupPendency_Accept | 同意 | 1 | +*/ +const TIMGroupPendencyHandleResult= { + kTIMGroupPendency_Refuse : 0, + kTIMGroupPendency_Accept : 1 +} +/** +* @brief 群搜索 Field 的枚举 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupSearchFieldKey_GroupId | 群 ID | 0x01 | +* | kTIMGroupSearchFieldKey_GroupName | 群名称 | 0x01 << 1 | +*/ +const TIMGroupSearchFieldKey= { + kTIMGroupSearchFieldKey_GroupId : 1, + kTIMGroupSearchFieldKey_GroupName : 2 +} +/** +* @brief 群成员搜索 Field 的枚举 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMGroupMemberSearchFieldKey_Identifier | 用户 ID | 0x01 | +* | kTIMGroupMemberSearchFieldKey_NikeName | 昵称 | 0x01 << 1 | +* | kTIMGroupMemberSearchFieldKey_Remark | 备注 | 0x01 << 2 | +* | kTIMGroupMemberSearchFieldKey_NameCard | 名片 | 0x01 << 3 | +*/ +const TIMGroupMemberSearchFieldKey= { + kTIMGroupMemberSearchFieldKey_Identifier : 1, + kTIMGroupMemberSearchFieldKey_NickName : 2, + kTIMGroupMemberSearchFieldKey_Remark : 4, + kTIMGroupMemberSearchFieldKey_NameCard : 8 +} +/** +* @brief 用户性别类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMGenderType_Unkown | 未知性别 | kTIMGenderType_Unkown | +* | kTIMGenderType_Male | 性别男 | kTIMGenderType_Male | +* | kTIMGenderType_Female | 性别女 | kTIMGenderType_Female | +*/ +const TIMGenderType= { + kTIMGenderType_Unknown : 0, + kTIMGenderType_Male : 1, + kTIMGenderType_Female : 2 +} +/** +* @brief 用户加好友的选项 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | kTIMProfileAddPermission_Unknown | 未知 | kTIMProfileAddPermission_Unknown | +* | kTIMProfileAddPermission_AllowAny | 允许任何人添加好友 | kTIMProfileAddPermission_AllowAny | +* | kTIMProfileAddPermission_NeedConfirm | 添加好友需要验证 | kTIMProfileAddPermission_NeedConfirm | +* | kTIMProfileAddPermission_DenyAny | 拒绝任何人添加好友 | kTIMProfileAddPermission_DenyAny | +*/ +const TIMProfileAddPermission= { + kTIMProfileAddPermission_Unknown : 0, + kTIMProfileAddPermission_AllowAny : 1, + kTIMProfileAddPermission_NeedConfirm : 2, + kTIMProfileAddPermission_DenyAny : 3 +} +/** +* @brief 好友类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | FriendTypeSignle | 单向好友:用户A的好友表中有用户B,但B的好友表中却没有A | FriendTypeSignle | +* | FriendTypeBoth | 双向好友:用户A的好友表中有用户B,B的好友表中也有A | FriendTypeBoth | +*/ +const TIMFriendType= { + FriendTypeSingle : 0, + FriendTypeBoth : 1 +} +/** +* @brief 好友添加请求未决类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | FriendPendencyTypeComeIn | 别人发给我的 | FriendPendencyTypeComeIn | +* | FriendPendencyTypeSendOut | 我发给别人的 | FriendPendencyTypeSendOut | +* | FriendPendencyTypeBoth | 双向的 | FriendPendencyTypeBoth | +*/ +const TIMFriendPendencyType= { + FriendPendencyTypeComeIn : 0, + FriendPendencyTypeSendOut : 1, + FriendPendencyTypeBoth : 2 +} +/** +* @brief 好友添加请求响应的动作类型 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | ResponseActionAgree | 同意 | ResponseActionAgree | +* | ResponseActionAgreeAndAdd | 同意并添加 | ResponseActionAgreeAndAdd | +* | ResponseActionReject | 拒绝 | ResponseActionReject | +*/ +const TIMFriendResponseAction= { + ResponseActionAgree : 0, + ResponseActionAgreeAndAdd : 1, + ResponseActionReject : 2 +} +/** +* @brief 二者之间的关系 +* +* | 名称 | 含义 | 值(enum) | +* | ---- | ---- | ---- | +* | FriendCheckNoRelation | 无关系 | FriendCheckNoRelation | +* | FriendCheckAWithB | 仅A中有B | FriendCheckAWithB | +* | FriendCheckBWithA | 仅B中有A | FriendCheckBWithA | +* | FriendCheckBothWay | 双向的 | FriendCheckBothWay | +*/ +const TIMFriendCheckRelation= { + FriendCheckNoRelation : 0, + FriendCheckAWithB : 1, + FriendCheckBWithA : 2, + FriendCheckBothWay : 3 +} +/** +* @brief 好友搜索的枚举 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMFriendshipSearchFieldKey_Identifier | userid | 0x01 | +* | kTIMFriendshipSearchFieldKey_NikeName | 昵称 | 0x01 << 1 | +* | kTIMFriendshipSearchFieldKey_Remark | 备注 | 0x01 << 2 | +*/ +const TIMFriendshipSearchFieldKey= { + kTIMFriendshipSearchFieldKey_Identifier : 1, + kTIMFriendshipSearchFieldKey_NickName : 2, + kTIMFriendshipSearchFieldKey_Remark : 4 +} +/** +* @brief 二者之间的关系 +* +* | 名称 | 含义 | 值(number) | +* | ---- | ---- | ---- | +* | kTIMFriendshipRelationType_None | 未知关系 | 0 | +* | kTIMFriendshipRelationType_InMyFriendList | 向好友:对方是我的好友,我不是对方的好友 | 0x01 << 1 | +* | kTIMFriendshipRelationType_InOtherFriendList | 单向好友:对方不是我的好友,我是对方的好友 | 0x01 << 2 | +* | kTIMFriendshipRelationType_BothFriend | 双向好友 | 0x01 <<2 TODO 值感觉不对 | +*/ +const TIMFriendshipRelationType= { + kTIMFriendshipRelationType_None : 0, + kTIMFriendshipRelationType_InMyFriendList : 2, + kTIMFriendshipRelationType_InOtherFriendList : 4, + kTIMFriendshipRelationType_BothFriend : 4 +} +/** +* @brief 实验性接口的操作类型 +*/ +const TIMInternalOperation= { + kTIMInternalOperationSSOData : "internal_operation_sso_data", + kTIMInternalOperationUserId2TinyId : "internal_operation_userid_tinyid", + kTIMInternalOperationTinyId2UserId : "internal_operation_tinyid_userid", + kTIMInternalOperationSetEnv : "internal_operation_set_env", + kTIMInternalOperationSetMaxRetryCount : "internal_operation_set_max_retry_count", + kTIMInternalOperationSetPrivatizationInfo : "internal_operation_set_privatization_info", + kTIMInternalOperationInitLocalStorage : "internal_operation_init_local_storage", + kTIMInternalOperationSetUIPlatform : "internal_operation_set_ui_platform", + kTIMInternalOperationSetCosSaveRegionForConversation : "internal_operation_set_cos_save_region_for_conversation", + kTIMInternalOperationSetIPv6Prior : "internal_operation_set_ipv6_prior", + kTIMInternalOperationSetPacketRequestTimeout : "internal_operation_set_packet_request_timeout", + kTIMInternalOperationSetCustomServerInfo : "internal_operation_set_custom_server_info", + kTIMInternalOperationSetQuicChannelInfo : "internal_operation_set_quic_channel_info", + kTIMInternalOperationSetSM4GCMCallback : "internal_operation_set_sm4_gcm_callback", + kTIMInternalOperationSetDatabaseEncryptInfo : "internal_operation_set_database_encrypt_info", + kTIMInternalOperationIsCommercialAbilityEnabled : "internal_operation_is_commercial_ability_enabled", + kTIMInternalOperationSetOfflinePushState : "internal_operation_set_offline_push_state", + kTIMInternalOperationGetOfflinePushState : "internal_operation_get_offline_push_state", + kTIMInternalOperationGetMessageRevoker : "internal_operation_get_message_revoker", + kTIMInternalOperationWriteLog : "internal_operation_write_log", + kTIMInternalOperationClearLocalHistoryMessage : "internal_operation_clear_local_history_message" +} +/** +* @brief ios 离线推送的类型 +*/ +const TIMIOSOfflinePushType= { + TIMIOSOfflinePushType_APNS : 0, + TIMIOSOfflinePushType_VOIP : 1 +} +/** +* @brief 离线推送注册的token类型 +*/ +const TIMOfflinePushTokenType= { + TIMOfflinePushTokenType_Default : 0, + TIMOfflinePushTokenType_TPNS : 1, + TIMOfflinePushTokenType_VOIP : 2 +} +/** +* @brief 用户状态类型 +*/ +const TIMUserStatusType= { + kTIMUserStatusType_Unkown : 0, + kTIMUserStatusType_Online : 1, + kTIMUserStatusType_Offline : 2, + kTIMUserStatusType_UnLogined : 3 +} +const TIMSignalingActionType= { + TIMSignalingActionType_Unknown : 0, + TIMSignalingActionType_Invite : 1, + TIMSignalingActionType_CancelInvite : 2, + TIMSignalingActionType_AcceptInvite : 3, + TIMSignalingActionType_RejectInvite : 4, + TIMSignalingActionType_InviteTimeout : 5 +} +const TIMPermissionGroupModifyInfoFlag= { + kTIMPermissionGroupModifyInfoFlag_None : 0, + kTIMPermissionGroupModifyInfoFlag_Name : 1, + kTIMPermissionGroupModifyInfoFlag_GroupPermission : 2, + kTIMPermissionGroupModifyInfoFlag_CustomData : 4 +} +const V2TIMCommunityPermissionValue= { + V2TIM_COMMUNITY_PERMISSION_MANAGE_GROUP_INFO : 1, + V2TIM_COMMUNITY_PERMISSION_MANAGE_GROUP_MEMBER : 2, + V2TIM_COMMUNITY_PERMISSION_MANAGE_PERMISSION_GROUP_INFO : 4, + V2TIM_COMMUNITY_PERMISSION_MANAGE_PERMISSION_GROUP_MEMBER : 8, + V2TIM_COMMUNITY_PERMISSION_MANAGE_TOPIC_IN_COMMUNITY : 16, + V2TIM_COMMUNITY_PERMISSION_MUTE_MEMBER : 32, + V2TIM_COMMUNITY_PERMISSION_SEND_MESSAGE : 64, + V2TIM_COMMUNITY_PERMISSION_AT_ALL : 128, + V2TIM_COMMUNITY_PERMISSION_GET_HISTORY_MESSAGE : 256, + V2TIM_COMMUNITY_PERMISSION_REVOKE_OTHER_MEMBER_MESSAGE : 512, + V2TIM_COMMUNITY_PERMISSION_BAN_MEMBER : 1024 +} +const V2TIMTopicPermissionValue= { + V2TIM_TOPIC_PERMISSION_MANAGE_TOPIC : 1, + V2TIM_TOPIC_PERMISSION_MANAGE_TOPIC_PERMISSION : 2, + V2TIM_TOPIC_PERMISSION_MUTE_MEMBER : 4, + V2TIM_TOPIC_PERMISSION_SEND_MESSAGE : 8, + V2TIM_TOPIC_PERMISSION_GET_HISTORY_MESSAGE : 16, + V2TIM_TOPIC_PERMISSION_REVOKE_OTHER_MEMBER_MESSAGE : 32, + V2TIM_TOPIC_PERMISSION_AT_ALL : 64 +} + +export { HandleGroupMemberResult, TIMAndroidOfflinePushNotifyMode, TIMConvEvent, TIMConvType, TIMConversationMarkType, TIMDownloadType, TIMElemType, TIMErrCode, TIMFriendChangeType, TIMFriendCheckRelation, TIMFriendPendencyType, TIMFriendResponseAction, TIMFriendType, TIMFriendshipRelationType, TIMFriendshipSearchFieldKey, TIMGenderType, TIMGroupAddOption, TIMGroupAtType, TIMGroupGetInfoFlag, TIMGroupMemberInfoFlag, TIMGroupMemberModifyInfoFlag, TIMGroupMemberRole, TIMGroupMemberRoleFlag, TIMGroupMemberSearchFieldKey, TIMGroupModifyInfoFlag, TIMGroupPendencyHandle, TIMGroupPendencyHandleResult, TIMGroupPendencyType, TIMGroupReportType, TIMGroupSearchFieldKey, TIMGroupTipGroupChangeFlag, TIMGroupTipType, TIMGroupType, TIMIOSOfflinePushType, TIMImageLevel, TIMInternalOperation, TIMLogLevel, TIMLoginStatus, TIMMsgPriority, TIMMsgStatus, TIMNetworkStatus, TIMOfflinePushFlag, TIMOfflinePushTokenType, TIMPermissionGroupModifyInfoFlag, TIMPlatform, TIMProfileAddPermission, TIMProfileChangeType, TIMReceiveMessageOpt, TIMResult, TIMSignalingActionType, TIMUserStatusType, V2TIMCommunityPermissionValue, V2TIMTopicPermissionValue }; diff --git a/src/renderer/src/plugins/imChat/index.js b/src/renderer/src/plugins/imChat/index.js new file mode 100644 index 0000000..4174652 --- /dev/null +++ b/src/renderer/src/plugins/imChat/index.js @@ -0,0 +1,198 @@ +/** + * @description imChat 腾讯-即时通讯(无ui) + * 文档地址:https://cloud.tencent.com/document/product/269/75285 + * 文档地址:https://cloud.tencent.com/document/product/269/63007 (electron) + * @author: zdg + * @date 2023-07-03 + */ +// const TimRender = require('im_electron_sdk/dist/render') +import * as TYPES from './enumbers' +const API = window.api +// TIM生成签名 +// import * as GenerateUserSig from './userSig' // 引入签名生成器 +export class ImChat { + timChat // imChat对象 + SDKAppID // sdkID + secretKey // key + userID // 用户id + timGroupId // 群组id + userSig // 签名 + status = { // 状态 + isLogin: false, // 是否登录 + isConnect: false, // 是否连接 + } + defOption = { // 默认配置 + // 日志等级-全量日志 + log_level: TYPES.TIMLogLevel.kTIMLog_Test, + // 群组类型-会议群(Meeting),成员上限 6000 人 + group_type: TYPES.TIMGroupType.kTIMGroup_ChatRoom, + } + + + constructor(SDKAppID, userSig, userID, isInit) { + this.SDKAppID = SDKAppID + // this.userSig = userSig + const sig = 'eJwtjN0KgjAYQN9l16Vzcz8I3RhE9J*JV94IW-ZV6nASWfTurfTynAPnjdLNyXvoFkWIeBhN-gxK1x2cYdCMTQnlYmxW3QpjQKEo4BhjGgrKh6KfBlrtPGOMuDTYDqqfE26BWUjEeIHSrW1cL-SulHd5KI7zxDbpdh1cX0nuX7JK7HtroNerZhnnPpYz9PkCe5Mx1w__' + this.userSig = sig + this.userID = userID + window.test = this + if (isInit) return this.init() + } + // 设置配置 + async setConfig() { + await this.timChat.TIMSetConfig({ // TIMSetConfigParam + json_config: { // JSONCongfig + set_config_log_level: this.defOption.log_level, + set_config_callback_log_level: this.defOption.log_level, + // set_config_is_log_output_console: true, + // set_config_user_config: { // 用户配置 + // user_config_is_read_receipt: true, // true表示要收已读回执事件 + // user_config_is_sync_report: true, // true表示服务端要删掉已读状态 + // user_config_is_ignore_grouptips_unread: true, // true表示群tips不计入群消息已读计数 + // user_config_is_is_disable_storage: false, // 是否禁用本地数据库,true表示禁用,false表示不禁用。默认是false + // user_config_group_getinfo_option // 获取群组信息默认选项 + // user_config_group_member_getinfo_option // 获取群组成员信息默认选项 + // }, + // set_config_user_define_data // 自定义数据,如果需要,初始化前设置 + }, + user_data: '', + }) + // 日志监听 + this.timChat.TIMSetLogCallback({ + callback: data => { + console.log('[im-chat]:', data[1]) + }, + user_data: '' + }) + } + // 初始化-imChat + init() { + return new Promise(async(resolve, reject) => { + try { + if(!API) reject('preload api获取失败, 初始化-未完成') + this.timChat = await API.getTimRender() + await this.timChat.TIMInit() + console.log('[im-chat]:初始化成功') + this.status.isConnect = true + this.setConfig() // 设置日志级别 + resolve(this) + } catch (error) {reject(error)} + }) + } + // 生成签名 + genTestUserSig() { + const options = { + SDKAppID: this.SDKAppID, + secretKey: this.secretKey, + userID: this.userID, + } + const { userSig } = GenerateUserSig.genTestUserSig(options) + this.userSig = userSig + } + // 监听 + watch(callback) { + this.timChat.TIMAddRecvNewMsgCallback({ + callback, user_data: {type:'msg'} + }) + } + // 登录 + login() { + const fn = async (resolve, reject) => { + const option = { + userID: this.userID, + userSig: this.userSig, + } + // 获取登录状态 + // [1,2,3,4] | [已登陆,登录中,未登录,登出中] + console.log('登录', this) + const status = await this.timChat.TIMGetLoginStatus() + if (status == 3) { // 未登录 + const res = await this.timChat.TIMLogin(option) + if (res && res.code == 0) { + console.log('登录成功', res) + this.status.isLogin = true + resolve({status:0, msg:'登录成功', data:res}) + } else reject(res) + } else { + if (status == 1) { // 已登录 + console.log('已登录') + resolve({status, msg:'已登录'}) + } else if (status == 2) { // 登录中 + console.log('登录中') + resolve({status, msg:'登录中'}) + } else if (status == 4) { // 登出中 + console.log('登出中') + resolve({status, msg:'登出中'}) + } + } + + } + return new Promise(fn) + } + // 登出 + logout() { + if (!this.timChat) return + return this.timChat.TIMLogout().then(res => { + console.log('登出成功', res) + this.status.isLogin = false + return res + }).catch(error => { + console.log('登出失败', error) + return error + }) + } + // 创建群组 群名和初始成员 userID + createGroup(name, memberList=[]) { + if (!this.timChat) return + if (!!this.timGroupId) return console.log('群组已存在') + // 转换初始成员id,userID 转 group_member_info_identifier + if (memberList && memberList.length) { + memberList = memberList.map(o => ({group_member_info_identifier:o.userID})) + } + const option = { // CreateGroupParams + params: { // GroupParams + // create_group_param_group_name: 群组名称(必填) + // create_group_param_group_id: 群组ID,不填时创建成功回调会返回一个后台分配的群ID + // create_group_param_group_type 群组类型,默认为Public + // create_group_param_group_member_array 群组初始成员数组 + // create_group_param_notification 群组公告 + // create_group_param_introduction 群组简介 + // create_group_param_face_url 群组头像URL + // create_group_param_add_option 加群选项,默认为Any + // create_group_param_max_member_num 群组最大成员数 + // create_group_param_custom_info 请参考自定义字段 + create_group_param_group_name: name, + create_group_param_group_type: this.defOption.group_type, + create_group_param_max_member_num: 200, + create_group_param_group_member_array: memberList + }, + data: '', // 用户自定义数据 + } + // @TGS#3XVNI6ZOG + return this.timChat.TIMGroupCreate(option).then(res => { + if (res && res.code == 0) { + const timGroupId = res?.json_param?.create_group_result_groupid + if (!!timGroupId) this.timGroupId = timGroupId + } + return res + }) + } + // 删除群组 + deleteGroup() { + if (!this.timGroupId) return + return this.timChat.TIMGroupDelete({ + groupId: this.timGroupId, + data: '', // 用户自定义数据 + }) + } + // 获取群组列表 + getGroupList() { + return this.timChat.getGroupList().then(res => { + console.log('获取群组列表', res) + return res + }).catch(error => { + console.log('获取群组列表失败', error) + return error + }) + } +} \ No newline at end of file diff --git a/src/renderer/src/plugins/imChat/lib-generate-test-usersig-es.min.js b/src/renderer/src/plugins/imChat/lib-generate-test-usersig-es.min.js new file mode 100644 index 0000000..b01b70b --- /dev/null +++ b/src/renderer/src/plugins/imChat/lib-generate-test-usersig-es.min.js @@ -0,0 +1,2 @@ +/*eslint-disable*/ +var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=e.length;n>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return a.join("")}function s(e){var r;i||o();for(var n=e.length,s=n%3,h="",l=[],f=0,c=n-s;fc?c:f+16383));return 1===s?(r=e[n-1],h+=t[r>>2],h+=t[r<<4&63],h+="=="):2===s&&(r=(e[n-2]<<8)+e[n-1],h+=t[r>>10],h+=t[r>>4&63],h+=t[r<<2&63],h+="="),l.push(h),l.join("")}function h(e,t,r,n,i){var o,a,s=8*i-n-1,h=(1<>1,f=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=u,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=u,f-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)}function l(e,t,r,n,i,o){var a,s,h,l=8*o-i-1,f=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),(t+=a+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*h-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}var f={}.toString,c=Array.isArray||function(e){return"[object Array]"==f.call(e)};function u(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(u()=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function y(e){return!(null==e||!e._isBuffer)}function m(e,t){if(y(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return q(e).length;t=(""+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),y(t))return 0===t.length?-1:x(e,t,r,n,i);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){var o,a=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,h/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-h),o=r;o>=0;o--){for(var c=!0,u=0;ui&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?s(e):s(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(h=(31&l)<<6|63&o)>127&&(f=h);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,n,i){if(!y(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return z(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,o){if(!y(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||j(e,0,r,4),l(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||j(e,0,r,8),l(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),h(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),h(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),h(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),h(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return function(e){var t,a,s,h,l,f;i||o();var c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===e[c-2]?2:"="===e[c-1]?1:0,f=new n(3*c/4-l),s=l>0?c-4:c;var u=0;for(t=0,a=0;t>16&255,f[u++]=h>>8&255,f[u++]=255&h;return 2===l?(h=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,f[u++]=255&h):1===l&&(h=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,f[u++]=h>>8&255,f[u++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return null!=e&&(!!e._isBuffer||J(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&J(e.slice(0,0))}(e))}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Q(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=Q(function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,h=i/s,l=(h=t?e.ceil(h):e.max((0|h)-this._minBufferSize,0))*o,f=e.min(4*l,i);if(l){for(var c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),Q(function(e,t){var r,n,i;e.exports=(i=(n=r=ee).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|h)<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],_=e[t+4],g=e[t+5],v=e[t+6],w=e[t+7],b=e[t+8],y=e[t+9],m=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],R=e[t+15],A=o[0],B=o[1],z=o[2],L=o[3];A=l(A,B,z,L,a,7,s[0]),L=l(L,A,B,z,h,12,s[1]),z=l(z,L,A,B,d,17,s[2]),B=l(B,z,L,A,p,22,s[3]),A=l(A,B,z,L,_,7,s[4]),L=l(L,A,B,z,g,12,s[5]),z=l(z,L,A,B,v,17,s[6]),B=l(B,z,L,A,w,22,s[7]),A=l(A,B,z,L,b,7,s[8]),L=l(L,A,B,z,y,12,s[9]),z=l(z,L,A,B,m,17,s[10]),B=l(B,z,L,A,k,22,s[11]),A=l(A,B,z,L,E,7,s[12]),L=l(L,A,B,z,S,12,s[13]),z=l(z,L,A,B,x,17,s[14]),A=f(A,B=l(B,z,L,A,R,22,s[15]),z,L,h,5,s[16]),L=f(L,A,B,z,v,9,s[17]),z=f(z,L,A,B,k,14,s[18]),B=f(B,z,L,A,a,20,s[19]),A=f(A,B,z,L,g,5,s[20]),L=f(L,A,B,z,m,9,s[21]),z=f(z,L,A,B,R,14,s[22]),B=f(B,z,L,A,_,20,s[23]),A=f(A,B,z,L,y,5,s[24]),L=f(L,A,B,z,x,9,s[25]),z=f(z,L,A,B,p,14,s[26]),B=f(B,z,L,A,b,20,s[27]),A=f(A,B,z,L,S,5,s[28]),L=f(L,A,B,z,d,9,s[29]),z=f(z,L,A,B,w,14,s[30]),A=c(A,B=f(B,z,L,A,E,20,s[31]),z,L,g,4,s[32]),L=c(L,A,B,z,b,11,s[33]),z=c(z,L,A,B,k,16,s[34]),B=c(B,z,L,A,x,23,s[35]),A=c(A,B,z,L,h,4,s[36]),L=c(L,A,B,z,_,11,s[37]),z=c(z,L,A,B,w,16,s[38]),B=c(B,z,L,A,m,23,s[39]),A=c(A,B,z,L,S,4,s[40]),L=c(L,A,B,z,a,11,s[41]),z=c(z,L,A,B,p,16,s[42]),B=c(B,z,L,A,v,23,s[43]),A=c(A,B,z,L,y,4,s[44]),L=c(L,A,B,z,E,11,s[45]),z=c(z,L,A,B,R,16,s[46]),A=u(A,B=c(B,z,L,A,d,23,s[47]),z,L,a,6,s[48]),L=u(L,A,B,z,w,10,s[49]),z=u(z,L,A,B,x,15,s[50]),B=u(B,z,L,A,g,21,s[51]),A=u(A,B,z,L,E,6,s[52]),L=u(L,A,B,z,p,10,s[53]),z=u(z,L,A,B,m,15,s[54]),B=u(B,z,L,A,h,21,s[55]),A=u(A,B,z,L,b,6,s[56]),L=u(L,A,B,z,R,10,s[57]),z=u(z,L,A,B,v,15,s[58]),B=u(B,z,L,A,S,21,s[59]),A=u(A,B,z,L,_,6,s[60]),L=u(L,A,B,z,k,10,s[61]),z=u(z,L,A,B,d,15,s[62]),B=u(B,z,L,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+B|0,o[2]=o[2]+z|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,h=s.words,l=0;l<4;l++){var f=h[l];h[l]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(h),t.HmacMD5=o._createHmacHelper(h)}(Math),r.MD5)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).lib,o=i.WordArray,a=i.Hasher,s=n.algo,h=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=0;l<80;l++){if(l<16)h[l]=0|e[t+l];else{var f=h[l-3]^h[l-8]^h[l-14]^h[l-16];h[l]=f<<1|f>>>31}var c=(n<<5|n>>>27)+s+h[l];c+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=a._createHelper(l),n.HmacSHA1=a._createHmacHelper(l),r.SHA1)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[d]=_+l[d-7]+v+l[d-16]}var w=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),y=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&c)+h[d]+l[d];u=c,c=f,f=s,s=a+y|0,a=o,o=i,i=n,n=y+(b+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(i=(n=r=ee).lib.WordArray,o=n.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=a._createHelper(s),n.HmacSHA224=a._createHmacHelper(s),r.SHA224)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var h=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=n.high,p=n.low,_=i.high,g=i.low,v=o.high,w=o.low,b=a.high,y=a.low,m=s.high,k=s.low,E=f.high,S=f.low,x=c.high,R=c.low,A=u.high,B=u.low,z=d,L=p,T=_,M=g,C=v,D=w,I=b,P=y,O=m,U=k,H=E,F=S,N=x,Z=R,j=A,W=B,Y=0;Y<80;Y++){var K=l[Y];if(Y<16)var X=K.high=0|e[t+2*Y],q=K.low=0|e[t+2*Y+1];else{var V=l[Y-15],G=V.high,$=V.low,J=(G>>>1|$<<31)^(G>>>8|$<<24)^G>>>7,Q=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),ee=l[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[Y-7],ae=oe.high,se=oe.low,he=l[Y-16],le=he.high,fe=he.low;X=(X=(X=J+ae+((q=Q+se)>>>0>>0?1:0))+ne+((q+=ie)>>>0>>0?1:0))+le+((q+=fe)>>>0>>0?1:0),K.high=X,K.low=q}var ce,ue=O&H^~O&N,de=U&F^~U&Z,pe=z&T^z&C^T&C,_e=L&M^L&D^M&D,ge=(z>>>28|L<<4)^(z<<30|L>>>2)^(z<<25|L>>>7),ve=(L>>>28|z<<4)^(L<<30|z>>>2)^(L<<25|z>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),be=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),ye=h[Y],me=ye.high,ke=ye.low,Ee=j+we+((ce=W+be)>>>0>>0?1:0),Se=ve+_e;j=N,W=Z,N=H,Z=F,H=O,F=U,O=I+(Ee=(Ee=(Ee=Ee+ue+((ce+=de)>>>0>>0?1:0))+me+((ce+=ke)>>>0>>0?1:0))+X+((ce+=q)>>>0>>0?1:0))+((U=P+ce|0)>>>0

>>0?1:0)|0,I=C,P=D,C=T,D=M,T=z,M=L,z=Ee+(ge+pe+(Se>>>0>>0?1:0))+((L=ce+Se|0)>>>0>>0?1:0)|0}p=n.low=p+L,n.high=d+z+(p>>>0>>0?1:0),g=i.low=g+M,i.high=_+T+(g>>>0>>0?1:0),w=o.low=w+D,o.high=v+C+(w>>>0>>0?1:0),y=a.low=y+P,a.high=b+I+(y>>>0

>>0?1:0),k=s.low=k+U,s.high=m+O+(k>>>0>>0?1:0),S=f.low=S+F,f.high=E+H+(S>>>0>>0?1:0),R=c.low=R+Z,c.high=x+N+(R>>>0>>0?1:0),B=u.low=B+W,u.high=A+j+(B>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),r.SHA512)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).x64,o=i.Word,a=i.WordArray,s=n.algo,h=s.SHA512,l=s.SHA384=h.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(l),n.HmacSHA384=h._createHmacHelper(l),r.SHA384)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,h=[],l=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,c=0,u=0;u<7;u++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=r[i]).high^=a,B.low^=o}for(var s=0;s<24;s++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(B=r[u+5*_]).high,p^=B.low;var g=c[u];g.high=d,g.low=p}for(u=0;u<5;u++){var v=c[(u+4)%5],w=c[(u+1)%5],b=w.high,y=w.low;for(d=v.high^(b<<1|y>>>31),p=v.low^(y<<1|b>>>31),_=0;_<5;_++)(B=r[u+5*_]).high^=d,B.low^=p}for(var m=1;m<25;m++){var k=(B=r[m]).high,E=B.low,S=h[m];S<32?(d=k<>>32-S,p=E<>>32-S):(d=E<>>64-S,p=k<>>64-S);var x=c[l[m]];x.high=d,x.low=p}var R=c[0],A=r[0];for(R.high=A.high,R.low=A.low,u=0;u<5;u++)for(_=0;_<5;_++){var B=r[m=u+5*_],z=c[m],L=c[(u+1)%5+5*_],T=c[(u+2)%5+5*_];B.high=z.high^~L.high&T.high,B.low=z.low^~L.low&T.low}B=r[0];var M=f[s];B.high^=M.high,B.low^=M.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,h=s/8,l=[],f=0;f>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(u)}return new i.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(u),t.HmacSHA3=o._createHmacHelper(u)}(Math),r.SHA3)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,y,m,k,E,S,x,R,A,B=this._hash.words,z=c.words,L=u.words,T=s.words,M=h.words,C=l.words,D=f.words;for(k=o=B[0],E=a=B[1],S=d=B[2],x=y=B[3],R=m=B[4],r=0;r<80;r+=1)A=o+e[t+T[r]]|0,A+=r<16?p(a,d,y)+z[0]:r<32?_(a,d,y)+z[1]:r<48?g(a,d,y)+z[2]:r<64?v(a,d,y)+z[3]:w(a,d,y)+z[4],A=(A=b(A|=0,C[r]))+m|0,o=m,m=y,y=b(d,10),d=a,a=A,A=k+e[t+M[r]]|0,A+=r<16?w(E,S,x)+L[0]:r<32?v(E,S,x)+L[1]:r<48?g(E,S,x)+L[2]:r<64?_(E,S,x)+L[3]:p(E,S,x)+L[4],A=(A=b(A|=0,D[r]))+R|0,k=R,R=x,x=b(S,10),S=E,E=A;A=B[1]+d+x|0,B[1]=B[2]+y+R|0,B[2]=B[3]+m+k|0,B[3]=B[4]+o+E|0,B[4]=B[0]+a+S|0,B[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function _(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function w(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=ee).lib,i=n.Base,o=r.enc,a=o.Utf8,s=r.algo,void(s.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,h=o.words,l=0;l>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:w}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),b=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=i.format={},m=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:n})}},k=o.SerializableCipher=a.extend({cfg:a.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=i.kdf={},S=E.OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:n})}},x=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=k.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=k.decrypt.call(this,e,t,i.key,n);return o}})))}),Q(function(e,t){var r;e.exports=((r=ee).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var h=0;h>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),Q(function(e,t){var r;e.exports=((r=ee).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),Q(function(e,t){var r;e.exports=((r=ee).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),Q(function(e,t){var r,n,i,o;e.exports=(i=(n=r=ee).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],h=[],l=[],f=[],c=[],u=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var _=e[r],g=e[_],v=e[g],w=257*e[p]^16843008*p;a[r]=w<<24|w>>>8,s[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,l[r]=w,w=16843009*v^65537*g^257*_^16843008*r,f[p]=w<<24|w>>>8,c[p]=w<<16|w>>>16,u[p]=w<<8|w>>>24,d[p]=w,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var h=this._invKeySchedule=[],l=0;l>>24]]^c[i[s>>>16&255]]^u[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,h,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,c,u,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var h=this._nRounds,l=e[t]^r[0],f=e[t+1]^r[1],c=e[t+2]^r[2],u=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&u]^r[d++],g=n[f>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&l]^r[d++],v=n[c>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],w=n[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++];l=_,f=g,c=v,u=w}_=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^r[d++],g=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],w=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],e[t]=_,e[t+1]=g,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(_)}(),r.AES)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],f=h[o];for(r=0;r<24;r++)l[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,h=0;h<8;h++)s|=l[h][((a^i[h])&f[h])>>>0];this._lBlock=a,this._rBlock=o^s}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var h=n[i];n[i]=n[o],n[o]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(i[0]^=l,i[1]^=c,i[2]^=f,i[3]^=u,i[4]^=l,i[5]^=c,i[6]^=f,i[7]^=u,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(n[0]^=l,n[1]^=c,n[2]^=f,n[3]^=u,n[4]^=l,n[5]^=c,n[6]^=f,n[7]^=u,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)}),Q(function(e,t){e.exports=ee}));function re(){throw new Error("setTimeout has not been defined")}function ne(){throw new Error("clearTimeout has not been defined")}var ie=re,oe=ne;function ae(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===re||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(t){try{return ie.call(null,e,0)}catch(t){return ie.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ie=setTimeout),"function"==typeof e.clearTimeout&&(oe=clearTimeout);var se,he=[],le=!1,fe=-1;function ce(){le&&se&&(le=!1,se.length?he=se.concat(he):fe=-1,he.length&&ue())}function ue(){if(!le){var e=ae(ce);le=!0;for(var t=he.length;t;){for(se=he,he=[];++fe1)for(var r=1;r0&&a.length>i){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function xe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Re(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Ae(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}ge.prototype=Object.create(null),ve.EventEmitter=ve,ve.usingDomains=!1,ve.prototype.domain=void 0,ve.prototype._events=void 0,ve.prototype._maxListeners=void 0,ve.defaultMaxListeners=10,ve.init=function(){this.domain=null,ve.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ve.prototype.getMaxListeners=function(){return we(this)},ve.prototype.emit=function(e){var t,r,n,i,o,a,s,h="error"===e;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:be(r,f,this);break;case 2:ye(r,f,this,arguments[1]);break;case 3:me(r,f,this,arguments[1],arguments[2]);break;case 4:ke(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var Be="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ze=/%[sdj%]/g;function Le(e){if(!Ze(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Fe(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ye(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),je(r.showHidden)&&(r.showHidden=!1),je(r.depth)&&(r.depth=2),je(r.colors)&&(r.colors=!1),je(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ie),Oe(r,e,r.depth)}function Ie(e,t){var r=De.styles[t];return r?"["+De.colors[r][0]+"m"+e+"["+De.colors[r][1]+"m":e}function Pe(e,t){return e}function Oe(e,t,r){if(e.customInspect&&t&&qe(t.inspect)&&t.inspect!==De&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ze(n)||(n=Oe(e,n,r)),n}var i=function(e,t){if(je(t))return e.stylize("undefined","undefined");if(Ze(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Fe(t))return e.stylize(""+t,"boolean");if(Ne(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ue(t);if(0===o.length){if(qe(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(We(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ke(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xe(t))return Ue(t)}var h,l,f="",c=!1,u=["{","}"];(h=t,Array.isArray(h)&&(c=!0,u=["[","]"]),qe(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return We(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ke(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Xe(t)&&(f=" "+Ue(t)),0!==o.length||c&&0!=t.length?r<0?We(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=c?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,u)):u[0]+f+u[1]}function Ue(e){return"["+Error.prototype.toString.call(e)+"]"}function He(e,t,r,n,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),Ge(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=Ne(r)?Oe(e,h.value,null):Oe(e,h.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),je(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Fe(e){return"boolean"==typeof e}function Ne(e){return null===e}function Ze(e){return"string"==typeof e}function je(e){return void 0===e}function We(e){return Ye(e)&&"[object RegExp]"===Ve(e)}function Ye(e){return"object"==typeof e&&null!==e}function Ke(e){return Ye(e)&&"[object Date]"===Ve(e)}function Xe(e){return Ye(e)&&("[object Error]"===Ve(e)||e instanceof Error)}function qe(e){return"function"==typeof e}function Ve(e){return Object.prototype.toString.call(e)}function Ge(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $e(){this.head=null,this.tail=null,this.length=0}De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},$e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},$e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},$e.prototype.clear=function(){this.head=this.tail=null,this.length=0},$e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},$e.prototype.concat=function(e){if(0===this.length)return p.alloc(0);if(1===this.length)return this.head.data;for(var t=p.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Je=p.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Je(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=tt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=rt;break;default:return void(this.write=et)}this.charBuffer=new p(6),this.charReceived=0,this.charLength=0}function et(e){return e.toString(this.encoding)}function tt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function rt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Qe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Qe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Qe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ot.ReadableState=it;var nt=function(e){je(Me)&&(Me=""),e=e.toUpperCase(),Ce[e]||(new RegExp("\\b"+e+"\\b","i").test(Me)?Ce[e]=function(){var t=Le.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ce[e]=function(){});return Ce[e]}("stream");function it(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ct&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new $e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Qe(e.encoding),this.encoding=e.encoding)}function ot(e){if(!(this instanceof ot))return new ot(e);this._readableState=new it(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ve.call(this)}function at(e,t,r,n,i){var o=function(e,t){var r=null;$(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,lt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&<(e))),function(e,t){t.readingMore||(t.readingMore=!0,de(ct,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?de(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function ct(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=p.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,de(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):lt(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?_t(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},ot.prototype._read=function(e){this.emit("error",new Error("not implemented"))},ot.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){nt("onunpipe"),e===r&&l()}function a(){nt("onend"),e.end()}n.endEmitted?de(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function l(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",u),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function c(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==wt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function u(t){var r;nt("onerror",t),_(),e.removeListener("error",u),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),_()}function p(){nt("onfinish"),e.removeListener("close",d),_()}function _(){nt("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",u),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},ot.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},kt.prototype._write=function(e,t,r){r(new Error("not implemented"))},kt.prototype._writev=null,kt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Bt(e,t),r&&(t.finished?de(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Be(Ct,ot);for(var Lt=Object.keys(kt.prototype),Tt=0;Tt=0;)e[t]=0}var Jt=0,Qt=1,er=2,tr=29,rr=256,nr=rr+1+tr,ir=30,or=19,ar=2*nr+1,sr=15,hr=16,lr=7,fr=256,cr=16,ur=17,dr=18,pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wr=new Array(2*(nr+2));$t(wr);var br=new Array(2*ir);$t(br);var yr=new Array(512);$t(yr);var mr=new Array(256);$t(mr);var kr=new Array(tr);$t(kr);var Er,Sr,xr,Rr=new Array(ir);function Ar(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Br(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function zr(e){return e<256?yr[e]:yr[256+(e>>>7)]}function Lr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Tr(e,t,r){e.bi_valid>hr-r?(e.bi_buf|=t<>hr-e.bi_valid,e.bi_valid+=r-hr):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function Dr(e,t,r){var n,i,o=new Array(sr+1),a=0;for(n=1;n<=sr;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=Cr(o[s]++,s))}}function Ir(e){var t;for(t=0;t8?Lr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Or(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)Ur(e,o,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ur(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Ur(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,h=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=sr;o++)e.bl_count[o]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),h[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=u[n-d]),s=h[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(h[2*i+1]!==o&&(e.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),n--)}}(e,t),Dr(o,l,e.bl_count)}function Nr(e,t,r){var n,i,o=-1,a=t[1],s=0,h=7,l=4;for(0===a&&(h=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function Xr(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Gt&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return qt;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Vt;for(t=32;t=3&&0===e.bl_tree[2*vr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Yr(e,t,r,n):e.strategy===Xt||o===i?(Tr(e,(Qt<<1)+(n?1:0),3),Hr(e,wr,br)):(Tr(e,(er<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Tr(e,t-257,5),Tr(e,r-1,5),Tr(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(mr[r]+rr+1)]++,e.dyn_dtree[2*zr(t)]++),e.last_lit===e.lit_bufsize-1}function Vr(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Gr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function $r(e,t,r,n){var i=Gr,o=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}var Jr,Qr=0,en=1,tn=3,rn=4,nn=5,on=0,an=1,sn=-2,hn=-3,ln=-5,fn=-1,cn=1,un=2,dn=3,pn=4,_n=2,gn=8,vn=9,wn=286,bn=30,yn=19,mn=2*wn+1,kn=15,En=3,Sn=258,xn=Sn+En+1,Rn=32,An=42,Bn=69,zn=73,Ln=91,Tn=103,Mn=113,Cn=666,Dn=1,In=2,Pn=3,On=4,Un=3;function Hn(e,t){return e.msg=Nt[t],t}function Fn(e){return(e<<1)-(e>4?9:0)}function Nn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(jt(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function jn(e,t){Xr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function Wn(e,t){e.pending_buf[e.pending++]=t}function Yn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Kn(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-xn?e.strstart-(e.w_size-xn):0,l=e.window,f=e.w_mask,c=e.prev,u=e.strstart+Sn,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Xn(e){var t,r,n,i,o,a,s,h,l,f,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-xn)){jt(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,h=e.strstart+e.lookahead,l=i,f=void 0,(f=a.avail_in)>l&&(f=l),r=0===f?0:(a.avail_in-=f,jt(s,a.input,a.next_in,f,h),1===a.state.wrap?a.adler=Vr(a.adler,s,f,h):2===a.state.wrap&&(a.adler=$r(a.adler,s,f,h)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=En)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<=En)if(n=qr(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,n=qr(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<nn||t<0)return e?Hn(e,sn):sn;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Cn&&t!==rn)return Hn(e,0===e.avail_out?ln:sn);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===An)if(2===n.wrap)e.adler=0,Wn(n,31),Wn(n,139),Wn(n,8),n.gzhead?(Wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Wn(n,255&n.gzhead.time),Wn(n,n.gzhead.time>>8&255),Wn(n,n.gzhead.time>>16&255),Wn(n,n.gzhead.time>>24&255),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Wn(n,255&n.gzhead.extra.length),Wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=$r(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Bn):(Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,Un),n.status=Mn);else{var a=gn+(n.w_bits-8<<4)<<8;a|=(n.strategy>=un||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=Rn),a+=31-a%31,n.status=Mn,Yn(n,a),0!==n.strstart&&(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),e.adler=1}if(n.status===Bn)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending!==n.pending_buf_size));)Wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zn)}else n.status=zn;if(n.status===zn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=Ln)}else n.status=Ln;if(n.status===Ln)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=Tn)}else n.status=Tn;if(n.status===Tn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Zn(e),n.pending+2<=n.pending_buf_size&&(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),e.adler=0,n.status=Mn)):n.status=Mn),0!==n.pending){if(Zn(e),0===e.avail_out)return n.last_flush=-1,on}else if(0===e.avail_in&&Fn(t)<=Fn(r)&&t!==rn)return Hn(e,ln);if(n.status===Cn&&0!==e.avail_in)return Hn(e,ln);if(0!==e.avail_in||0!==n.lookahead||t!==Qr&&n.status!==Cn){var s=n.strategy===un?function(e,t){for(var r;;){if(0===e.lookahead&&(Xn(e),0===e.lookahead)){if(t===Qr)return Dn;break}if(e.match_length=0,r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):n.strategy===dn?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Sn){if(Xn(e),e.lookahead<=Sn&&t===Qr)return Dn;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+Sn;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(r=qr(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):Jr[n.level].func(n,t);if(s!==Pn&&s!==On||(n.status=Cn),s===Dn||s===Pn)return 0===e.avail_out&&(n.last_flush=-1),on;if(s===In&&(t===en?Kr(n):t!==nn&&(Yr(n,0,0,!1),t===tn&&(Nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Zn(e),0===e.avail_out))return n.last_flush=-1,on}return t!==rn?on:n.wrap<=0?an:(2===n.wrap?(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),Wn(n,e.adler>>16&255),Wn(n,e.adler>>24&255),Wn(n,255&e.total_in),Wn(n,e.total_in>>8&255),Wn(n,e.total_in>>16&255),Wn(n,e.total_in>>24&255)):(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),Zn(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?on:an)}Jr=[new Gn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xn(e),0===e.lookahead&&t===Qr)return Dn;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,jn(e,!1),0===e.strm.avail_out))return Dn;if(e.strstart-e.block_start>=e.w_size-xn&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):(e.strstart>e.block_start&&(jn(e,!1),e.strm.avail_out),Dn)}),new Gn(4,4,8,4,qn),new Gn(4,5,16,8,qn),new Gn(4,6,32,32,qn),new Gn(4,4,16,16,Vn),new Gn(8,16,32,32,Vn),new Gn(8,16,128,128,Vn),new Gn(8,32,128,256,Vn),new Gn(32,128,258,1024,Vn),new Gn(32,258,258,4096,Vn)];var ei=30,ti=12;function ri(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),h=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,u=r.window,d=r.hold,p=r.bits,_=r.lencode,g=r.distcode,v=(1<>>=y=b>>>24,p-=y,0===(y=b>>>16&255))R[o++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=_[(65535&b)+(d&(1<>>=y,p-=y),p<15&&(d+=x[n++]<>>=y=b>>>24,p-=y,!(16&(y=b>>>16&255))){if(0==(64&y)){b=g[(65535&b)+(d&(1<h){e.msg="invalid distance too far back",r.mode=ei;break e}if(d>>>=y,p-=y,k>(y=o-a)){if((y=k-y)>f&&r.sane){e.msg="invalid distance too far back",r.mode=ei;break e}if(E=0,S=u,0===c){if(E+=l-y,y2;)R[o++]=S[E++],R[o++]=S[E++],R[o++]=S[E++],m-=3;m&&(R[o++]=S[E++],m>1&&(R[o++]=S[E++]))}else{E=o-k;do{R[o++]=R[E++],R[o++]=R[E++],R[o++]=R[E++],m-=3}while(m>2);m&&(R[o++]=R[E++],m>1&&(R[o++]=R[E++]))}break}}break}}while(n>3,d&=(1<<(p-=m<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[m];m--);if(k>m&&(k=m),0===m)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y0&&(e===ai||1!==m))return-1;for(T[1]=0,w=1;wii||e===hi&&R>oi)return 1;for(;;){p=w-S,a[b]d?(_=M[C+a[b]],g=B[z+a[b]]):(_=96,g=0),h=1<>S)+(l-=h)]=p<<24|_<<16|g|0}while(0!==l);for(h=1<>=1;if(0!==h?(A&=h-1,A+=h):A=0,b++,0==--L[w]){if(w===m)break;w=t[r+a[b]]}if(w>k&&(A&c)!==f){for(0===S&&(S=k),u+=y,x=1<<(E=w-S);E+Sii||e===hi&&R>oi)return 1;i[f=A&c]=k<<24|E<<16|u-o|0}}return 0!==A&&(i[u+A]=w-S<<24|64<<16|0),s.bits=k,0}var pi=0,_i=1,gi=2,vi=4,wi=5,bi=6,yi=0,mi=1,ki=2,Ei=-2,Si=-3,xi=-4,Ri=-5,Ai=8,Bi=1,zi=2,Li=3,Ti=4,Mi=5,Ci=6,Di=7,Ii=8,Pi=9,Oi=10,Ui=11,Hi=12,Fi=13,Ni=14,Zi=15,ji=16,Wi=17,Yi=18,Ki=19,Xi=20,qi=21,Vi=22,Gi=23,$i=24,Ji=25,Qi=26,eo=27,to=28,ro=29,no=30,io=31,oo=32,ao=852,so=592;function ho(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Yt(320),this.work=new Yt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fo(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Bi,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Kt(ao),t.distcode=t.distdyn=new Kt(so),t.sane=1,t.back=-1,yi):Ei}(e)):Ei}function co(e,t){var r,n;return e?(n=new lo,e.state=n,n.window=null,(r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ei:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fo(e))):Ei}(e,t))!==yi&&(e.state=null),r):Ei}var uo,po,_o=!0;function go(e){if(_o){var t;for(uo=new Kt(512),po=new Kt(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(di(_i,e.lens,0,288,uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;di(gi,e.lens,0,32,po,0,e.work,{bits:5}),_o=!1}e.lencode=uo,e.lenbits=9,e.distcode=po,e.distbits=5}function vo(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R=0,A=new Wt(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ei;(r=e.state).mode===Hi&&(r.mode=Fi),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,c=s,u=h,E=yi;e:for(;;)switch(r.mode){case Bi:if(0===r.wrap){r.mode=Fi;break}for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0),l=0,f=0,r.mode=zi;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=no;break}if((15&l)!==Ai){e.msg="unknown compression method",r.mode=no;break}if(f-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=no;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Li;case Li:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=$r(r.check,A,4,0)),l=0,f=0,r.mode=Ti;case Ti:for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Mi;case Mi:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=Ci;case Ci:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=$r(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Di;case Di:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Hi;break;case Oi:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>=7&f,f-=7&f,r.mode=eo;break}for(;f<3;){if(0===s)break e;s--,l+=n[o++]<>>=1)){case 0:r.mode=Ni;break;case 1:if(go(r),r.mode=Xi,t===bi){l>>>=2,f-=2;break e}break;case 2:r.mode=Wi;break;case 3:e.msg="invalid block type",r.mode=no}l>>>=2,f-=2;break;case Ni:for(l>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,l+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=no;break}if(r.length=65535&l,l=0,f=0,r.mode=Zi,t===bi)break e;case Zi:r.mode=ji;case ji:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;jt(i,n,o,d,a),s-=d,o+=d,h-=d,a+=d,r.length-=d;break}r.mode=Hi;break;case Wi:for(;f<14;){if(0===s)break e;s--,l+=n[o++]<>>=5,f-=5,r.ndist=1+(31&l),l>>>=5,f-=5,r.ncode=4+(15&l),l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=no;break}r.have=0,r.mode=Yi;case Yi:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=di(pi,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=no;break}r.have=0,r.mode=Ki;case Ki:for(;r.have>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(x=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=no;break}k=r.lens[r.have-1],d=3+(3&l),l>>>=2,f-=2}else if(17===w){for(x=g+3;f>>=g)),l>>>=3,f-=3}else{for(x=g+7;f>>=g)),l>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=no;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===no)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=no;break}if(r.lenbits=9,S={bits:r.lenbits},E=di(_i,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=no;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=di(gi,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=no;break}if(r.mode=Xi,t===bi)break e;case Xi:r.mode=qi;case qi:if(s>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=f,ri(e,u),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Hi&&(r.back=-1);break}for(r.back=0;v=(R=r.lencode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,r.length=w,0===v){r.mode=Qi;break}if(32&v){r.back=-1,r.mode=Hi;break}if(64&v){e.msg="invalid literal/length code",r.mode=no;break}r.extra=15&v,r.mode=Vi;case Vi:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Gi;case Gi:for(;v=(R=r.distcode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=no;break}r.offset=w,r.extra=15&v,r.mode=$i;case $i:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=no;break}r.mode=Ji;case Ji:if(0===h)break e;if(d=u-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=no;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),_=r.window}else _=i,p=a-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[a++]=_[p++]}while(--d);0===r.length&&(r.mode=qi);break;case Qi:if(0===h)break e;i[a++]=r.length,h--,r.mode=qi;break;case eo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,l|=n[o++]<=o.wsize?(jt(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),jt(o.window,t,r-n,i,o.wnext),(n-=i)?(jt(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveyo)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function ko(e,t){for(var r=0;r15&&(a=2,n-=16),i<1||i>vn||r!==gn||n<8||n>15||t<0||t>9||o<0||o>pn)return Hn(e,sn);8===n&&(n=9);var s=new $n;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<So.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsSo.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelSo.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelSo.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=So.Z_FILTERED&&e.strategy!=So.Z_HUFFMAN_ONLY&&e.strategy!=So.Z_RLE&&e.strategy!=So.Z_FIXED&&e.strategy!=So.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!$(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new So.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=So.codes[t],r.emit("error",n)};var n=So.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=So.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||So.Z_DEFAULT_WINDOWBITS,n,e.memLevel||So.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new p(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(xo).forEach(function(e){xo[xo[e]]=e}),Be(Io,Ot),Io.prototype.params=function(e,t,r){if(eSo.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=So.Z_FILTERED&&t!=So.Z_HUFFMAN_ONLY&&t!=So.Z_RLE&&t!=So.Z_FIXED&&t!=So.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(So.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else de(r)},Io.prototype.reset=function(){return this._binding.reset()},Io.prototype._flush=function(e){this._transform(new p(0),"",e)},Io.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=So.Z_FULL_FLUSH),r.ended)t&&de(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new p(0),"",t)},Io.prototype.close=function(e){if(e&&de(e),!this._closed){this._closed=!0,this._binding.close();var t=this;de(function(){t.emit("close")})}},Io.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!$(e))return r(new Error("invalid input"));o?n=So.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||So.Z_NO_FLUSH)),this._processChunk(e,n,r)},Io.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof r;if(!s){var h,l=[],f=0;this.on("error",function(e){h=e});do{var c=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&_(c[0],c[1]));if(this._hadError)throw h;var u=p.concat(l,f);return this.close(),u}var d=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function _(h,c){if(!a._hadError){var u=i-c;if(function(e,t){if(!e)throw new Error(t)}(u>=0,"have should not go down"),u>0){var d=a._buffer.slice(a._offset,a._offset+u);a._offset+=u,s?a.push(d):(l.push(d),f+=d.length)}if((0===c||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new p(a._chunkSize)),0===c){if(o+=n-h,n=h,!s)return!0;var g=a._binding.write(t,e,o,n,a._buffer,a._offset,a._chunkSize);return g.callback=_,void(g.buffer=e)}if(!s)return!1;r()}}d.buffer=e,d.callback=_},Be(Bo,Io),Be(zo,Io),Be(Lo,Io),Be(To,Io),Be(Mo,Io),Be(Co,Io),Be(Do,Io);var Po={codes:xo,createDeflate:function(e){return new Bo(e)},createInflate:function(e){return new zo(e)},createDeflateRaw:function(e){return new Mo(e)},createInflateRaw:function(e){return new Co(e)},createGzip:function(e){return new Lo(e)},createGunzip:function(e){return new To(e)},createUnzip:function(e){return new Do(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Bo(t),e,r)},deflateSync:function(e,t){return Ao(new Bo(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Lo(t),e,r)},gzipSync:function(e,t){return Ao(new Lo(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Mo(t),e,r)},deflateRawSync:function(e,t){return Ao(new Mo(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Do(t),e,r)},unzipSync:function(e,t){return Ao(new Do(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new zo(t),e,r)},inflateSync:function(e,t){return Ao(new zo(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new To(t),e,r)},gunzipSync:function(e,t){return Ao(new To(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Co(t),e,r)},inflateRawSync:function(e,t){return Ao(new Co(t),e)},Deflate:Bo,Inflate:zo,Gzip:Lo,Gunzip:To,DeflateRaw:Mo,InflateRaw:Co,Unzip:Do,Zlib:Io};export default class{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return p.from?p.from(e,t):new p(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let o=te.HmacSHA256(i,this.PRIVATEKEY);return te.enc.Base64.stringify(o)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},o="";if(null!=r){let a=this.base64encode(r);i["TLS.userbuf"]=a,o=this._hmacsha256(e,n,t,a)}else o=this._hmacsha256(e,n,t,null);i["TLS.sig"]=o;let a=JSON.stringify(i),s=Po.deflateSync(this.newBuffer(a)).toString("base64"),h=this.escape(s);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Po.inflateSync(t);console.log("validate ret="+r)}} diff --git a/src/renderer/src/plugins/imChat/userSig.js b/src/renderer/src/plugins/imChat/userSig.js new file mode 100644 index 0000000..1191b78 --- /dev/null +++ b/src/renderer/src/plugins/imChat/userSig.js @@ -0,0 +1,44 @@ +/** + * @description: 生成签名|客户端计算 UserSig + * @author: zdg + * @date 2021-07-05 14:07:01 + */ + +// TIM生成签名 +import LibGenerateTestUserSig from './lib-generate-test-usersig-es.min.js'; +/** + * Signature expiration time, which should not be too short + * Time unit: second + * Default time: 7 * 24 * 60 * 60 = 604800 = 7days + */ +const EXPIRETIME = 604800; + +/** + * Module: GenerateTestUserSig + * + * Description: Generates UserSig for testing. UserSig is a security signature designed by Tencent Cloud for its cloud services. + * It is calculated based on `SDKAppID`, `UserID`, and `EXPIRETIME` using the HMAC-SHA256 encryption algorithm. + * + * Attention: For the following reasons, do not use the code below in your commercial application. + * + * The code may be able to calculate UserSig correctly, but it is only for quick testing of the SDK’s basic features, not for commercial applications. + * `SECRETKEY` in client code can be easily decompiled and reversed, especially on web. + * Once your key is disclosed, attackers will be able to steal your Tencent Cloud traffic. + * + * The correct method is to deploy the `UserSig` calculation code and encryption key on your project server so that your application can request from your server a `UserSig` that is calculated whenever one is needed. + * Given that it is more difficult to hack a server than a client application, server-end calculation can better protect your key. + * + * Reference: https://cloud.tencent.com/document/product/647/17275#Server + */ + +function genTestUserSig(options) { + const { SDKAppID, secretKey, userID } = options; + const generator = new LibGenerateTestUserSig(SDKAppID, secretKey, EXPIRETIME); + const userSig = generator.genTestUserSig(userID); + return { + SDKAppID, + userSig, + }; +} + +export { genTestUserSig, EXPIRETIME }; \ No newline at end of file diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index ab20ba6..6ff18a8 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -9,7 +9,7 @@ export function shareStorePlugin({store}) { // mutation 变量包含了变化前后的状态 // mutation.events: key newValue target oldValue oldTarget // state 是变化后的状态 - console.log('store.$subscribe', mutation) + // console.log('store.$subscribe', mutation) // 在存储变化的时候执行 // const storeName = store.$id // const storeName = mutation.storeId diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index d5f35bb..a1f0baf 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -10,8 +10,8 @@ const isNode = typeof require !== 'undefined' // 是否支持node函数 const path = isNode?require('path'):{} const Remote = isNode?require('@electron/remote'):{} const { ipcRenderer } = isNode?require('electron'):window.electron || {} +const API = isNode?window.api:{} // preload-api import { useToolState } from '@/store/modules/tool' // 获取store状态 - // 常用变量 const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':'' const isDev = isNode?process.env.NODE_ENV !== 'production':'' @@ -84,8 +84,8 @@ export function ipcHandle(fn,key, cb) { * @param {*} data 参数 * @returns */ -let winPdf=null let wins_tool = null +let winPdf=null export const createWindow = async (type, data) => { if (wins_tool) return console.error('createWindow: win is have') if (!type) return console.error('createWindow: type is null') @@ -101,6 +101,7 @@ export const createWindow = async (type, data) => { // autoClose: true, // 关闭窗口后自动关闭 } data.isConsole = true // 是否开启控制台 + data.isWeb = false // 是否开启web安全 data.option = {...defOption, ...option} wins_tool = await toolWindow(data) wins_tool.type = type // 唯一标识 @@ -150,7 +151,7 @@ export const createWindow = async (type, data) => { * @author: zdg * @date 2021-07-05 14:07:01 */ -export function toolWindow({url, isConsole, option={}}) { +export function toolWindow({url, isConsole, isWeb=true, option={}}) { // width = window.screen.width let width = option?.width || 800 let height = option?.height || 600 @@ -162,14 +163,12 @@ export function toolWindow({url, isConsole, option={}}) { const config = { width, height, type: 'toolbar', // 创建的窗口类型为工具栏窗口 - icon: path.join(__dirname, '../../resources/logo2.ico'), + // icon: path.join(__dirname, '../../resources/logo2.ico'), webPreferences: { - // preload: path.join(__dirname, '../preload/index.js'), - preload: '@root/src/preload/index.js', + preload: path.join(API.preloadPath, '/index.js'), sandbox: false, nodeIntegration: true, // nodeApi调用 contextIsolation: false, // 沙箱取消 - // webSecurity: false // 跨域关闭 }, ...option } diff --git a/src/renderer/src/views/tool/components/imChat.vue b/src/renderer/src/views/tool/components/imChat.vue index 7306754..d7b1025 100644 --- a/src/renderer/src/views/tool/components/imChat.vue +++ b/src/renderer/src/views/tool/components/imChat.vue @@ -1,6 +1,58 @@