webim_wx.min.js
68.2 KB
module.exports=function(){"function"!=typeof Array.prototype.forEach&&(Array.prototype.forEach=function(e){for(var t=0;t<this.length;t++)e.apply(this,[this[t],t,this])});var e={},t={login:function(e,t,n){},syncMsgs:function(e,t){},getC2CHistoryMsgs:function(e,t,n){},syncGroupMsgs:function(e,t,n){},sendMsg:function(e,t,n){},logout:function(e,t){},setAutoRead:function(e,t,n){},getProfilePortrait:function(e,t,n){},setProfilePortrait:function(e,t,n){},applyAddFriend:function(e,t,n){},getPendency:function(e,t,n){},deletePendency:function(e,t,n){},responseFriend:function(e,t,n){},getAllFriend:function(e,t,n){},deleteFriend:function(e,t,n){},addBlackList:function(e,t,n){},getBlackList:function(e,t,n){},deleteBlackList:function(e,t,n){},uploadPic:function(e,t,n){},createGroup:function(e,t,n){},applyJoinGroup:function(e,t,n){},handleApplyJoinGroup:function(e,t,n){},deleteApplyJoinGroupPendency:function(e,t,n){},quitGroup:function(e,t,n){},getGroupPublicInfo:function(e,t,n){},getGroupInfo:function(e,t,n){},modifyGroupBaseInfo:function(e,t,n){},destroyGroup:function(e,t,n){},getJoinedGroupListHigh:function(e,t,n){},getGroupMemberInfo:function(e,t,n){},addGroupMember:function(e,t,n){},modifyGroupMember:function(e,t,n){},forbidSendMsg:function(e,t,n){},deleteGroupMember:function(e,t,n){},getPendencyGroup:function(e,t,n){},getPendencyReport:function(e,t,n){},getPendencyGroupRead:function(e,t,n){},sendCustomGroupNotify:function(e,t,n){},Msg:function(e,t,n,o,r,i,s,u,a){},MsgStore:{sessMap:function(){return{}},sessCount:function(){return 0},sessByTypeId:function(e,t){return{}},delSessByTypeId:function(e,t){return!0},resetCookieAndSyncFlag:function(){},downloadMap:{}}};return function(t){var n={VERSION:"1.7.3",APPID:"537048168",PLAATFORM:"10"},o=!0,r=!0,i={FORMAL:{COMMON:"https://webim.tim.qq.com",PIC:"https://pic.tim.qq.com"},TEST:{COMMON:"https://test.tim.qq.com",PIC:"https://pic.tim.qq.com"}},s={},u={OPEN_IM:"openim",GROUP:"group_open_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",DEL_CHAT:"recentcontact",WEB_IM:"webim"},a={openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v1",group_open_long_polling_http_noauth_svc:"v1",imopenstat:"v4",webim:"v3"},c={login:1,pic_up:3,apply_join_group:9,create_group:10,longpolling:18,send_group_msg:19,sendmsg:20},l={C2C:"C2C",GROUP:"GROUP"},p={C2C:1,GROUP:2},f={C2C:9e3,GROUP:9e3},d={OK:"OK",FAIL:"FAIL"},g={TEXT:"TIMTextElem",FACE:"TIMFaceElem",IMAGE:"TIMImageElem",CUSTOM:"TIMCustomElem",SOUND:"TIMSoundElem",FILE:"TIMFileElem",LOCATION:"TIMLocationElem",GROUP_TIP:"TIMGroupTipElem"},m={ORIGIN:1,LARGE:2,SMALL:3},I={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},M={RAW_DATA:0,BASE64_DATA:1},E={BUSSINESS_ID:"10001",AUTH_KEY:"617574686b6579",SERVER_IP:"182.140.186.147",SOUND_SERVER_DOMAIN:"grouptalk.c2c.qq.com"},_={SOUND:2106,FILE:2107},y={IMAGE:1,FILE:2,SHORT_VIDEO:3,SOUND:4},h={APP_VERSION:"2.1",SERVER_VERSION:1},T={C2C:1,GROUP_COMMON:3,GROUP_TIP:4,GROUP_SYSTEM:5,GROUP_TIP2:6,FRIEND_NOTICE:7,PROFILE_NOTICE:8,C2C_COMMON:9,C2C_EVENT:10},C={COMMON:0},A={READED:92,KICKEDOUT:96},S={COMMON:0,LOVEMSG:1,TIP:2,REDPACKET:3},G={REDPACKET:1,COMMON:2,LOVEMSG:3},F={JOIN:1,QUIT:2,KICK:3,SET_ADMIN:4,CANCEL_ADMIN:5,MODIFY_GROUP_INFO:6,MODIFY_MEMBER_INFO:7},O={FACE_URL:1,NAME:2,OWNER:3,NOTIFICATION:4,INTRODUCTION:5},R={JOIN_GROUP_REQUEST:1,JOIN_GROUP_ACCEPT:2,JOIN_GROUP_REFUSE:3,KICK:4,DESTORY:5,CREATE:6,INVITED_JOIN_GROUP_REQUEST:7,QUIT:8,SET_ADMIN:9,CANCEL_ADMIN:10,REVOKE:11,READED:15,CUSTOM:255,INVITED_JOIN_GROUP_REQUEST_AGREE:12},N={FRIEND_ADD:1,FRIEND_DELETE:2,PENDENCY_ADD:3,PENDENCY_DELETE:4,BLACK_LIST_ADD:5,BLACK_LIST_DELETE:6,PENDENCY_REPORT:7,FRIEND_UPDATE:8},v={PROFILE_MODIFY:1},P={OK:0,SIGNATURE_EXPIRATION:11},U={INIT:-1,ON:0,RECONNECT:1,OFF:9999},b={GROUP_MSG:1,C2C_MSG:2,USER_HEAD:3,GROUP_HEAD:4},L={ING:14,STOP:15},D=U.INIT,k=!1,w=0,q=6e4,B=null,x=0,K=0,H=[],z=null,J=null,V={sdkAppID:null,appIDAt3rd:null,accountType:null,identifier:null,tinyid:null,identifierNick:null,userSig:null,a2:null,contentType:"json",apn:1},Y={},X=0,j={},W=0,Q=[],$=[],Z=[],ee={downloadMap:{}},te={"[惊讶]":0,"[撇嘴]":1,"[色]":2,"[发呆]":3,"[得意]":4,"[流泪]":5,"[害羞]":6,"[闭嘴]":7,"[睡]":8,"[大哭]":9,"[尴尬]":10,"[发怒]":11,"[调皮]":12,"[龇牙]":13,"[微笑]":14,"[难过]":15,"[酷]":16,"[冷汗]":17,"[抓狂]":18,"[吐]":19,"[偷笑]":20,"[可爱]":21,"[白眼]":22,"[傲慢]":23,"[饿]":24,"[困]":25,"[惊恐]":26,"[流汗]":27,"[憨笑]":28,"[大兵]":29,"[奋斗]":30,"[咒骂]":31,"[疑问]":32,"[嘘]":33,"[晕]":34},ne={},oe=new function(){this.formatTimeStamp=function(e,t){if(!e)return 0;var n;t=t||"yyyy-MM-dd hh:mm:ss";var o=new Date(1e3*e),r={"M+":o.getMonth()+1,"d+":o.getDate(),"h+":o.getHours(),"m+":o.getMinutes(),"s+":o.getSeconds()};n=/(y+)/.test(t)?t.replace(RegExp.$1,(o.getFullYear()+"").substr(4-RegExp.$1.length)):t;for(var i in r)new RegExp("("+i+")").test(n)&&(n=n.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return n},this.groupTypeEn2Ch=function(e){var t=null;switch(e){case"Public":t="公开群";break;case"ChatRoom":t="聊天室";break;case"Private":t="私有群";break;case"AVChatRoom":t="直播聊天室";break;default:t=e}return t},this.groupTypeCh2En=function(e){var t=null;switch(e){case"公开群":t="Public";break;case"聊天室":t="ChatRoom";break;case"私有群":t="Private";break;case"直播聊天室":t="AVChatRoom";break;default:t=e}return t},this.groupRoleEn2Ch=function(e){var t=null;switch(e){case"Member":t="成员";break;case"Admin":t="管理员";break;case"Owner":t="群主";break;default:t=e}return t},this.groupRoleCh2En=function(e){var t=null;switch(e){case"成员":t="Member";break;case"管理员":t="Admin";break;case"群主":t="Owner";break;default:t=e}return t},this.groupMsgFlagEn2Ch=function(e){var t=null;switch(e){case"AcceptAndNotify":t="接收并提示";break;case"AcceptNotNotify":t="接收不提示";break;case"Discard":t="屏蔽";break;default:t=e}return t},this.groupMsgFlagCh2En=function(e){var t=null;switch(e){case"接收并提示":t="AcceptAndNotify";break;case"接收不提示":t="AcceptNotNotify";break;case"屏蔽":t="Discard";break;default:t=e}return t},this.formatText2Html=function(e){var t=e;return t&&(t=this.xssFilter(t),t=t.replace(/ /g," "),t=t.replace(/\n/g,"<br/>")),t},this.formatHtml2Text=function(e){var t=e;return t&&(t=t.replace(/ /g," "),t=t.replace(/<br\/>/g,"\n")),t},this.getStrBytes=function(e){if(null==e||void 0===e)return 0;if("string"!=typeof e)return 0;var t,n,o,r=0;for(n=0,o=e.length;n<o;n++)t=e.charCodeAt(n),r+=t<=127?1:t<=2047?2:t<=65535?3:4;return r},this.xssFilter=function(e){return r&&(e=e.toString(),e=e.replace(/[<]/g,"<"),e=e.replace(/[>]/g,">"),e=e.replace(/"/g,""")),e},this.trimStr=function(e){return e?(e=e.toString(),e.replace(/(^\s*)|(\s*$)/g,"")):""},this.validNumber=function(e){return e=e.toString(),e.match(/(^\d{1,8}$)/g)},this.getReturnError=function(e,t){return t||(t=-100),{ActionStatus:d.FAIL,ErrorCode:t,ErrorInfo:e+"["+t+"]"}},this.replaceObject=function(e,t){for(var n in t)if(e[n])if(t[e[n]]=t[n],delete t[n],t[e[n]]instanceof Array)for(var o=t[e[n]].length,r=0;r<o;r++)t[e[n]][r]=this.replaceObject(e,t[e[n]][r]);else"object"==typeof t[e[n]]&&(t[e[n]]=this.replaceObject(e,t[e[n]]));return t}},re=new function(){var e=!0;this.setOn=function(t){e=t},this.getOn=function(){return e},this.error=function(t){try{e&&console.error(t)}catch(e){}},this.warn=function(t){try{e&&console.warn(t)}catch(e){}},this.info=function(t){try{e&&console.info(t)}catch(e){}},this.debug=function(t){try{e&&console.debug(t)}catch(e){}}},ie=function(e){return e||(e=new Date),Math.round(e.getTime()/1e3)},se=function(){return W?W+=1:W=Math.round(1e7*Math.random()),W},ue=function(){return Math.round(4294967296*Math.random())},ae=function(e,t,n,o,r,i,s){wx.request({url:t,data:n,dataType:"json",method:e,header:{"Content-Type":"application/json"},success:function(e){w=x=0,i&&i(e.data)},fail:function(e){setTimeout(function(){var e=oe.getReturnError("请求服务器失败,请检查你的网络是否正常",-2);s&&s(e)},16)}})},ce=function(e,t,n,o,r,i,s){ae(e,t,JSON.stringify(n),0,0,function(e){var t=null;e&&(t=e),i&&i(t)},s)},le=function(){return V.sdkAppID&&V.identifier},pe=function(e,t){if(!le()){if(t){var n=oe.getReturnError("请登录",-4);e&&e(n)}return!1}return!0},fe=function(){return o},de=function(e,t,o,r){var s=i;s=fe()?i.FORMAL.COMMON:i.TEST.COMMON,e==u.PIC&&(s=fe()?i.FORMAL.PIC:i.TEST.PIC);var c=s+"/"+a[e]+"/"+e+"/"+t+"?websdkappid="+n.APPID+"&v="+n.VERSION+"&platform="+n.PLAATFORM;if(le()){if("login"==t||"accesslayer"==t)c+="&identifier="+encodeURIComponent(V.identifier)+"&usersig="+V.userSig;else if(V.tinyid&&V.a2)c+="&tinyid="+V.tinyid+"&a2="+V.a2;else if(r)return re.error("tinyid或a2为空["+e+"]["+t+"]"),r(oe.getReturnError("tinyid或a2为空["+e+"]["+t+"]",-5)),!1;c+="&contenttype="+V.contentType}return c+="&sdkappid="+V.sdkAppID+"&accounttype="+V.accountType+"&apn="+V.apn+"&reqtime="+ie()},ge=function(e,t){var n=null;return z&&H[0]?n="https://"+E.SOUND_SERVER_DOMAIN+"/asn.com/stddownload_common_file?authkey="+z+"&bid="+E.BUSSINESS_ID+"&subbid="+V.sdkAppID+"&fileid="+e+"&filetype="+_.SOUND+"&openid="+t+"&ver=0":re.error("拼接语音下载url不报错:ip或者authkey为空"),n},me=function(e,t,n){var o=null;return z&&H[0]?o="http://"+H[0]+"/asn.com/stddownload_common_file?authkey="+z+"&bid="+E.BUSSINESS_ID+"&subbid="+V.sdkAppID+"&fileid="+e+"&filetype="+_.FILE+"&openid="+t+"&ver=0&filename="+encodeURIComponent(n):re.error("拼接文件下载url不报错:ip或者authkey为空"),ee.downloadMap["uuid_"+e]=o,o},Ie=function(e,t,n,o,r,i,s){var u={From_Account:t,To_Account:r,os_platform:10,Timestamp:ie().toString(),Random:ue().toString(),request_info:[{busi_id:i,download_flag:o,type:s,uuid:e,version:h.SERVER_VERSION,auth_key:z,ip:H[0]}]};Tt(u,function(e){0==e.error_code&&e.response_info&&(ee.downloadMap["uuid_"+u.uuid]=e.response_info.url),onAppliedDownloadUrl&&onAppliedDownloadUrl({uuid:u.uuid,url:e.response_info.url,maps:ee.downloadMap})},function(e){re.error("获取下载地址失败",u.uuid)})},Me=function(){for(var e in j){var t=j[e];t&&(t.abort(),j[X]=null)}X=0,j={}},Ee=function(){Me(),V={sdkAppID:null,appIDAt3rd:null,accountType:null,identifier:null,identifierNick:null,userSig:null,contentType:"json",apn:1},Y={},W=0,Z=[],Ot.clear(),Ft.clear(),B=null},_e=function(e,t,n,i,s){return Ee(),n&&(Y=n),0==Y.isAccessFormalEnv&&(re.error("请切换为正式环境!!!!"),o=Y.isAccessFormalEnv),0==Y.isLogOn&&re.setOn(Y.isLogOn),void 0!==Y.xssFilterEnable&&(r=Y.xssFilterEnable),!e&&s?void s(oe.getReturnError("loginInfo is empty",-6)):!e.sdkAppID&&s?void s(oe.getReturnError("loginInfo.sdkAppID is empty",-7)):(e.identifier&&(V.identifier=e.identifier.toString()),e.identifier&&!e.userSig&&s?void s(oe.getReturnError("loginInfo.userSig is empty",-9)):(e.userSig&&(V.userSig=e.userSig.toString()),V.sdkAppID=e.sdkAppID,V.accountType=Math.ceil(1e4*Math.random()),void(V.identifier&&V.userSig?he(function(){Te(function(e,n){Ot.init(t,function(t){i&&(t.identifierNick=e,t.headurl=n,i(t))},s)},s)}):Ot.init(t,i,s))))},ye=function(e,t,o){if("longpolling"!=e||60008!=t&&91101!=t){var r=c[e];if(r){var i=ie(),s=null,u={Code:t,ErrMsg:o};if(V.a2?s=V.a2.substring(0,10)+"_"+i+"_"+ue():V.userSig&&(s=V.userSig.substring(0,10)+"_"+i+"_"+ue()),s){var a={UniqKey:s,EventId:r,ReportTime:i,MsgCmdErrorCode:u};if("login"==e){var l=[];l.push(a);yt({EvtItems:l,MainVersion:n.VERSION,Version:"0"},function(e){l=null},function(e){l=null})}else if(Z.push(a),Z.length>=20){var p={EvtItems:Z,MainVersion:n.VERSION,Version:"0"};yt(p,function(e){Z=[]},function(e){Z=[]})}}}}},he=function(e){Ct.apiCall(u.WEB_IM,"accesslayer",{},function(t){0===t.ErrorCode&&1===t.WebImAccessLayer&&(i.FORMAL.COMMON="https://events.tim.qq.com"),e()},function(){e()})},Te=function(e,t){Ct.apiCall(u.OPEN_IM,"login",{State:"Online"},function(n){if(n.TinyId)V.tinyid=n.TinyId;else if(t)return void t(oe.getReturnError("TinyId is empty",-10));if(n.A2Key)V.a2=n.A2Key;else if(t)return void t(oe.getReturnError("A2Key is empty",-11));var o=["Tag_Profile_IM_Nick","Tag_Profile_IM_Image"],r={From_Account:V.identifier,To_Account:[V.identifier],LastStandardSequence:0,TagList:o};ft(r,function(t){var n,o;if(t.UserProfileItem&&t.UserProfileItem.length>0)for(var r in t.UserProfileItem)for(var i in t.UserProfileItem[r].ProfileItem)switch(t.UserProfileItem[r].ProfileItem[i].Tag){case"Tag_Profile_IM_Nick":n=t.UserProfileItem[r].ProfileItem[i].Value,n&&(V.identifierNick=n);break;case"Tag_Profile_IM_Image":o=t.UserProfileItem[r].ProfileItem[i].Value,o&&(V.headurl=o)}e&&e(V.identifierNick,V.headurl)},t)},t)},Ce=function(e,t,n){if(!pe(n,!1))return Ee(),void(t&&t({ActionStatus:d.OK,ErrorCode:0,ErrorInfo:"logout success"}));"all"==e?Ct.apiCall(u.OPEN_IM,"logout",{},function(e){Ee(),t&&t(e)},n):Ct.apiCall(u.OPEN_IM,"longpollinglogout",{LongPollingId:B},function(e){Ee(),t&&t(e)},n)},Ae=function(e,t,n){if(pe(n,!0)){var o=null;switch(e.sess.type()){case l.C2C:o={From_Account:V.identifier,To_Account:e.sess.id().toString(),MsgTimeStamp:e.time,MsgSeq:e.seq,MsgRandom:e.random,MsgBody:[],OfflinePushInfo:e.offlinePushInfo};break;case l.GROUP:var r=e.getSubType();switch(o={GroupId:e.sess.id().toString(),From_Account:V.identifier,Random:e.random,MsgBody:[]},r){case S.COMMON:o.MsgPriority="COMMON";break;case S.REDPACKET:o.MsgPriority="REDPACKET";break;case S.LOVEMSG:o.MsgPriority="LOVEMSG";break;case S.TIP:re.error("不能主动发送群提示消息,subType="+r);break;default:return void re.error("发送群消息时,出现未知子消息类型:subType="+r)}}for(var i in e.elems){var s=e.elems[i],a=null,c=s.type;switch(c){case g.TEXT:a={Text:s.content.text};break;case g.FACE:a={Index:s.content.index,Data:s.content.data};break;case g.IMAGE:var p=[];for(var f in s.content.ImageInfoArray)p.push({Type:s.content.ImageInfoArray[f].type,Size:s.content.ImageInfoArray[f].size,Width:s.content.ImageInfoArray[f].width,Height:s.content.ImageInfoArray[f].height,URL:s.content.ImageInfoArray[f].url});a={ImageFormat:s.content.ImageFormat,UUID:s.content.UUID,ImageInfoArray:p};break;case g.SOUND:re.warn("web端暂不支持发送语音消息");continue;case g.LOCATION:re.warn("web端暂不支持发送地理位置消息");continue;case g.FILE:a={UUID:s.content.uuid,FileName:s.content.name,FileSize:s.content.size,DownloadFlag:s.content.downFlag};break;case g.CUSTOM:a={Data:s.content.data,Desc:s.content.desc,Ext:s.content.ext},c=g.CUSTOM;break;default:re.warn("web端暂不支持发送"+s.type+"消息");continue}e.PushInfoBoolean&&(o.OfflinePushInfo=e.PushInfo),o.MsgBody.push({MsgType:c,MsgContent:a})}e.sess.type()==l.C2C?Ct.apiCall(u.OPEN_IM,"sendmsg",o,t,n):e.sess.type()==l.GROUP&&Ct.apiCall(u.GROUP,"send_group_msg",o,t,n)}},Se=function(e,t,n){(o||"undefined"==typeof stopPolling||1!=stopPolling)&&pe(n,!0)&&Ct.apiCall(u.OPEN_IM,"longpolling",e,t,n,q,!0)},Ge=function(e,t,n,o){Ct.apiCall(u.BIG_GROUP_LONG_POLLING,"get_msg",e,t,n,o)},Fe=function(e,t,n,o){pe(o,!0)&&Ct.apiCall(u.OPEN_IM,"getmsg",{Cookie:e,SyncFlag:t},function(e){if(e.MsgList&&e.MsgList.length)for(var t in e.MsgList)Q.push(e.MsgList[t]);1==e.SyncFlag?Fe(e.Cookie,e.SyncFlag,n,o):(e.MsgList=Q,Q=[],n&&n(e))},o)},Oe=function(e,t,n,o){if(pe(o,!0)){var r=[];for(var i in t){var s={To_Account:t[i].toAccount,LastedMsgTime:t[i].lastedMsgTime};r.push(s)}Ct.apiCall(u.OPEN_IM,"msgreaded",{C2CMsgReaded:{Cookie:e,C2CMsgReadedItem:r}},n,o)}},Re=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.OPEN_IM,"deletemsg",e,t,n)},Ne=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.OPEN_IM,"getroammsg",e,function(o){var r=e.MaxCnt,i=o.Complete,s=o.MaxCnt,u=o.MsgKey,a=o.LastMsgTime;o.MsgList&&o.MsgList.length&&($=o.MsgList.concat($));var c=null;0==i&&s<r&&(c={Peer_Account:e.Peer_Account,MaxCnt:r-s,LastMsgTime:a,MsgKey:u}),c?Ne(c,t,n):(o.MsgList=$,$=[],t&&t(o))},n)},ve=function(e,t,n){if(pe(n,!0)){for(var o={Type:e.Type,Name:e.Name},r=[],i=0;i<e.MemberList.length;i++)r.push({Member_Account:e.MemberList[i]});o.MemberList=r,e.GroupId&&(o.GroupId=e.GroupId),e.Owner_Account&&(o.Owner_Account=e.Owner_Account),e.Introduction&&(o.Introduction=e.Introduction),e.Notification&&(o.Notification=e.Notification),e.MaxMemberCount&&(o.MaxMemberCount=e.MaxMemberCount),e.ApplyJoinOption&&(o.ApplyJoinOption=e.ApplyJoinOption),e.AppDefinedData&&(o.AppDefinedData=e.AppDefinedData),e.FaceUrl&&(o.FaceUrl=e.FaceUrl),Ct.apiCall(u.GROUP,"create_group",o,t,n)}},Pe=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"create_group",e,t,n)},Ue=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"modify_group_base_info",e,t,n)},be=function(e,t,n){pe(n,!0)&&(e.GroupId=String(e.GroupId),Ct.apiCall(u.GROUP,"apply_join_group",{GroupId:e.GroupId,ApplyMsg:e.ApplyMsg,UserDefinedField:e.UserDefinedField},t,n))},Le=function(e,t,n){e.GroupId=String(e.GroupId);var o;if(o=pe(n,!1)?u.GROUP:u.BIG_GROUP,Ot.checkBigGroupLongPollingOn(e.GroupId))return void(n&&n(oe.getReturnError("Join Group failed; You have already been in this group, you have to quit group before you rejoin",10013)));Ct.apiCall(o,"apply_join_group",{GroupId:e.GroupId,ApplyMsg:e.ApplyMsg,UserDefinedField:e.UserDefinedField},function(o){if(o.JoinedStatus&&"JoinedSuccess"==o.JoinedStatus){if(!o.LongPollingKey)return void(n&&n(oe.getReturnError("Join Group succeed; But the type of group is not AVChatRoom: groupid="+e.GroupId,-12)));Ot.setBigGroupLongPollingOn(!0),Ot.setBigGroupLongPollingKey(e.GroupId,o.LongPollingKey),Ot.setBigGroupLongPollingMsgMap(e.GroupId,0),Ot.bigGroupLongPolling(e.GroupId)}t&&t(o)},function(e){n&&n(e)})},De=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"handle_apply_join_group",{GroupId:e.GroupId,Applicant_Account:e.Applicant_Account,HandleMsg:e.HandleMsg,Authentication:e.Authentication,MsgKey:e.MsgKey,ApprovalMsg:e.ApprovalMsg,UserDefinedField:e.UserDefinedField},t,function(e){if(10024==e.ErrorCode){if(t){var o={ActionStatus:d.OK,ErrorCode:0,ErrorInfo:"该申请已经被处理过"};t(o)}}else n&&n(e)})},ke=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"get_pendency",{StartTime:e.StartTime,Limit:e.Limit,Handle_Account:V.identifier},t,function(e){})},we=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"report_pendency",{ReportTime:e.ReportTime,From_Account:V.identifier},t,function(e){})},qe=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"handle_invite_join_group",{GroupId:e.GroupId,Inviter_Account:e.Inviter_Account,HandleMsg:e.HandleMsg,Authentication:e.Authentication,MsgKey:e.MsgKey,ApprovalMsg:e.ApprovalMsg,UserDefinedField:e.UserDefinedField},t,function(e){})},Be=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"quit_group",{GroupId:e.GroupId},t,n)},xe=function(e,t,n){var o;o=pe(n,!1)?u.GROUP:u.BIG_GROUP,Ot.resetBigGroupLongPollingInfo(e.GroupId),Ct.apiCall(o,"quit_group",{GroupId:e.GroupId},function(n){Ft.delSessByTypeId(l.GROUP,e.GroupId),t&&t(n)},n)},Ke=function(e,t,n){Ct.apiCall(u.GROUP,"search_group",e,t,n)},He=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"get_group_public_info",{GroupIdList:e.GroupIdList,ResponseFilter:{GroupBasePublicInfoFilter:e.GroupBasePublicInfoFilter}},function(e){if(e.ErrorInfo="",e.GroupInfo)for(var o in e.GroupInfo){var r=e.GroupInfo[o].ErrorCode;r>0&&(e.ActionStatus=d.FAIL,e.GroupInfo[o].ErrorInfo="["+r+"]"+e.GroupInfo[o].ErrorInfo,e.ErrorInfo+=e.GroupInfo[o].ErrorInfo+"\n")}e.ActionStatus==d.FAIL?n&&n(e):t&&t(e)},n)},ze=function(e,t,n){if(pe(n,!0)){var o={GroupIdList:e.GroupIdList,ResponseFilter:{GroupBaseInfoFilter:e.GroupBaseInfoFilter,MemberInfoFilter:e.MemberInfoFilter}};e.AppDefinedDataFilter_Group&&(o.ResponseFilter.AppDefinedDataFilter_Group=e.AppDefinedDataFilter_Group),e.AppDefinedDataFilter_GroupMember&&(o.ResponseFilter.AppDefinedDataFilter_GroupMember=e.AppDefinedDataFilter_GroupMember),Ct.apiCall(u.GROUP,"get_group_info",o,t,n)}},Je=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"get_group_member_info",{GroupId:e.GroupId,Offset:e.Offset,Limit:e.Limit,MemberInfoFilter:e.MemberInfoFilter,MemberRoleFilter:e.MemberRoleFilter,AppDefinedDataFilter_GroupMember:e.AppDefinedDataFilter_GroupMember},t,n)},Ve=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"add_group_member",{GroupId:e.GroupId,Silence:e.Silence,MemberList:e.MemberList},t,n)},Ye=function(e,t,n){if(pe(n,!0)){var o={};e.GroupId&&(o.GroupId=e.GroupId),e.Member_Account&&(o.Member_Account=e.Member_Account),e.Role&&(o.Role=e.Role),e.MsgFlag&&(o.MsgFlag=e.MsgFlag),e.ShutUpTime&&(o.ShutUpTime=e.ShutUpTime),e.NameCard&&(o.NameCard=e.NameCard),e.AppMemberDefinedData&&(o.AppMemberDefinedData=e.AppMemberDefinedData),Ct.apiCall(u.GROUP,"modify_group_member_info",o,t,n)}},Xe=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"delete_group_member",{GroupId:e.GroupId,Silence:e.Silence,MemberToDel_Account:e.MemberToDel_Account,Reason:e.Reason},t,n)},je=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"destroy_group",{GroupId:e.GroupId},t,n)},We=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"change_group_owner",e,t,n)},Qe=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"get_joined_group_list",{Member_Account:e.Member_Account,Limit:e.Limit,Offset:e.Offset,GroupType:e.GroupType,ResponseFilter:{GroupBaseInfoFilter:e.GroupBaseInfoFilter,SelfInfoFilter:e.SelfInfoFilter}},t,n)},$e=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"get_role_in_group",{GroupId:e.GroupId,User_Account:e.User_Account},t,n)},Ze=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"forbid_send_msg",{GroupId:e.GroupId,Members_Account:e.Members_Account,ShutUpTime:e.ShutUpTime},t,n)},et=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"send_group_system_notification",e,t,n)},tt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"group_msg_get",{GroupId:e.GroupId,ReqMsgSeq:e.ReqMsgSeq,ReqMsgNumber:e.ReqMsgNumber},t,n)},nt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.GROUP,"msg_read_report",{GroupId:e.GroupId,MsgReadedSeq:e.MsgReadedSeq},t,n)},ot=function(e){var t=[];if(e.Fail_Account&&e.Fail_Account.length&&(t=e.Fail_Account),e.Invalid_Account&&e.Invalid_Account.length)for(var n in e.Invalid_Account)t.push(e.Invalid_Account[n]);if(t.length){e.ActionStatus=d.FAIL,e.ErrorCode=99999,e.ErrorInfo="";for(var o in t){var r=t[o];for(var i in e.ResultItem)if(e.ResultItem[i].To_Account==r){var s=e.ResultItem[i].ResultCode;e.ResultItem[i].ResultInfo="["+s+"]"+e.ResultItem[i].ResultInfo,e.ErrorInfo+=e.ResultItem[i].ResultInfo+"\n";break}}}return e},rt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"friend_add",{From_Account:V.identifier,AddFriendItem:e.AddFriendItem},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},it=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"friend_delete",{From_Account:V.identifier,To_Account:e.To_Account,DeleteType:e.DeleteType},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},st=function(e,t,n){pe(n,!0)&&(1==e.chatType?Ct.apiCall(u.DEL_CHAT,"delete",{From_Account:V.identifier,Type:e.chatType,To_Account:e.To_Account},t,n):Ct.apiCall(u.DEL_CHAT,"delete",{From_Account:V.identifier,Type:e.chatType,ToGroupid:e.To_Account},t,n))},ut=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"pendency_get",{From_Account:V.identifier,PendencyType:e.PendencyType,StartTime:e.StartTime,MaxLimited:e.MaxLimited,LastSequence:e.LastSequence},t,n)},at=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"PendencyReport",{From_Account:V.identifier,LatestPendencyTimeStamp:e.LatestPendencyTimeStamp},t,n)},ct=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"pendency_delete",{From_Account:V.identifier,PendencyType:e.PendencyType,To_Account:e.To_Account},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},lt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"friend_response",{From_Account:V.identifier,ResponseFriendItem:e.ResponseFriendItem},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},pt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"friend_get_all",{From_Account:V.identifier,TimeStamp:e.TimeStamp,StartIndex:e.StartIndex,GetCount:e.GetCount,LastStandardSequence:e.LastStandardSequence,TagList:e.TagList},t,n)},ft=function(e,t,n){e.To_Account.length>100&&(e.To_Account.length=100,re.error("获取用户资料人数不能超过100人")),pe(n,!0)&&Ct.apiCall(u.PROFILE,"portrait_get",{From_Account:V.identifier,To_Account:e.To_Account,TagList:e.TagList},function(e){var o=[];if(e.Fail_Account&&e.Fail_Account.length&&(o=e.Fail_Account),e.Invalid_Account&&e.Invalid_Account.length)for(var r in e.Invalid_Account)o.push(e.Invalid_Account[r]);if(o.length){e.ActionStatus=d.FAIL,e.ErrorCode=99999,e.ErrorInfo="";for(var i in o){var s=o[i];for(var u in e.UserProfileItem)if(e.UserProfileItem[u].To_Account==s){var a=e.UserProfileItem[u].ResultCode;e.UserProfileItem[u].ResultInfo="["+a+"]"+e.UserProfileItem[u].ResultInfo,e.ErrorInfo+="账号:"+s+","+e.UserProfileItem[u].ResultInfo+"\n";break}}}e.ActionStatus==d.FAIL?n&&n(e):t&&t(e)},n)},dt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.PROFILE,"portrait_set",{From_Account:V.identifier,ProfileItem:e.ProfileItem},function(n){for(var o in e.ProfileItem){var r=e.ProfileItem[o];if("Tag_Profile_IM_Nick"==r.Tag){V.identifierNick=r.Value;break}}t&&t(n)},n)},gt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"black_list_add",{From_Account:V.identifier,To_Account:e.To_Account},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},mt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"black_list_delete",{From_Account:V.identifier,To_Account:e.To_Account},function(e){var o=ot(e);o.ActionStatus==d.FAIL?n&&n(o):t&&t(o)},n)},It=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.FRIEND,"black_list_get",{From_Account:V.identifier,StartIndex:e.StartIndex,MaxLimited:e.MaxLimited,LastSequence:e.LastSequence},t,n)},Mt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.RECENT_CONTACT,"get",{From_Account:V.identifier,Count:e.Count},t,n)},Et=function(e,t,n){if(pe(n,!0)){var o;o=fe()?"pic_up":"pic_up_test",Ct.apiCall(u.PIC,o,{App_Version:h.APP_VERSION,From_Account:V.identifier,To_Account:e.To_Account,Seq:e.Seq,Timestamp:e.Timestamp,Random:e.Random,File_Str_Md5:e.File_Str_Md5,File_Size:e.File_Size,File_Type:e.File_Type,Server_Ver:h.SERVER_VERSION,Auth_Key:z,Busi_Id:e.Busi_Id,PkgFlag:e.PkgFlag,Slice_Offset:e.Slice_Offset,Slice_Size:e.Slice_Size,Slice_Data:e.Slice_Data},t,n)}},_t=function(e,t){pe(t,!0)&&Ct.apiCall(u.OPEN_IM,"authkey",{},e,t)},yt=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.IM_OPEN_STAT,"web_report",e,t,n)},ht=function(e,t,n){pe(n,!0)&&Ct.apiCall(u.OPEN_IM,"getlongpollingid",{},function(e){t&&t(e)},n)},Tt=function(e,t,n){Ct.apiCall(u.PIC,"apply_download",e,t,n)};!function(){s="wechat"}();var Ct=new function(){var e=null;this.init=function(t,n,o){t&&(e=t)},this.callBack=function(t){e&&e(t)},this.clear=function(){e=null},this.apiCall=function(e,t,n,o,r,i,s){var u=de(e,t,0,r);0!=u&&ce("POST",u,n,0,0,function(i){var s=null,a="";"pic_up"==t&&(n.Slice_Data="");var c="\n request url: \n"+u+"\n request body: \n"+JSON.stringify(n)+"\n response: \n"+JSON.stringify(i);i.ActionStatus==d.OK?(re.info("["+e+"]["+t+"]success: "+c),o&&o(i),s=0,a=""):(s=i.ErrorCode,a=i.ErrorInfo,r&&(i.SrcErrorInfo=i.ErrorInfo,i.ErrorInfo="["+e+"]["+t+"]failed: "+c,"longpolling"==t&&60008==i.ErrorCode||re.error(i.ErrorInfo),r(i))),ye(t,s,a)},function(e){r&&r(e),ye(t,e.ErrorCode,e.ErrorInfo)})}},At=function(e,t,n,o,r,i){this._impl={skey:At.skey(e,t),type:e,id:t,name:n,icon:o,unread:0,isAutoRead:!1,time:r>=0?r:0,curMaxMsgSeq:i>=0?i:0,msgs:[],isFinished:1}};At.skey=function(e,t){return e+t},At.prototype.type=function(){return this._impl.type},At.prototype.id=function(){return this._impl.id},At.prototype.name=function(){return this._impl.name},At.prototype.icon=function(){return this._impl.icon},At.prototype.unread=function(e){if(void 0===e)return this._impl.unread;this._impl.unread=e},At.prototype.isFinished=function(e){if(void 0===e)return this._impl.isFinished;this._impl.isFinished=e},At.prototype.time=function(){return this._impl.time},At.prototype.curMaxMsgSeq=function(e){if(void 0===e)return this._impl.curMaxMsgSeq;this._impl.curMaxMsgSeq=e},At.prototype.msgCount=function(){return this._impl.msgs.length},At.prototype.msg=function(e){return this._impl.msgs[e]},At.prototype.msgs=function(){return this._impl.msgs},At.prototype._impl_addMsg=function(e,t){this._impl.msgs.push(e),e.time>this._impl.time&&(this._impl.time=e.time),e.seq>this._impl.curMaxMsgSeq&&(this._impl.curMaxMsgSeq=e.seq),e.isSend||this._impl.isAutoRead||!t||this._impl.unread++};var St=function(e,t){this.toAccount=e,this.lastedMsgTime=t},Gt=function(e,t,n,o,r,i,s,u,a){this.sess=e,this.subType=s>=0?s:0,this.fromAccount=i,this.fromAccountNick=u||i,this.fromAccountHeadurl=a||null,this.isSend=Boolean(t),this.seq=n>=0?n:se(),this.random=o>=0?o:ue(),this.time=r>=0?r:ie(),this.elems=[];var c=e.type()};Gt.prototype.getSession=function(){return this.sess},Gt.prototype.getType=function(){return this.subType},Gt.prototype.getSubType=function(){return this.subType},Gt.prototype.getFromAccount=function(){return this.fromAccount},Gt.prototype.getFromAccountNick=function(){return this.fromAccountNick},Gt.prototype.getIsSend=function(){return this.isSend},Gt.prototype.getSeq=function(){return this.seq},Gt.prototype.getTime=function(){return this.time},Gt.prototype.getRandom=function(){return this.random},Gt.prototype.getElems=function(){return this.elems},Gt.prototype.getMsgUniqueId=function(){return this.uniqueId},Gt.prototype.addText=function(e){this.addElem(new t.Msg.Elem(g.TEXT,e))},Gt.prototype.addFace=function(e){this.addElem(new t.Msg.Elem(g.FACE,e))},Gt.prototype.addImage=function(e){this.addElem(new t.Msg.Elem(g.IMAGE,e))},Gt.prototype.addLocation=function(e){this.addElem(new t.Msg.Elem(g.LOCATION,e))},Gt.prototype.addFile=function(e){this.addElem(new t.Msg.Elem(g.FILE,e))},Gt.prototype.addCustom=function(e){this.addElem(new t.Msg.Elem(g.CUSTOM,e))},Gt.prototype.addElem=function(e){this.elems.push(e)},Gt.prototype.toHtml=function(){var e="";for(var t in this.elems){e+=this.elems[t].toHtml()}return e},Gt.Elem=function(e,t){this.type=e,this.content=t},Gt.Elem.prototype.getType=function(){return this.type},Gt.Elem.prototype.getContent=function(){return this.content},Gt.Elem.prototype.toHtml=function(){return this.content.toHtml()},Gt.Elem.Text=function(e){this.text=oe.xssFilter(e)},Gt.Elem.Text.prototype.getText=function(){return this.text},Gt.Elem.Text.prototype.toHtml=function(){return this.text},Gt.Elem.Face=function(e,t){this.index=e,this.data=t},Gt.Elem.Face.prototype.getIndex=function(){return this.index},Gt.Elem.Face.prototype.getData=function(){return this.data},Gt.Elem.Face.prototype.toHtml=function(){var e=null,t=te[this.data],n=ne[t];return n&&n[1]&&(e=n[1]),e?"<img src='"+e+"'/>":this.data},Gt.Elem.Location=function(e,t,n){this.latitude=t,this.longitude=e,this.desc=n},Gt.Elem.Location.prototype.getLatitude=function(){return this.latitude},Gt.Elem.Location.prototype.getLongitude=function(){return this.longitude},Gt.Elem.Location.prototype.getDesc=function(){return this.desc},Gt.Elem.Location.prototype.toHtml=function(){return"经度="+this.longitude+",纬度="+this.latitude+",描述="+this.desc},Gt.Elem.Images=function(e,t){this.UUID=e,"number"!=typeof t&&(t=parseInt(I[t]||I.UNKNOWN,10)),this.ImageFormat=t,this.ImageInfoArray=[]},Gt.Elem.Images.prototype.addImage=function(e){this.ImageInfoArray.push(e)},Gt.Elem.Images.prototype.toHtml=function(){var e=this.getImage(m.SMALL),t=this.getImage(m.LARGE),n=this.getImage(m.ORIGIN);return t||(t=e),n||(n=e),"<img src='"+e.getUrl()+"#"+t.getUrl()+"#"+n.getUrl()+"' style='CURSOR: hand' id='"+this.getImageId()+"' bigImgUrl='"+t.getUrl()+"' onclick='imageClick(this)' />"},Gt.Elem.Images.prototype.getImageId=function(){return this.UUID},Gt.Elem.Images.prototype.getImageFormat=function(){return this.ImageFormat},Gt.Elem.Images.prototype.getImage=function(e){for(var t in this.ImageInfoArray)if(this.ImageInfoArray[t].getType()==e)return this.ImageInfoArray[t];var n=null;return this.ImageInfoArray.forEach(function(t){t.getType()==e&&(n=t)}),n},Gt.Elem.Images.Image=function(e,t,n,o,r){this.type=e,this.size=t,this.width=n,this.height=o,this.url=r},Gt.Elem.Images.Image.prototype.getType=function(){return this.type},Gt.Elem.Images.Image.prototype.getSize=function(){return this.size},Gt.Elem.Images.Image.prototype.getWidth=function(){return this.width},Gt.Elem.Images.Image.prototype.getHeight=function(){return this.height},Gt.Elem.Images.Image.prototype.getUrl=function(){return this.url},
Gt.Elem.Sound=function(e,t,n,o,r,i,s,u){this.uuid=e,this.second=t,this.size=n,this.senderId=o,this.receiverId=r,this.downFlag=i,this.busiId=s==l.C2C?2:1,2==i&&null!=u?this.downUrl=u:void 0!==this.downFlag&&void 0!==this.busiId?Ie(e,o,0,i,r,this.busiId,y.SOUND):this.downUrl=ge(e,o)},Gt.Elem.Sound.prototype.getUUID=function(){return this.uuid},Gt.Elem.Sound.prototype.getSecond=function(){return this.second},Gt.Elem.Sound.prototype.getSize=function(){return this.size},Gt.Elem.Sound.prototype.getSenderId=function(){return this.senderId},Gt.Elem.Sound.prototype.getDownUrl=function(){return this.downUrl},Gt.Elem.Sound.prototype.toHtml=function(){return"ie"==s.type&&parseInt(s.ver)<=8?"[这是一条语音消息]demo暂不支持ie8(含)以下浏览器播放语音,语音URL:"+this.downUrl:'<audio id="uuid_'+this.uuid+'" src="'+this.downUrl+'" controls="controls" onplay="onChangePlayAudio(this)" preload="none"></audio>'},Gt.Elem.File=function(e,t,n,o,r,i,s){this.uuid=e,this.name=t,this.size=n,this.senderId=o,this.receiverId=r,this.downFlag=i,this.busiId=s==l.C2C?2:1,2==i&&null!=url?this.downUrl=url:void 0!==i&&void 0!==this.busiId?Ie(e,o,0,i,r,this.busiId,y.FILE):this.downUrl=me(e,o,t)},Gt.Elem.File.prototype.getUUID=function(){return this.uuid},Gt.Elem.File.prototype.getName=function(){return this.name},Gt.Elem.File.prototype.getSize=function(){return this.size},Gt.Elem.File.prototype.getSenderId=function(){return this.senderId},Gt.Elem.File.prototype.getDownUrl=function(){return this.downUrl},Gt.Elem.File.prototype.getDownFlag=function(){return this.downFlag},Gt.Elem.File.prototype.toHtml=function(){var e,t;return e=this.size,t="Byte",this.size>=1024&&(e=Math.round(this.size/1024),t="KB"),{uuid:this.uuid,name:this.name,size:e,unitStr:t}},Gt.Elem.GroupTip=function(e,t,n,o,r,i){this.opType=e,this.opUserId=t,this.groupId=n,this.groupName=o,this.userIdList=r||[],this.groupInfoList=[],this.memberInfoList=[],this.groupMemberNum=null,this.userinfo=i||[]},Gt.Elem.GroupTip.prototype.addGroupInfo=function(e){this.groupInfoList.push(e)},Gt.Elem.GroupTip.prototype.addMemberInfo=function(e){this.memberInfoList.push(e)},Gt.Elem.GroupTip.prototype.getOpType=function(){return this.opType},Gt.Elem.GroupTip.prototype.getOpUserId=function(){return this.opUserId},Gt.Elem.GroupTip.prototype.getGroupId=function(){return this.groupId},Gt.Elem.GroupTip.prototype.getGroupName=function(){return this.groupName},Gt.Elem.GroupTip.prototype.getUserIdList=function(){return this.userIdList},Gt.Elem.GroupTip.prototype.getUserInfo=function(){return this.userinfo},Gt.Elem.GroupTip.prototype.getGroupInfoList=function(){return this.groupInfoList},Gt.Elem.GroupTip.prototype.getMemberInfoList=function(){return this.memberInfoList},Gt.Elem.GroupTip.prototype.getGroupMemberNum=function(){return this.groupMemberNum},Gt.Elem.GroupTip.prototype.setGroupMemberNum=function(e){return this.groupMemberNum=e},Gt.Elem.GroupTip.prototype.toHtml=function(){var e="[群提示消息]";switch(this.opType){case F.JOIN:e+=this.opUserId+"邀请了";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="加入该群";break;case F.QUIT:e+=this.opUserId+"主动退出该群";break;case F.KICK:e+=this.opUserId+"将";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="踢出该群";break;case F.SET_ADMIN:e+=this.opUserId+"将";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="设为管理员";break;case F.CANCEL_ADMIN:e+=this.opUserId+"取消";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="的管理员资格";break;case F.MODIFY_GROUP_INFO:e+=this.opUserId+"修改了群资料:";for(var t in this.groupInfoList){var n=this.groupInfoList[t].getType(),o=this.groupInfoList[t].getValue();switch(n){case O.FACE_URL:e+="群头像为"+o+"; ";break;case O.NAME:e+="群名称为"+o+"; ";break;case O.OWNER:e+="群主为"+o+"; ";break;case O.NOTIFICATION:e+="群公告为"+o+"; ";break;case O.INTRODUCTION:e+="群简介为"+o+"; ";break;default:e+="未知信息为:type="+n+",value="+o+"; "}}break;case F.MODIFY_MEMBER_INFO:e+=this.opUserId+"修改了群成员资料:";for(var t in this.memberInfoList){var r=this.memberInfoList[t].getUserId(),i=this.memberInfoList[t].getShutupTime();if(e+=r+": ",e+=null!=i&&void 0!==i?0==i?"取消禁言; ":"禁言"+i+"秒; ":" shutupTime为空",this.memberInfoList.length>10&&9==t){e+="等"+this.memberInfoList.length+"人";break}}break;case F.READED:Log.info("消息已读同步");break;default:e+="未知群提示消息类型:type="+this.opType}return e},Gt.Elem.GroupTip.GroupInfo=function(e,t){this.type=e,this.value=t},Gt.Elem.GroupTip.GroupInfo.prototype.getType=function(){return this.type},Gt.Elem.GroupTip.GroupInfo.prototype.getValue=function(){return this.value},Gt.Elem.GroupTip.MemberInfo=function(e,t){this.userId=e,this.shutupTime=t},Gt.Elem.GroupTip.MemberInfo.prototype.getUserId=function(){return this.userId},Gt.Elem.GroupTip.MemberInfo.prototype.getShutupTime=function(){return this.shutupTime},Gt.Elem.Custom=function(e,t,n){this.data=e,this.desc=t,this.ext=n},Gt.Elem.Custom.prototype.getData=function(){return this.data},Gt.Elem.Custom.prototype.getDesc=function(){return this.desc},Gt.Elem.Custom.prototype.getExt=function(){return this.ext},Gt.Elem.Custom.prototype.toHtml=function(){return this.data};var Ft=new function(){var t={},n=[];e={},this.cookie="",this.syncFlag=0;var o=function(e){for(var n in t)e(t[n])},r=function(t){var n=!1,o=t.sess._impl.skey,r=[t.isSend?"1":"0",t.seq,t.random].join("");return e[o]&&e[o][r]&&(n=!0),e[o]?e[o][r]={time:t.time}:(e[o]={},e[o][r]={time:t.time}),n};this.sessMap=function(){return t},this.sessCount=function(){return n.length},this.sessByTypeId=function(e,n){var o=At.skey(e,n);return void 0===o||null==o?null:t[o]},this.delSessByTypeId=function(n,o){var r=At.skey(n,o);return void 0!==r&&null!=r&&(t[r]&&(delete t[r],delete e[r]),!0)},this.resetCookieAndSyncFlag=function(){this.cookie="",this.syncFlag=0},this.setAutoRead=function(e,t,n){if(n&&o(function(e){e._impl.isAutoRead=!1}),e&&(e._impl.isAutoRead=t,t))if(e._impl.unread=0,e._impl.type==l.C2C){var r=[];r.push(new St(e._impl.id,e._impl.time)),Oe(Ft.cookie,r,function(e){re.info("[setAutoRead]: c2CMsgReaded success")},function(e){re.error("[setAutoRead}: c2CMsgReaded failed:"+e.ErrorInfo)})}else if(e._impl.type==l.GROUP){var i={GroupId:e._impl.id,MsgReadedSeq:e._impl.curMaxMsgSeq};nt(i,function(e){re.info("groupMsgReaded success")},function(e){re.error("groupMsgReaded failed:"+e.ErrorInfo)})}},this.c2CMsgReaded=function(e,t,n){var o=[];o.push(new St(e.To_Account,e.LastedMsgTime)),Oe(Ft.cookie,o,function(e){t&&(re.info("c2CMsgReaded success"),t(e))},function(e){n&&(re.error("c2CMsgReaded failed:"+e.ErrorInfo),n(e))})},this.addSession=function(e){t[e._impl.skey]=e},this.delSession=function(e){delete t[e._impl.skey]},this.clear=function(){t={},n=[],e={},this.cookie="",this.syncFlag=0},this.addMsg=function(e,n){if(r(e))return!1;var o=e.sess;return t[o._impl.skey]||this.addSession(o),o._impl_addMsg(e,n),!0},this.updateTimeline=function(){var e=new Array;o(function(t){e.push(t)}),e.sort(function(e,t){return t.time-e.time}),n=e}},Ot=new function(){var e=null,t=null,n={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null,9:null,10:null,11:null,15:null,255:null,12:null},o={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},r={1:null},i=null,s=!1,u=0,a=0,c=null,p=!1,f={},m=90,I=null,M={},E={92:null,96:null},_=null,y={},h={};this.setLongPollingOn=function(e){s=e},this.getLongPollingOn=function(){return s},this.resetLongPollingInfo=function(){s=!1,u=0,a=0},this.setBigGroupLongPollingOn=function(e){p=e},this.checkBigGroupLongPollingOn=function(e){return!!I[e]},this.setBigGroupLongPollingKey=function(e,t){I[e]=t},this.resetBigGroupLongPollingInfo=function(e){p=!1,f[e]=0,I[e]=null,M[e]={},delete f[e],delete I[e],delete M[e]},this.setBigGroupLongPollingMsgMap=function(e,t){var n=M[e];n?(n=parseInt(n)+t,M[e]=n):M[e]=t},this.clear=function(){t=null,n={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null,9:null,10:null,11:null,15:null,255:null,12:null},o={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},r={1:null},e=null,s=!1,u=0,a=0,c=null,p=!1,f={},I={},M={},h={},H=[],z=null,J=null};var P=function(e,t){_t(function(t){H=t.IpList,z=t.AuthKey,J=t.ExpireTime,e&&e(t)},function(e){re.error("initIpAndAuthkey failed:"+e.ErrorInfo),t&&t(e)})},b=function(e,t){var n={Member_Account:V.identifier,Limit:1e3,Offset:0,GroupBaseInfoFilter:["NextMsgSeq"]};Qe(n,function(t){if(!t.GroupIdList||0==t.GroupIdList.length)return re.info("initMyGroupMaxSeqs: 目前还没有加入任何群组"),void(e&&e(t));for(var n=0;n<t.GroupIdList.length;n++){var o=t.GroupIdList[n].GroupId,r=t.GroupIdList[n].NextMsgSeq-1;y[o]=r}e&&e(t)},function(e){re.error("initMyGroupMaxSeqs failed:"+e.ErrorInfo),t&&t(e)})},K=function(e,t){var n=y[e];n?t>n&&(y[e]=t):y[e]=t},Y=function(e,t){for(var n in e){var o=e[n];if(o.From_Account){var r=ue(o,!1,!0);r&&t.push(r),K(o.ToGroupId,o.MsgSeq)}}return t},X=function(t,n){var o={},r=[];for(var i in n){var s=o[n[i].ToGroupId];s||(s=o[n[i].ToGroupId]={min:99999999,max:-1,msgs:[]}),n[i].NoticeSeq>a&&(re.warn("noticeSeq="+a+",msgNoticeSeq="+n[i].NoticeSeq),a=n[i].NoticeSeq),n[i].Event=t,o[n[i].ToGroupId].msgs.push(n[i]),n[i].MsgSeq<s.min&&(o[n[i].ToGroupId].min=n[i].MsgSeq),n[i].MsgSeq>s.max&&(o[n[i].ToGroupId].max=n[i].MsgSeq)}for(var u in o)r=Y(o[u].msgs,r);r.length&&Ft.updateTimeline(),e&&r.length&&e(r)},j=function(t,n){var o={},r=[];for(var i in n){var s=o[n[i].ToGroupId];s||(s=o[n[i].ToGroupId]={min:99999999,max:-1,msgs:[]}),n[i].NoticeSeq>a&&(re.warn("noticeSeq="+a+",msgNoticeSeq="+n[i].NoticeSeq),a=n[i].NoticeSeq),n[i].Event=t,o[n[i].ToGroupId].msgs.push(n[i]),n[i].MsgSeq<s.min&&(o[n[i].ToGroupId].min=n[i].MsgSeq),n[i].MsgSeq>s.max&&(o[n[i].ToGroupId].max=n[i].MsgSeq)}for(var u in o)r=Y(o[u].msgs,r);r.length&&Ft.updateTimeline(),e&&r.length&&e(r)},W=function(e,t){for(var o in e){var r=e[o],i=r.MsgBody,s=i.ReportType;0==t&&r.NoticeSeq&&r.NoticeSeq>a&&(a=r.NoticeSeq);r.GroupInfo.To_Account;if(t){var u=r.ToGroupId+"_"+s+"_"+i.Operator_Account+"_"+r.ClientSeq;if(h[u]){re.warn("收到重复的群系统消息:key="+u);continue}h[u]=!0}var c={SrcFlag:0,ReportType:s,GroupId:r.ToGroupId,GroupName:r.GroupInfo.GroupName,Operator_Account:i.Operator_Account,MsgTime:r.MsgTimeStamp,groupReportTypeMsg:i,MsgSeq:r.ClientSeq,MsgRandom:r.MsgRandom,sourceGroupTip:r};switch(s){case R.JOIN_GROUP_REQUEST:c.RemarkInfo=i.RemarkInfo,c.MsgKey=i.MsgKey,c.Authentication=i.Authentication,c.UserDefinedField=r.UserDefinedField,c.From_Account=r.From_Account;break;case R.JOIN_GROUP_ACCEPT:case R.JOIN_GROUP_REFUSE:c.RemarkInfo=i.RemarkInfo;break;case R.KICK:case R.DESTORY:case R.CREATE:case R.INVITED_JOIN_GROUP_REQUEST:case R.INVITED_JOIN_GROUP_REQUEST_AGREE:case R.QUIT:case R.SET_ADMIN:case R.CANCEL_ADMIN:case R.REVOKE:case R.READED:break;case R.CUSTOM:c.UserDefinedField=i.UserDefinedField;break;default:re.error("未知群系统消息类型:reportType="+s)}if(t)n[s]?n[s](c):re.error("未知群系统消息类型:reportType="+s);else if(n[s])if(s==R.READED)for(var l=c.groupReportTypeMsg.GroupReadInfoArray,p=0,f=l.length;p<f;p++){var d=l[p];n[s](d)}else n[s](c)}},Q=function(e,t){var n,r,i;for(var s in e){switch(n=e[s],r=n.PushType,0==t&&n.NoticeSeq&&n.NoticeSeq>a&&(a=n.NoticeSeq),i={Type:r},r){case N.FRIEND_ADD:i.Accounts=n.FriendAdd_Account;break;case N.FRIEND_DELETE:i.Accounts=n.FriendDel_Account;break;case N.PENDENCY_ADD:i.PendencyList=n.PendencyAdd;break;case N.PENDENCY_DELETE:i.Accounts=n.FrienPencydDel_Account;break;case N.BLACK_LIST_ADD:i.Accounts=n.BlackListAdd_Account;break;case N.BLACK_LIST_DELETE:i.Accounts=n.BlackListDel_Account;break;default:re.error("未知好友系统通知类型:friendNotice="+JSON.stringify(n))}t?r==N.PENDENCY_ADD&&o[r]&&o[r](i):o[r]&&o[r](i)}},$=function(e,t){var n,o,i;for(var s in e){switch(n=e[s],o=n.PushType,0==t&&n.NoticeSeq&&n.NoticeSeq>a&&(a=n.NoticeSeq),i={Type:o},o){case v.PROFILE_MODIFY:i.Profile_Account=n.Profile_Account,i.ProfileList=n.ProfileList;break;default:re.error("未知资料系统通知类型:profileNotice="+JSON.stringify(n))}t?o==v.PROFILE_MODIFY&&r[o]&&r[o](i):r[o]&&r[o](i)}},Z=function(e){var t=e.MsgBody,o=t.ReportType,r=(e.GroupInfo.To_Account,{SrcFlag:1,ReportType:o,GroupId:e.ToGroupId,GroupName:e.GroupInfo.GroupName,Operator_Account:t.Operator_Account,MsgTime:e.MsgTimeStamp});switch(o){case R.JOIN_GROUP_REQUEST:r.RemarkInfo=t.RemarkInfo,r.MsgKey=t.MsgKey,r.Authentication=t.Authentication,r.UserDefinedField=e.UserDefinedField,r.From_Account=e.From_Account,r.MsgSeq=e.ClientSeq,r.MsgRandom=e.MsgRandom;break;case R.JOIN_GROUP_ACCEPT:case R.JOIN_GROUP_REFUSE:r.RemarkInfo=t.RemarkInfo;break;case R.KICK:case R.DESTORY:case R.CREATE:case R.INVITED_JOIN_GROUP_REQUEST:case R.INVITED_JOIN_GROUP_REQUEST_AGREE:case R.QUIT:case R.SET_ADMIN:case R.CANCEL_ADMIN:case R.REVOKE:break;case R.CUSTOM:r.MsgSeq=e.MsgSeq,r.UserDefinedField=t.UserDefinedField;break;default:re.error("未知群系统消息类型:reportType="+o)}n[o]&&n[o](r)},ee=function(e){for(var t=0,n=e.length;t<n;t++)te(e[t])},te=function(e){var t=e.SubMsgType;switch(t){case A.READED:if(re.warn("C2C已读消息通知"),e.ReadC2cMsgNotify&&e.ReadC2cMsgNotify.UinPairReadArray&&E[t])for(var n=0,o=e.ReadC2cMsgNotify.UinPairReadArray.length;n<o;n++){var r=e.ReadC2cMsgNotify.UinPairReadArray[n];E[t](r)}break;case A.KICKEDOUT:re.warn("多终端互踢通知"),Ce("instance"),E[t]&&E[t]();break;default:re.error("未知C2c系统消息:subType="+t)}};this.longPolling=function(e,t){function n(){Se(o,function(e){for(var t in e.EventArray){var n=e.EventArray[t];switch(n.Event){case T.C2C:u=n.NotifySeq,re.warn("longpolling: received new c2c msg"),Ot.syncMsgs();break;case T.GROUP_COMMON:re.warn("longpolling: received new group msgs"),j(n.Event,n.GroupMsgArray);break;case T.GROUP_TIP:case T.GROUP_TIP2:re.warn("longpolling: received new group tips"),j(n.Event,n.GroupTips);break;case T.GROUP_SYSTEM:re.warn("longpolling: received new group system msgs"),W(n.GroupTips,!1);break;case T.FRIEND_NOTICE:re.warn("longpolling: received new friend system notice"),Q(n.FriendListMod,!1);break;case T.PROFILE_NOTICE:re.warn("longpolling: received new profile system notice"),$(n.ProfileDataMod,!1);break;case T.C2C_COMMON:a=n.C2cMsgArray[0].NoticeSeq,re.warn("longpolling: received new c2c_common msg",a),X(n.Event,n.C2cMsgArray);break;case T.C2C_EVENT:a=n.C2cNotifyMsgArray[0].NoticeSeq,re.warn("longpolling: received new c2c_event msg"),ee(n.C2cNotifyMsgArray);break;default:re.error("longpolling收到未知新消息类型: Event="+n.Event)}}var o={ActionStatus:d.OK,ErrorCode:0};ne(o)},function(e){ne(e),t&&t(e)})}var o={Timeout:q/1e3,Cookie:{NotifySeq:u,NoticeSeq:a}};B?(o.Cookie.LongPollingId=B,n()):ht(0,function(e){B=o.Cookie.LongPollingId=e.LongPollingId,q=e.Timeout>60?q:1e3*e.Timeout,n()})},this.bigGroupLongPolling=function(e,t,n){var o={USP:1,StartSeq:f[e],HoldTime:m,Key:I[e]};Ge(o,function(n){var o=[];if(f[e]=n.NextSeq,m=n.HoldTime,I[e]=n.Key,n.RspMsgList&&n.RspMsgList.length>0){for(var r,i,s,u=0,a=n.RspMsgList.length-1;a>=0;a--){r=n.RspMsgList[a];var l={F_Account:"From_Account",T_Account:"To_Account",FAType:"EnumFrom_AccountType",TAType:"EnumTo_AccountType",GCode:"GroupCode",GName:"GroupName",GId:"GroupId",MFlg:"MsgFlag",FAEInfo:"MsgFrom_AccountExtraInfo",Evt:"Event",GInfo:"GroupInfo",BPlc:"IsPlaceMsg",MBody:"MsgBody",Pri:"MsgPriority",Rdm:"MsgRandom",MSeq:"MsgSeq",TStp:"MsgTimeStamp",TGId:"ToGroupId",UEInfo:"UinExtInfo",UId:"UserId",BSys:"IsSystemMsg",FAHUrl:"From_AccountHeadurl",FANick:"From_AccountNick"};if(r=oe.replaceObject(l,r),!r.IsPlaceMsg&&r.From_Account&&r.MsgBody&&0!=r.MsgBody.length)switch(i=r.Event){case T.GROUP_COMMON:re.info("bigGroupLongPolling: return new group msg"),s=ue(r,!1,!1),s&&o.push(s),u+=1;break;case T.GROUP_TIP:case T.GROUP_TIP2:re.info("bigGroupLongPolling: return new group tip"),s=ue(r,!1,!1),s&&o.push(s);break;case T.GROUP_SYSTEM:re.info("bigGroupLongPolling: new group system msg"),Z(r);break;default:re.error("bigGroupLongPolling收到未知新消息类型: Event="+i)}}u>0&&(Ot.setBigGroupLongPollingMsgMap(r.ToGroupId,u),re.warn("current bigGroupLongPollingMsgMap: "+JSON.stringify(M)))}x=0;var g={ActionStatus:d.OK,ErrorCode:U.ON,ErrorInfo:"connection is ok..."};Ct.callBack(g),t?t(o):c&&c(o),p&&Ot.bigGroupLongPolling(e)},function(t){10018==t.ErrorCode?f[e]=0:60008!=t.ErrorCode&&(re.error(t.ErrorInfo),x++),91101==t.ErrorCode&&(re.error("多实例登录,被kick"),i&&i()),p&&Ot.bigGroupLongPolling(e),n&&n(t)},1e3*m)};var ne=function(e){if(0==e.ErrorCode||60008==e.ErrorCode){w=0,k=!1;var t,n=!1;switch(D){case U.INIT:n=!0,D=U.ON,t="create connection successfully(INIT->ON)";break;case U.ON:t="connection is on...(ON->ON)";break;case U.RECONNECT:D=U.ON,t="connection is on...(RECONNECT->ON)";break;case U.OFF:n=!0,D=U.RECONNECT,t="reconnect successfully(OFF->RECONNECT)"}var o={ActionStatus:d.OK,ErrorCode:D,ErrorInfo:t};n&&Ct.callBack(o),s&&Ot.longPolling()}else if(91101==e.ErrorCode)re.error("多实例登录,被kick"),i&&i();else if(w++,re.warn("longPolling接口第"+w+"次报错: "+e.ErrorInfo),w<=10)setTimeout(ie,100);else{D=U.OFF;var r={ActionStatus:d.FAIL,ErrorCode:U.OFF,ErrorInfo:"connection is off"};0==k&&Ct.callBack(r),k=!0,re.warn("5000毫秒之后,SDK会发起新的longPolling请求..."),setTimeout(ie,5e3)}},X=function(t,n){var o=[],r=[];r=n;for(var i in r){var s,u,a=r[i],c=a.From_AccountHeadurl||"";a.From_Account==V.identifier?(s=!0,u=a.To_Account):(s=!1,u=a.From_Account);var p=Ft.sessByTypeId(l.C2C,u);p||(p=new At(l.C2C,u,u,c,0,0));var f=new Gt(p,s,a.MsgSeq,a.MsgRandom,a.MsgTimeStamp,a.From_Account,C.COMMON,a.From_AccountNick,c),d=null,m=null,I=null;for(var M in a.MsgBody){switch(d=a.MsgBody[M],I=d.MsgType){case g.TEXT:m=new Gt.Elem.Text(d.MsgContent.Text);break;case g.FACE:m=new Gt.Elem.Face(d.MsgContent.Index,d.MsgContent.Data);break;case g.IMAGE:m=new Gt.Elem.Images(d.MsgContent.UUID,d.MsgContent.ImageFormat||"");for(var E in d.MsgContent.ImageInfoArray){var _=d.MsgContent.ImageInfoArray[E];m.addImage(new Gt.Elem.Images.Image(_.Type,_.Size,_.Width,_.Height,_.URL))}break;case g.SOUND:d.MsgContent?m=new Gt.Elem.Sound(d.MsgContent.UUID,d.MsgContent.Second,d.MsgContent.Size,a.From_Account,a.To_Account,d.MsgContent.Download_Flag,l.C2C,d.MsgContent.Url||null):(I=g.TEXT,m=new Gt.Elem.Text("[语音消息]下载地址解析出错"));break;case g.LOCATION:m=new Gt.Elem.Location(d.MsgContent.Longitude,d.MsgContent.Latitude,d.MsgContent.Desc);break;case g.FILE:case g.FILE+" ":I=g.FILE,d.MsgContent?m=new Gt.Elem.File(d.MsgContent.UUID,d.MsgContent.FileName,d.MsgContent.FileSize,a.From_Account,a.To_Account,d.MsgContent.Download_Flag,l.C2C):(I=g.TEXT,m=new Gt.Elem.Text("[文件消息下载地址解析出错]"));break;case g.CUSTOM:try{var y=JSON.parse(d.MsgContent.Data);if(y&&y.userAction&&y.userAction==L.ING)continue}catch(e){}I=g.CUSTOM,m=new Gt.Elem.Custom(d.MsgContent.Data,d.MsgContent.Desc,d.MsgContent.Ext);break;default:I=g.TEXT,m=new Gt.Elem.Text("web端暂不支持"+d.MsgType+"消息")}f.elems.push(new Gt.Elem(I,m))}f.elems.length>0&&Ft.addMsg(f,!0)&&o.push(f)}o.length>0&&Ft.updateTimeline(),o.length>0&&e&&e(o)},ie=function(){s&&Ot.longPolling()},se=function(e){for(var t in e){var n=e[t];switch(W(n.GroupTips,!0),n.Event){case T.GROUP_SYSTEM:re.warn("handlerApplyJoinGroupSystemMsgs: handler new group system msg"),W(n.GroupTips,!0);break;default:re.error("syncMsgs收到未知的群系统消息类型: Event="+n.Event)}}};this.syncMsgs=function(t,n){var o=[],r=[];Fe(Ft.cookie,Ft.syncFlag,function(n){2==n.SyncFlag&&(Ft.syncFlag=0),r=n.MsgList,Ft.cookie=n.Cookie;for(var i in r){var s,u,a,c=r[i];c.From_Account==V.identifier?(s=!0,u=c.To_Account,a=""):(s=!1,u=c.From_Account,a="");var p=Ft.sessByTypeId(l.C2C,u);p||(p=new At(l.C2C,u,u,a,0,0));var f=new Gt(p,s,c.MsgSeq,c.MsgRandom,c.MsgTimeStamp,c.From_Account,C.COMMON,c.From_AccountNick,c.From_AccountHeadurl),d=null,m=null,I=null;for(var M in c.MsgBody){switch(d=c.MsgBody[M],I=d.MsgType){case g.TEXT:m=new Gt.Elem.Text(d.MsgContent.Text);break;case g.FACE:m=new Gt.Elem.Face(d.MsgContent.Index,d.MsgContent.Data);break;case g.IMAGE:m=new Gt.Elem.Images(d.MsgContent.UUID,d.MsgContent.ImageFormat);for(var E in d.MsgContent.ImageInfoArray){var _=d.MsgContent.ImageInfoArray[E];m.addImage(new Gt.Elem.Images.Image(_.Type,_.Size,_.Width,_.Height,_.URL))}break;case g.SOUND:d.MsgContent?m=new Gt.Elem.Sound(d.MsgContent.UUID,d.MsgContent.Second,d.MsgContent.Size,c.From_Account,c.To_Account,d.MsgContent.Download_Flag,l.C2C,d.MsgContent.Url||null):(I=g.TEXT,m=new Gt.Elem.Text("[语音消息]下载地址解析出错"));break;case g.LOCATION:m=new Gt.Elem.Location(d.MsgContent.Longitude,d.MsgContent.Latitude,d.MsgContent.Desc);break;case g.FILE:case g.FILE+" ":I=g.FILE,d.MsgContent?m=new Gt.Elem.File(d.MsgContent.UUID,d.MsgContent.FileName,d.MsgContent.FileSize,c.From_Account,c.To_Account,d.MsgContent.Download_Flag,l.C2C):(I=g.TEXT,m=new Gt.Elem.Text("[文件消息下载地址解析出错]"));break;case g.CUSTOM:try{var y=JSON.parse(d.MsgContent.Data);if(y&&y.userAction&&y.userAction==L.ING)continue}catch(e){}I=g.CUSTOM,m=new Gt.Elem.Custom(d.MsgContent.Data,d.MsgContent.Desc,d.MsgContent.Ext);break;default:I=g.TEXT,m=new Gt.Elem.Text("web端暂不支持"+d.MsgType+"消息")}f.elems.push(new Gt.Elem(I,m))}f.elems.length>0&&Ft.addMsg(f,!0)&&o.push(f)}se(n.EventArray),o.length>0&&Ft.updateTimeline(),t?t(o):o.length>0&&e&&e(o)},function(e){re.error("getMsgs failed:"+e.ErrorInfo),n&&n(e)})},this.getC2CHistoryMsgs=function(e,t,n){if(!e.Peer_Account&&n)return void n(oe.getReturnError("Peer_Account is empty",-13));if(e.MaxCnt||(e.MaxCnt=15),e.MaxCnt<=0&&n)return void n(oe.getReturnError("MaxCnt should be greater than 0",-14));if(e.MaxCnt>15){if(n)return void n(oe.getReturnError("MaxCnt can not be greater than 15",-15))}else{null!=e.MsgKey&&void 0!==e.MsgKey||(e.MsgKey="");var o={Peer_Account:e.Peer_Account,MaxCnt:e.MaxCnt,LastMsgTime:e.LastMsgTime,MsgKey:e.MsgKey};Ne(o,function(n){var o=[],r=[];r=n.MsgList;var i=Ft.sessByTypeId(l.C2C,e.Peer_Account);i||(i=new At(l.C2C,e.Peer_Account,e.Peer_Account,"",0,0));for(var s in r){var u,a=r[s],c=a.From_AccountHeadurl||"";a.From_Account==V.identifier?(u=!0,a.To_Account):(u=!1,a.From_Account);var p=new Gt(i,u,a.MsgSeq,a.MsgRandom,a.MsgTimeStamp,a.From_Account,C.COMMON,a.From_AccountNick,c),f=null,d=null,m=null;for(var I in a.MsgBody){switch(f=a.MsgBody[I],m=f.MsgType){case g.TEXT:d=new Gt.Elem.Text(f.MsgContent.Text);break;case g.FACE:d=new Gt.Elem.Face(f.MsgContent.Index,f.MsgContent.Data);break;case g.IMAGE:d=new Gt.Elem.Images(f.MsgContent.UUID,f.MsgContent.ImageFormat);for(var M in f.MsgContent.ImageInfoArray){var E=f.MsgContent.ImageInfoArray[M];d.addImage(new Gt.Elem.Images.Image(E.Type,E.Size,E.Width,E.Height,E.URL))}break;case g.SOUND:f.MsgContent?d=new Gt.Elem.Sound(f.MsgContent.UUID,f.MsgContent.Second,f.MsgContent.Size,a.From_Account,a.To_Account,f.MsgContent.Download_Flag,l.C2C,f.MsgContent.Url||null):(m=g.TEXT,d=new Gt.Elem.Text("[语音消息]下载地址解析出错"));break;case g.LOCATION:d=new Gt.Elem.Location(f.MsgContent.Longitude,f.MsgContent.Latitude,f.MsgContent.Desc);break;case g.FILE:case g.FILE+" ":m=g.FILE,f.MsgContent?d=new Gt.Elem.File(f.MsgContent.UUID,f.MsgContent.FileName,f.MsgContent.FileSize,a.From_Account,a.To_Account,f.MsgContent.Download_Flag,l.C2C):(m=g.TEXT,d=new Gt.Elem.Text("[文件消息下载地址解析出错]"));break;case g.CUSTOM:m=g.CUSTOM,d=new Gt.Elem.Custom(f.MsgContent.Data,f.MsgContent.Desc,f.MsgContent.Ext);break;default:m=g.TEXT,d=new Gt.Elem.Text("web端暂不支持"+f.MsgType+"消息")}p.elems.push(new Gt.Elem(m,d))}Ft.addMsg(p),o.push(p)}if(Ft.updateTimeline(),t){var _={Complete:n.Complete,MsgCount:o.length,LastMsgTime:n.LastMsgTime,MsgKey:n.MsgKey,MsgList:o};i.isFinished(n.Complete),t(_)}},function(e){re.error("getC2CHistoryMsgs failed:"+e.ErrorInfo),n&&n(e)})}},this.syncGroupMsgs=function(t,n,o){if(t.ReqMsgSeq<=0){if(o){var r=oe.getReturnError("ReqMsgSeq must be greater than 0",-16);o(r)}}else{var i={GroupId:t.GroupId,ReqMsgSeq:t.ReqMsgSeq,ReqMsgNumber:t.ReqMsgNumber};tt(i,function(t){var o=[],r=(t.GroupId,t.RspMsgList),i=t.IsFinished;if(null==r||void 0===r)return void(n&&n([]));for(var s=r.length-1;s>=0;s--){var u=r[s];if(!u.IsPlaceMsg&&u.From_Account&&u.MsgBody&&0!=u.MsgBody.length){var a=ue(u,!0,!0,i);a&&o.push(a)}}o.length>0&&Ft.updateTimeline(),n?n(o):o.length>0&&e&&e(o)},function(e){re.error("getGroupMsgs failed:"+e.ErrorInfo),o&&o(e)})}};var ue=function(e,n,o,r){if(e.IsPlaceMsg||!e.From_Account||!e.MsgBody||0==e.MsgBody.length)return null;var i,s,u,a,c=e.ToGroupId,p=c;e.GroupInfo&&e.GroupInfo.GroupName&&(p=e.GroupInfo.GroupName),u=e.From_Account,e.GroupInfo&&(e.GroupInfo.From_AccountNick&&(u=e.GroupInfo.From_AccountNick),a=e.GroupInfo.From_AccountHeadurl?e.GroupInfo.From_AccountHeadurl:null),e.From_Account==V.identifier?(i=!0,e.From_Account,s=""):(i=!1,e.From_Account,s="");var f=Ft.sessByTypeId(l.GROUP,c);f||(f=new At(l.GROUP,c,p,s,0,0)),void 0!==r&&f.isFinished(r||0);var d=S.COMMON;if(T.GROUP_TIP==e.Event||T.GROUP_TIP2==e.Event){d=S.TIP;var m=e.MsgBody;e.MsgBody=[],e.MsgBody.push({MsgType:g.GROUP_TIP,MsgContent:m})}else e.MsgPriority&&(e.MsgPriority==G.REDPACKET?d=S.REDPACKET:e.MsgPriority==G.LOVEMSG&&(d=S.LOVEMSG));var I=new Gt(f,i,e.MsgSeq,e.MsgRandom,e.MsgTimeStamp,e.From_Account,d,u,a),M=null,E=null,_=null;for(var y in e.MsgBody){switch(M=e.MsgBody[y],_=M.MsgType){case g.TEXT:E=new Gt.Elem.Text(M.MsgContent.Text);break;case g.FACE:E=new Gt.Elem.Face(M.MsgContent.Index,M.MsgContent.Data);break;case g.IMAGE:E=new Gt.Elem.Images(M.MsgContent.UUID,M.MsgContent.ImageFormat||"");for(var h in M.MsgContent.ImageInfoArray)E.addImage(new Gt.Elem.Images.Image(M.MsgContent.ImageInfoArray[h].Type,M.MsgContent.ImageInfoArray[h].Size,M.MsgContent.ImageInfoArray[h].Width,M.MsgContent.ImageInfoArray[h].Height,M.MsgContent.ImageInfoArray[h].URL));break;case g.SOUND:M.MsgContent?E=new Gt.Elem.Sound(M.MsgContent.UUID,M.MsgContent.Second,M.MsgContent.Size,e.From_Account,e.To_Account,M.MsgContent.Download_Flag,l.GROUP,M.MsgContent.Url||null):(_=g.TEXT,E=new Gt.Elem.Text("[语音消息]下载地址解析出错"));break;case g.LOCATION:E=new Gt.Elem.Location(M.MsgContent.Longitude,M.MsgContent.Latitude,M.MsgContent.Desc);break;case g.FILE:case g.FILE+" ":_=g.FILE;me(M.MsgContent.UUID,e.From_Account,M.MsgContent.FileName);M.MsgContent?E=new Gt.Elem.File(M.MsgContent.UUID,M.MsgContent.FileName,M.MsgContent.FileSize,e.From_Account,e.To_Account,M.MsgContent.Download_Flag,l.GROUP):(_=g.TEXT,E=new Gt.Elem.Text("[文件消息]地址解析出错"));break;case g.GROUP_TIP:var C=M.MsgContent.OpType;if(E=new Gt.Elem.GroupTip(C,M.MsgContent.Operator_Account,c,e.GroupInfo.GroupName,M.MsgContent.List_Account,M.MsgContent.MsgMemberExtraInfo),F.JOIN==C||F.QUIT==C)E.setGroupMemberNum(M.MsgContent.MemberNum);else if(F.MODIFY_GROUP_INFO==C){var A=!1,R={GroupId:c,GroupFaceUrl:null,GroupName:null,OwnerAccount:null,GroupNotification:null,GroupIntroduction:null},N=M.MsgContent.MsgGroupNewInfo;if(N.GroupFaceUrl){var v=new Gt.Elem.GroupTip.GroupInfo(O.FACE_URL,N.GroupFaceUrl);E.addGroupInfo(v),A=!0,R.GroupFaceUrl=N.GroupFaceUrl}if(N.GroupName){var P=new Gt.Elem.GroupTip.GroupInfo(O.NAME,N.GroupName);E.addGroupInfo(P),A=!0,R.GroupName=N.GroupName}if(N.Owner_Account){var U=new Gt.Elem.GroupTip.GroupInfo(O.OWNER,N.Owner_Account);E.addGroupInfo(U),A=!0,R.OwnerAccount=N.Owner_Account}if(N.GroupNotification){var b=new Gt.Elem.GroupTip.GroupInfo(O.NOTIFICATION,N.GroupNotification);E.addGroupInfo(b),A=!0,R.GroupNotification=N.GroupNotification}if(N.GroupIntroduction){var L=new Gt.Elem.GroupTip.GroupInfo(O.INTRODUCTION,N.GroupIntroduction);E.addGroupInfo(L),A=!0,R.GroupIntroduction=N.GroupIntroduction}0==n&&A&&t&&t(R)}else if(F.MODIFY_MEMBER_INFO==C){var D=M.MsgContent.MsgMemberInfo;for(var k in D){var w=D[k];E.addMemberInfo(new Gt.Elem.GroupTip.MemberInfo(w.User_Account,w.ShutupTime))}}break;case g.CUSTOM:_=g.CUSTOM,E=new Gt.Elem.Custom(M.MsgContent.Data,M.MsgContent.Desc,M.MsgContent.Ext);break;default:_=g.TEXT,E=new Gt.Elem.Text("web端暂不支持"+M.MsgType+"消息")}I.elems.push(new Gt.Elem(_,E))}return 0==o?I:Ft.addMsg(I,!0)?(I.extraInfo=e.GroupInfo.MsgFrom_AccountExtraInfo,I):null};this.init=function(u,a,l){if(u.onMsgNotify||re.warn("listeners.onMsgNotify is empty"),e=u.onMsgNotify,u.onBigGroupMsgNotify?c=u.onBigGroupMsgNotify:re.warn("listeners.onBigGroupMsgNotify is empty"),u.onC2cEventNotifys?E=u.onC2cEventNotifys:re.warn("listeners.onC2cEventNotifys is empty"),u.onGroupSystemNotifys?n=u.onGroupSystemNotifys:re.warn("listeners.onGroupSystemNotifys is empty"),u.onGroupInfoChangeNotify?t=u.onGroupInfoChangeNotify:re.warn("listeners.onGroupInfoChangeNotify is empty"),u.onFriendSystemNotifys?o=u.onFriendSystemNotifys:re.warn("listeners.onFriendSystemNotifys is empty"),u.onProfileSystemNotifys?r=u.onProfileSystemNotifys:re.warn("listeners.onProfileSystemNotifys is empty"),u.onKickedEventCall?i=u.onKickedEventCall:re.warn("listeners.onKickedEventCall is empty"),u.onLongPullingNotify?onLongPullingNotify=u.onLongPullingNotify:re.warn("listeners.onKickedEventCall is empty"),u.onAppliedDownloadUrl?_=u.onAppliedDownloadUrl:re.warn("listeners.onAppliedDownloadUrl is empty"),V.identifier&&V.userSig)b(function(e){re.info("initMyGroupMaxSeqs success"),P(function(e){if(re.info("initIpAndAuthkey success"),a){re.info("login success(have login state))");var t={ActionStatus:d.OK,ErrorCode:0,ErrorInfo:"login success"};a(t)}Ot.setLongPollingOn(!0),s&&Ot.longPolling(a)},l)},l);else if(a){var p={ActionStatus:d.OK,ErrorCode:0,ErrorInfo:"login success(no login state)"};a(p)}},this.sendMsg=function(e,t,n){Ae(e,function(n){e.sess.type()==l.C2C&&(Ft.addMsg(e),Ft.updateTimeline()),t&&t(n)},function(e){n&&n(e)})}},Rt=new function(){this.fileMd5=null;var e=function(e,t,n){function o(){var t=a*s,n=t+s>=e.size?e.size:t+s,o=i.call(e,t,n);r.readAsArrayBuffer(o)}var r=null;try{r=new FileReader}catch(e){if(n)return void n(oe.getReturnError("当前浏览器不支持FileReader",-18))}var i=File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice;if(!i&&n)return void n(oe.getReturnError("当前浏览器不支持FileAPI",-19));var s=2097152,u=Math.ceil(e.size/s),a=0,c=new SparkMD5;r.onload=function(e){for(var n="",r=new Uint8Array(e.target.result),i=r.byteLength,s=0;s<i;s++)n+=String.fromCharCode(r[s]);c.appendBinary(n),a++,a<u?o():(this.fileMd5=c.end(),t&&t(this.fileMd5))},o()};this.uploadFile=function(t,n,o){var r={init:function(e,t,n){var o=this;o.file=e.file,o.onProgressCallBack=e.onProgressCallBack,e.abortButton&&(e.abortButton.onclick=o.abortHandler),o.total=o.file.size,o.loaded=0,o.step=1105920,o.sliceSize=0,o.sliceOffset=0,o.timestamp=ie(),o.seq=se(),o.random=ue(),o.fromAccount=V.identifier,o.toAccount=e.To_Account,o.fileMd5=e.fileMd5,o.businessType=e.businessType,o.fileType=e.fileType,o.cbOk=t,o.cbErr=n,o.reader=new FileReader,o.blobSlice=File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice,o.reader.onloadstart=o.onLoadStart,o.reader.onprogress=o.onProgress,o.reader.onabort=o.onAbort,o.reader.onerror=o.onerror,o.reader.onload=o.onLoad,o.reader.onloadend=o.onLoadEnd},upload:function(){r.readBlob(0)},onLoadStart:function(){},onProgress:function(e){var t=r;t.loaded+=e.loaded,t.onProgressCallBack&&t.onProgressCallBack(t.loaded,t.total)},onAbort:function(){},onError:function(){},onLoad:function(e){var t=r;if(e.target.readyState==FileReader.DONE){var n=e.target.result,o=n.indexOf(",");-1!=o&&(n=n.substr(o+1));var i={From_Account:t.fromAccount,To_Account:t.toAccount,Busi_Id:t.businessType,File_Type:t.fileType,File_Str_Md5:t.fileMd5,PkgFlag:M.BASE64_DATA,File_Size:t.total,Slice_Offset:t.sliceOffset,Slice_Size:t.sliceSize,Slice_Data:n,Seq:t.seq,Timestamp:t.timestamp,Random:t.random},s=function(e){if(0==e.IsFinish)t.loaded=e.Next_Offset,t.loaded<t.total?t.readBlob(t.loaded):t.loaded=t.total;else if(t.cbOk){var n={ActionStatus:e.ActionStatus,ErrorCode:e.ErrorCode,ErrorInfo:e.ErrorInfo,File_UUID:e.File_UUID,File_Size:e.Next_Offset,URL_INFO:e.URL_INFO,Download_Flag:e.Download_Flag};t.fileType==y.FILE&&(n.URL_INFO=me(e.File_UUID,V.identifier,t.file.name)),t.cbOk(n)}K=0},u=function(e){K<20?(K++,setTimeout(function(){Et(i,s,u)},1e3)):t.cbErr(e)};Et(i,s,u)}},onLoadEnd:function(){},readBlob:function(e){var t,n=r,o=n.file,i=e+n.step;i>n.total?(i=n.total,n.sliceSize=i-e):n.sliceSize=n.step,
n.sliceOffset=e,t=n.blobSlice.call(o,e,i),n.reader.readAsDataURL(t)},abortHandler:function(){var e=r;e.reader&&e.reader.abort()}};e(t.file,function(e){re.info("fileMd5: "+e),t.fileMd5=e,r.init(t,n,o),r.upload()},o)}};t.SESSION_TYPE=l,t.MSG_MAX_LENGTH=f,t.C2C_MSG_SUB_TYPE=C,t.GROUP_MSG_SUB_TYPE=S,t.MSG_ELEMENT_TYPE=g,t.GROUP_TIP_TYPE=F,t.IMAGE_TYPE=m,t.GROUP_SYSTEM_TYPE=R,t.FRIEND_NOTICE_TYPE=N,t.GROUP_TIP_MODIFY_GROUP_INFO_TYPE=O,t.BROWSER_INFO=s,t.Emotions=t.EmotionPicData=ne,t.EmotionDataIndexs=t.EmotionPicDataIndex=te,t.TLS_ERROR_CODE=P,t.CONNECTION_STATUS=U,t.UPLOAD_PIC_BUSSINESS_TYPE=b,t.RECENT_CONTACT_TYPE=p,t.UPLOAD_RES_TYPE=y,t.Tool=oe,t.Log=re,t.Msg=Gt,t.Session=At,t.MsgStore={sessMap:function(){return Ft.sessMap()},sessCount:function(){return Ft.sessCount()},sessByTypeId:function(e,t){return Ft.sessByTypeId(e,t)},delSessByTypeId:function(e,t){return Ft.delSessByTypeId(e,t)},resetCookieAndSyncFlag:function(){return Ft.resetCookieAndSyncFlag()}},t.Resources=ee,t.login=t.init=function(e,t,n,o,r){Ct.init(t.onConnNotify,o,r),_e(e,t,n,o,r)},t.logout=t.offline=function(e,t){return Ce("instance",e,t)},t.logoutAll=function(e,t){return Ce("all",e,t)},t.sendMsg=function(e,t,n){return Ot.sendMsg(e,t,n)},t.syncMsgs=function(e,t){return Ot.syncMsgs(e,t)},t.getC2CHistoryMsgs=function(e,t,n){return Ot.getC2CHistoryMsgs(e,t,n)},t.syncGroupMsgs=function(e,t,n){return Ot.syncGroupMsgs(e,t,n)},t.c2CMsgReaded=function(e,t,n){return Ft.c2CMsgReaded(e,t,n)},t.groupMsgReaded=function(e,t,n){return nt(e,t,n)},t.setAutoRead=function(e,t,n){return Ft.setAutoRead(e,t,n)},t.createGroup=function(e,t,n){return ve(e,t,n)},t.createGroupHigh=function(e,t,n){return Pe(e,t,n)},t.applyJoinGroup=function(e,t,n){return be(e,t,n)},t.handleApplyJoinGroupPendency=function(e,t,n){return De(e,t,n)},t.getPendencyGroup=function(e,t,n){return ke(e,t,n)},t.getPendencyGroupRead=function(e,t,n){return we(e,t,n)},t.handleInviteJoinGroupRequest=function(e,t,n){return qe(e,t,n)},t.deleteApplyJoinGroupPendency=function(e,t,n){return Re(e,t,n)},t.deleteGroupSystemMsgs=function(e,t,n){return e.DelMsgList.forEach(function(e){e.From_Account="@TIM#SYSTEM"}),Re(e,t,n)},t.quitGroup=function(e,t,n){return Be(e,t,n)},t.searchGroupByName=function(e,t,n){return Ke(e,t,n)},t.getGroupPublicInfo=function(e,t,n){return He(e,t,n)},t.getGroupInfo=function(e,t,n){return ze(e,t,n)},t.modifyGroupBaseInfo=function(e,t,n){return Ue(e,t,n)},t.getGroupMemberInfo=function(e,t,n){return Je(e,t,n)},t.addGroupMember=function(e,t,n){return Ve(e,t,n)},t.modifyGroupMember=function(e,t,n){return Ye(e,t,n)},t.deleteGroupMember=function(e,t,n){return Xe(e,t,n)},t.destroyGroup=function(e,t,n){return je(e,t,n)},t.changeGroupOwner=function(e,t,n){return We(e,t,n)},t.getJoinedGroupListHigh=function(e,t,n){return Qe(e,t,n)},t.getRoleInGroup=function(e,t,n){return $e(e,t,n)},t.forbidSendMsg=function(e,t,n){return Ze(e,t,n)},t.sendCustomGroupNotify=function(e,t,n){return et(e,t,n)},t.applyJoinBigGroup=function(e,t,n){return Le(e,t,n)},t.quitBigGroup=function(e,t,n){return xe(e,t,n)},t.getProfilePortrait=function(e,t,n){return ft(e,t,n)},t.setProfilePortrait=function(e,t,n){return dt(e,t,n)},t.applyAddFriend=function(e,t,n){return rt(e,t,n)},t.getPendency=function(e,t,n){return ut(e,t,n)},t.getPendencyReport=function(e,t,n){return at(e,t,n)},t.deletePendency=function(e,t,n){return ct(e,t,n)},t.responseFriend=function(e,t,n){return lt(e,t,n)},t.getAllFriend=function(e,t,n){return pt(e,t,n)},t.deleteChat=function(e,t,n){return st(e,t,n)},t.deleteFriend=function(e,t,n){return it(e,t,n)},t.addBlackList=function(e,t,n){return gt(e,t,n)},t.deleteBlackList=function(e,t,n){return mt(e,t,n)},t.getBlackList=function(e,t,n){return It(e,t,n)},t.getRecentContactList=function(e,t,n){return Mt(e,t,n)},t.uploadFile=t.uploadPic=function(e,t,n){return Rt.uploadFile(e,t,n)},t.submitUploadFileForm=function(e,t,n){return Rt.submitUploadFileForm(e,t,n)},t.uploadFileByBase64=t.uploadPicByBase64=function(e,t,n){var o={To_Account:e.toAccount,Busi_Id:e.businessType,File_Type:e.File_Type,File_Str_Md5:e.fileMd5,PkgFlag:M.BASE64_DATA,File_Size:e.totalSize,Slice_Offset:0,Slice_Size:e.totalSize,Slice_Data:e.base64Str,Seq:se(),Timestamp:ie(),Random:ue()};return Et(o,t,n)},t.getLongPollingId=function(e,t,n){return ht(0,t,n)},t.applyDownload=function(e,t,n){return Tt(e,t,n)},t.checkLogin=function(e,t){return pe(e,t)}}(t),t}();