From 03cf1c16c00082fcf33a142619e0f0d91842f52b Mon Sep 17 00:00:00 2001 From: clock <18209263592@163.com> Date: Fri, 28 Jul 2017 12:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89gitignore=E7=9A=84di?= =?UTF-8?q?st=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 +- build/webpack.prod.js | 6 +- .../dist/{demo-1.4.11.js => demo-1.4.12.js} | 6 +- index.html | 6 +- package.json | 2 +- sdk/dist/websdk-1.4.11.min.js.map | 1 - .../{websdk-1.4.11.js => websdk-1.4.12.js} | 24300 ++++++++-------- ...sdk-1.4.11.min.js => websdk-1.4.12.min.js} | 4 +- sdk/dist/websdk-1.4.12.min.js.map | 1 + sdk/dist/websdk-1.4.8.js | 4512 --- sdk/package.json | 2 +- webpack.config.js | 6 +- .../{webrtc-1.4.11.js => webrtc-1.4.12.js} | 0 13 files changed, 12108 insertions(+), 16746 deletions(-) rename demo/javascript/dist/{demo-1.4.11.js => demo-1.4.12.js} (99%) delete mode 100644 sdk/dist/websdk-1.4.11.min.js.map rename sdk/dist/{websdk-1.4.11.js => websdk-1.4.12.js} (90%) rename sdk/dist/{websdk-1.4.11.min.js => websdk-1.4.12.min.js} (99%) create mode 100644 sdk/dist/websdk-1.4.12.min.js.map delete mode 100644 sdk/dist/websdk-1.4.8.js rename webrtc/dist/{webrtc-1.4.11.js => webrtc-1.4.12.js} (100%) diff --git a/.gitignore b/.gitignore index b2cdc610..0ce2cf01 100755 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ web-im web-im-*.zip image/docker/webim/webim coverage/* -demo/javascript/dist/demo-*.js -sdk/dist/websdk-*.js -sdk/dist/websdk-*.js.map -webrtc/dist/webrtc-*.js +#demo/javascript/dist/demo-*.js +#sdk/dist/websdk-*.js +#sdk/dist/websdk-*.js.map +#webrtc/dist/webrtc-*.js diff --git a/build/webpack.prod.js b/build/webpack.prod.js index 3097bcd2..c9f50404 100755 --- a/build/webpack.prod.js +++ b/build/webpack.prod.js @@ -2,9 +2,9 @@ var webpack = require('webpack'); module.exports = { entry: { - './sdk/dist/websdk-1.4.11': ['./sdk/index'], - './demo/javascript/dist/demo-1.4.11': ['./demo/javascript/src/entry'], - './webrtc/dist/webrtc-1.4.11': ['./webrtc/src/entry'] + './sdk/dist/websdk-1.4.12': ['./sdk/index'], + './demo/javascript/dist/demo-1.4.12': ['./demo/javascript/src/entry'], + './webrtc/dist/webrtc-1.4.12': ['./webrtc/src/entry'] }, output: { path: './', diff --git a/demo/javascript/dist/demo-1.4.11.js b/demo/javascript/dist/demo-1.4.12.js similarity index 99% rename from demo/javascript/dist/demo-1.4.11.js rename to demo/javascript/dist/demo-1.4.12.js index 7457642c..debc4675 100644 --- a/demo/javascript/dist/demo-1.4.11.js +++ b/demo/javascript/dist/demo-1.4.12.js @@ -22119,6 +22119,7 @@ }, onOnline: function onOnline() { // log(WebIM.utils.ts(), 'online'); + console.log('onOnline'); }, onOffline: function onOffline() { if (WebIM.config.isWindowSDK) { @@ -22513,7 +22514,10 @@ Demo.api.NotifySuccess('Fail to Join the group'); break; case 'memberJoinPublicGroupSuccess': - Demo.api.NotifySuccess(msg.mid + '已成功加入' + msg.from); + Demo.api.NotifySuccess(msg.mid + '已成功加入群组' + msg.from); + break; + case 'memberJoinChatRoomSuccess': + Demo.api.NotifySuccess(msg.mid + '已成功加入聊天室' + msg.from); break; case 'joinPublicGroupDeclined': Demo.api.NotifyError(msg.owner + '拒绝了您加入' + msg.gid + '的请求'); diff --git a/index.html b/index.html index c1cadd6a..b625ffe0 100755 --- a/index.html +++ b/index.html @@ -28,18 +28,18 @@ } - + - + diff --git a/package.json b/package.json index 73645035..c08f3c30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webim", - "version": "1.4.11", + "version": "1.4.12", "description": "", "main": "index.js", "devDependencies": { diff --git a/sdk/dist/websdk-1.4.11.min.js.map b/sdk/dist/websdk-1.4.11.min.js.map deleted file mode 100644 index e363e976..00000000 --- a/sdk/dist/websdk-1.4.11.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["websdk-1.4.11.js"],"names":["_typeof","Symbol","iterator","obj","constructor","prototype","root","factory","exports","module","define","amd","undefined","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_parsePrivacy","iq","list","items","getElementsByTagName","i","length","item","jid","getAttribute","order","type","n","_parseNameFromJidFn","name","_parseGroupBlacklist","affiliation","nick","_setText","valueDom","v","textContent","text","logMessage","message","data","indexOf","start","end","substring","stropheConn","setJid","WebIM","config","isDebug","console","log","utils","ts","_version","_code","code","_utils","_msg","_message","_msgHash","Queue","CryptoJS","_","window","URL","webkitURL","mozURL","msURL","XDomainRequest","Strophe","Request","_newXHR","xhr","xmlrequest","overrideMimeType","onreadystatechange","this","func","bind","Websocket","_closeSocket","socket","me","setTimeout","close","e","_onMessage","elem","DOMParser","parseFromString","documentElement","see_uri","_conn","_changeConnectStatus","Status","REDIRECT","reset","service","_connect","_doDisconnect","search","_handleStreamStart","_streamWrap","_check_streamerror","ERROR","disconnecting","firstChild","nodeName","xmlInput","rawInput","serialize","_dataRecv","_listenNetwork","onlineCallback","offlineCallback","addEventListener","attachEvent","document","body","_parseRoom","result","rooms","roomJid","tmp","split","room","roomId","push","_parseRoomOccupants","occupants","_parseResponseMessage","msginfo","parseMsgData","errorMsg","msgBodies","msgBody","childNodes","childNode","nodeType","ElementType","TEXT","jsondata","wholeText","nodeValue","replace","eval","delayTags","delayTag","delayMsgTime","delayTimeStamp","childrens","child","domain","tempstr","findex","atindex","_parseFriend","queryTag","conn","from","rouster","subscription","friend","ask","groups","forEachChild","group","getText","subscribe","toJid","subscribed","_login","options","accessToken","access_token","stringify","onError","WEBIM_CONNCTION_OPEN_USERGRID_ERROR","context","accessTokenExpires","expires_in","isOpening","isOpened","getStrophe","callback","status","msg","_loginCallback","route","connect","wait","hold","_parseMessageType","receiveinfo","inviteinfo","deliveryinfo","acked","error","msgtype","namespaceURI","errorItem","userMuted","_handleMessageQueue","hasOwnProperty","send","conflict","CONNFAIL","WEBIM_CONNCTION_SERVER_CLOSE_ERROR","reconnect","ATTACHED","CONNECTED","autoReconnectNumTotal","intervalId","setInterval","handelSendQueue","handleMessage","delivery","handleDeliveredMessage","handleAckedMessage","handleReceivedMessage","handleInviteMessage","handleMutedMessage","handlePresence","handlePing","handleIqRoster","handleIqPrivacy","handleIq","addHandler","registerConfrIQHandler","STATUS_OPENED","supportRecMessage","WEBIM_MESSAGE_REC_TEXT","WEBIM_MESSAGE_REC_EMOJI","isCanDownLoadFile","WEBIM_MESSAGE_REC_PHOTO","WEBIM_MESSAGE_REC_AUDIO_FILE","supportSedMessage","WEBIM_MESSAGE_SED_TEXT","isCanUploadFile","notifyVersion","retry","heartBeat","isAutoLogin","setPresence","unSendMsgArr","dom","sendCommand","offLineSendConnecting","logOut","onOpened","canReceive","canSend","DISCONNECTING","stopHeartBeat","STATUS_CLOSING","DISCONNECTED","autoReconnectNumMax","WEBIM_CONNCTION_DISCONNECTED","STATUS_CLOSED","clear","onClosed","AUTHFAIL","WEBIM_CONNCTION_AUTH_ERROR","STATUS_ERROR","WEBIM_CONNCTION_SERVER_ERROR","status_now","_getJid","appKey","to","resource","_getJidByName","_validCheck","user","WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR","devInfos","WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR","orgName","appName","toLowerCase","isMultiLoginSessions","Date","getTime","Math","floor","random","toFixed","userId","_getXmppUrl","baseUrl","https","test","url","prefix","base","suffix","isSupportWss","WebSocket","connection","isHttpDNS","location","protocol","inactivity","heartBeatWait","maxRetries","pollingTime","autoReconnectInterval","STATUS_INIT","sendQueue","apiUrl","isWindowSDK","encrypt","token","dnsArr","dnsIndex","dnsTotal","restHosts","restIndex","restTotal","xmppHosts","xmppIndex","xmppTotal","groupOption","testInit","registerUser","getHttpDNS","signup","pop","sendReceiptsMessage","listen","emptyfn","onTextMessage","onEmojiMessage","onPictureMessage","onAudioMessage","onVideoMessage","onFileMessage","onLocationMessage","onCmdMessage","onPresence","onRoster","onReceivedMessage","onInviteMessage","onDeliverdMessage","onDeliveredMessage","onReadMessage","onMutedMessage","onOffline","onOnline","onConfirmPop","onCreateGroup","onUpdateMyGroupList","onUpdateMyRoster","onBlacklistUpdate","forcing","isNeed","navigator","userAgent","heartBeatID","ping","clearInterval","$msg","xmlns","tree","cacheReceiptsMessage","host","getXmlFirstChild","ip","port","parter","Connection","getHostsByTag","tagName","tag","hosts","getRestFromHttpDNS","login","self","suc","res","options2","dataType","app_key","encodeURIComponent","success","ajax","EMPTYFN","err","restUrl","userjson","username","password","nickname","userinfo","open","appkey","xmppURL","restTokenData","pwd","STATUS_DOLOGIN_IM","error_description","WEBIM_CONNCTION_OPEN_ERROR","STATUS_DOLOGIN_USERGRID","loginJson","grant_type","timestamp","loginfo","attach","WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR","sid","WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR","rid","WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR","wind","reason","isClosed","isClosing","disconnect","handler","ns","fail","getJid","$iq","t","up","failFn","ele","WEBIM_CONNCTION_NOTIFYVERSION_ERROR","sendIQ","presence_type","fromUser","toUser","isCreate","isMemberJoin","isDecline","isApply","info","fromJid","chatroom","showTags","showTag","show","statusTags","statusTag","priorityTags","priorityTag","priority","destroy","members","member","role","kickedMember","actor","actorNick","kicked","x","apply","accept","decline","addAdmin","removeAdmin","addMute","removeMute","toNick","groupJid","gid","mid","roomtype","owner","original_type","slice","lastIndexOf","getBlacklist","curJid","iqresult","errorCode","errorText","errorBool","textDOM","msgDatas","too","extmsg","ext","chattype","typeEl","bodies","receiveMsg","atob","key","enc","Utf8","parse","iv","mode","option","CBC","padding","pad","Pkcs7","ECB","encryptedBase64Str","decryptedData","AES","decrypt","decryptedStr","toString","emojibody","parseTextMessage","Emoji","isemoji","delay","rwidth","rheight","size","width","height","substr","secret","filename","thumb","thumb_secret","file_length","filetype","addr","lat","lng","action","msgId","getUniqueId","bodyId","deliverMessage","set","WEBIM_CONNCTION_CALLBACK_INNER_ERROR","isNaN","innerHTML","received","rcv","innerText","Function","form","invitemsg","reasonDom","reasonMsg","xmsg","roomid","roomjid","autoIncrement","cdate","offdate","offset","hexd","parseFloat","messageSource","clone","btoa","encryptedData","doQuery","encodeURI","chatType","response","WEBIM_MESSAGE_SED_ERROR","Object","addRoster","removeRoster","getRoster","completeFn","WEBIM_CONNCTION_GETROSTER_ERROR","pres","$pres","unsubscribe","unsubscribed","joinPublicGroup","room_nick","errorFn","WEBIM_CONNCTION_JOINROOM_ERROR","NS","MUC","listRooms","server","DISCO_ITEMS","WEBIM_CONNCTION_GETROOM_ERROR","queryRoomMember","mem","WEBIM_CONNCTION_GETROOMMEMBER_ERROR","queryRoomInfo","DISCO_INFO","settings","features","fields","fieldValues","field","fieldVar","fieldSimplify","WEBIM_CONNCTION_GETROOMINFO_ERROR","queryRoomOccupants","WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR","attrs","setUserSig","desc","getPresence","WEBIM_CONNCTION_PING_ERROR","errorType","WEBIM_CONNCTION_CLIENT_LOGOUT","getChatRooms","isCanSetRequestHeader","WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR","WEBIM_CONNCTION_LOAD_CHATROOM_ERROR","pageInfo","pagenum","parseInt","pagesize","opts","headers","Authorization","joinChatRoom","WEBIM_CONNCTION_JOINCHATROOM_ERROR","quitChatRoom","WEBIM_CONNCTION_QUITCHATROOM_ERROR","_onReceiveInviteFromGroup","title","group_id","agree","WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP","reject","WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP","_onReceiveInviteAcceptionFromGroup","_onReceiveInviteDeclineFromGroup","_onAutoAcceptInvitationFromGroup","group_name","_onLeaveGroup","_onReceiveJoinGroupApplication","WEBIM_CONNECTION_ACCEPT_JOIN_GROUP","WEBIM_CONNECTION_DECLINE_JOIN_GROUP","_onReceiveAcceptionFromGroup","_onReceiveRejectionFromGroup","_onUpdateMyGroupList","_onUpdateMyRoster","that","closed","WEBIM_CONNECTION_CLOSED","sucFn","errFn","addToBlackList","blacklist","piece","keys","len","value","removeFromBlackList","_getGroupJid","addToGroupBlackList","getGroupBlacklist","removeGroupMemberFromBlacklist","changeGroupSubject","var","subject","description","destroyGroup","leaveGroupBySelf","msgInfo","errInfo","leaveGroup","addGroupMembers","acceptInviteFromGroup","rejectInviteFromGroup","createGroupAsync","toRoom","setAttribute","optionsMaxUsers","optionsPublic","optionsMembersOnly","optionsModerate","optionsAllowInvites","cnode","createGroup","createGroupNew","opt","JSON","Content-Type","respData","blockGroup","groupId","entities","joinGroup","listGroups","requestData","limit","cursor","getGroupInfo","getGroup","listGroupMember","pageNum","pageSize","mute","usernames","mute_duration","muteDuration","getGroupAdmin","getMuted","setAdmin","newadmin","agreeJoinGroup","applicant","verifyResult","rejectJoinGroup","groupBlockSingle","groupBlockMulti","removeGroupBlockSingle","removeGroupBlockMulti","join","dissolveGroup","getGroupBlacklistNew","quitGroup","modifyGroup","groupname","groupName","removeSingleGroupMember","removeMultiGroupMember","users","inviteToGroup","statusCode","str","cefQuery","request","persistent","onSuccess","onFailure","rawOutput","isSandBox","apiURL","WEBIM_CONNCTION_ATTACH_ERROR","WEBIM_CONNCTION_ATTACH_USERGRID_ERROR","WEBIM_CONNCTION_REOPEN_ERROR","WEBIM_CONNCTION_IQ_ERROR","WEBIM_CONNCTION_CROSSDOMAIN_ERROR","WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES","WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR","WEBIM_CONNCTION_AJAX_ERROR","WEBIM_CONNCTION_CLIENT_OFFLINE","WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR","WEBIM_UPLOADFILE_BROWSER_ERROR","WEBIM_UPLOADFILE_ERROR","WEBIM_UPLOADFILE_NO_LOGIN","WEBIM_UPLOADFILE_NO_FILE","WEBIM_DOWNLOADFILE_ERROR","WEBIM_DOWNLOADFILE_NO_LOGIN","WEBIM_DOWNLOADFILE_BROWSER_ERROR","WEBIM_MESSAGE_REC_TEXT_ERROR","WEBIM_MESSAGE_REC_EMOTION","WEBIM_MESSAGE_REC_AUDIO","WEBIM_MESSAGE_REC_VEDIO","WEBIM_MESSAGE_REC_VEDIO_FILE","WEBIM_MESSAGE_REC_FILE","WEBIM_MESSAGE_SED_EMOTION","WEBIM_MESSAGE_SED_PHOTO","WEBIM_MESSAGE_SED_AUDIO","WEBIM_MESSAGE_SED_AUDIO_FILE","WEBIM_MESSAGE_SED_VEDIO","WEBIM_MESSAGE_SED_VEDIO_FILE","WEBIM_MESSAGE_SED_FILE","_createStandardXHR","XMLHttpRequest","_createActiveXHR","ActiveXObject","_xmlrequest","crossDomain","temp","readyState","onload","xmlDoc","async","loadXML","responseText","responseXML","ontimeout","onerror","_hasFlash","ex","plugins","_tmpUtilXHR","_hasFormData","FormData","_hasBlob","Blob","_isCanSetRequestHeader","setRequestHeader","_hasOverrideMimeType","_isCanUploadFileAsync","_isCanUploadFile","_isCanDownLoadFile","hasDontEnumBug","propertyIsEnumerable","dontEnums","dontEnumsLength","TypeError","prop","hasFormData","hasBlob","hasOverrideMimeType","isCanUploadFileAsync","notSupportList","ua","l","getIEVersion","matches","tridentMap","4","5","6","7","match","json","s","arr","iterate","isArr","o","getFileUrl","fileInputId","uri","fileObj","getElementById","createObjectURL","fileItems","files","u","pos1","pos2","pos","max","index","getFileSize","file","fileSize","getFileLength","kb","round","mb","gb","fileLength","select","fileobject","GetFile","Size","hasFlash","trim","parseEmoji","map","emoji","face","path","parseLink","reg","parseJSON","requireNonComma","depth","comma","parseUploadResponse","parseDownloadResponse","uploadFile","onFileUploadProgress","onFileUploadComplete","onFileUploadError","onFileUploadCanceled","acc","uploadUrl","flashUpload","upload","abort","formData","append","download","onFileDownloadComplete","onFileDownloadError","method","resType","responseType","mimeType","innerHeaer","X-Requested-With","Accept","share-secret","faces","emessage","expr","tmsg","existEmoji","emojiStr","restMsgIndex","parseUri","pattern","args","eq","parseHrefHash","hash","children","tempData","d","Hours","getHours","Minutes","getMinutes","Seconds","getSeconds","Milliseconds","getMilliseconds","getObjectKey","val","sprintf","arg","arguments","setCookie","days","cookie","getCookie","allCookie","all","decodeURIComponent","Message","setGroup","read","ackId","txt","roomType","cmd","img","uploadError","uploadComplete","audio","video","_Message","_send","weichat","originType","jsonstr","_tmpComplete","_complete","file_len","thumbnail","undef","create","F","subtype","C","C_lib","lib","Base","extend","overrides","mixIn","init","$super","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","concat","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","thatByte","ceil","nBytes","rcache","_r","m_w","m_z","mask","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","String","fromCharCode","latin1Str","latin1StrLength","charCodeAt","escape","Error","utf8Str","unescape","BufferedBlockAlgorithm","_data","_nDataBytes","_append","_process","doFlush","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","_minBufferSize","nWordsReady","nBytesReady","min","_doProcessBlock","processedWords","splice","C_algo","Hasher","cfg","_doReset","update","messageUpdate","finalize","_doFinalize","_createHelper","hasher","_createHmacHelper","HMAC","algo","X32WordArray","C_x64","x64","Word","high","low","toX32","x64Words","x64WordsLength","x32Words","x64Word","wordsLength","ArrayBuffer","superInit","typedArray","Uint8Array","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","buffer","byteOffset","byteLength","typedArrayByteLength","swapEndian","word","Utf16","Utf16BE","utf16Chars","codePoint","utf16Str","utf16StrLength","Utf16LE","parseLoop","base64Str","base64StrLength","reverseMap","bits1","bits2","Base64","_map","base64Chars","byte1","byte2","byte3","triplet","j","charAt","paddingChar","_reverseMap","paddingIndex","FF","a","b","GG","HH","II","T","abs","sin","MD5","_hash","M","offset_i","M_offset_i","H","M_offset_0","M_offset_1","M_offset_2","M_offset_3","M_offset_4","M_offset_5","M_offset_6","M_offset_7","M_offset_8","M_offset_9","M_offset_10","M_offset_11","M_offset_12","M_offset_13","M_offset_14","M_offset_15","nBitsTotal","nBitsLeft","nBitsTotalH","nBitsTotalL","H_i","HmacMD5","W","SHA1","HmacSHA1","K","getFractionalBits","nPrime","sqrtN","sqrt","factor","pow","SHA256","f","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","HmacSHA256","SHA224","HmacSHA224","X64Word_create","X64Word","X64WordArray","SHA512","H0","H1","H2","H3","H4","H5","H6","H7","H0h","H0l","H1h","H1l","H2h","H2l","H3h","H3l","H4h","H4l","H5h","H5l","H6h","H6l","H7h","H7l","ah","al","bh","bl","cl","dh","dl","eh","el","fh","fl","gh","gl","hh","hl","Wi","Wih","Wil","gamma0xh","gamma0xl","gamma0h","gamma0l","gamma1xh","gamma1xl","gamma1h","gamma1l","Wi7","Wi7h","Wi7l","Wi16","Wi16h","Wi16l","chh","chl","majh","majl","sigma0h","sigma0l","sigma1h","sigma1l","Ki","Kih","Kil","t1l","t1h","t2l","t2h","HmacSHA512","SHA384","HmacSHA384","RHO_OFFSETS","PI_INDEXES","ROUND_CONSTANTS","y","newX","newY","LFSR","roundConstantMsw","roundConstantLsw","bitPosition","SHA3","outputLength","state","_state","nBlockSizeLanes","M2i","M2i1","lane","tMsw","tLsw","Tx","Tx4","Tx1","Tx1Msw","Tx1Lsw","laneIndex","laneMsw","laneLsw","rhoOffset","TPiLane","T0","state0","TLane","Tx1Lane","Tx2Lane","roundConstant","blockSizeBits","outputLengthBytes","outputLengthLanes","hashWords","HmacSHA3","f1","z","f2","f3","f4","f5","rotl","_zl","_zr","_sl","_sr","_hl","_hr","RIPEMD160","ar","br","cr","dr","er","hr","zl","zr","sl","sr","HmacRIPEMD160","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","PBKDF2","keySize","iterations","compute","salt","hmac","derivedKey","blockIndex","derivedKeyWords","blockIndexWords","block","blockWords","blockWordsLength","intermediate","intermediateWords","EvpKDF","Cipher","createEncryptor","_ENC_XFORM_MODE","createDecryptor","_DEC_XFORM_MODE","xformMode","_xformMode","_key","process","dataUpdate","ivSize","selectCipherStrategy","PasswordBasedCipher","SerializableCipher","cipher","ciphertext","C_mode","StreamCipher","BlockCipherMode","Encryptor","Decryptor","_cipher","_iv","xorBlock","_prevBlock","processBlock","encryptBlock","thisBlock","decryptBlock","C_pad","nPaddingBytes","paddingWord","paddingWords","unpad","CipherParams","BlockCipher","modeCreator","_mode","__creator","finalProcessedBlocks","cipherParams","formatter","C_format","format","OpenSSLFormatter","OpenSSL","openSSLStr","ciphertextWords","encryptor","cipherCfg","algorithm","_parse","C_kdf","kdf","OpenSSLKdf","execute","derivedParams","CFB","generateKeystreamAndEncrypt","keystream","CTR","counter","_counter","CTRGladman","incWord","b1","b2","b3","incCounter","OFB","_keystream","AnsiX923","lastBytePos","Ansix923","Iso10126","Iso97971","ZeroPadding","NoPadding","input","SBOX","INV_SBOX","SUB_MIX_0","SUB_MIX_1","SUB_MIX_2","SUB_MIX_3","INV_SUB_MIX_0","INV_SUB_MIX_1","INV_SUB_MIX_2","INV_SUB_MIX_3","xi","sx","x2","x4","x8","RCON","_nRounds","_keyPriorReset","keyWords","nRounds","ksRows","keySchedule","_keySchedule","ksRow","invKeySchedule","_invKeySchedule","invKsRow","_doCryptBlock","s0","s1","s2","s3","t0","t3","exchangeLR","_lBlock","_rBlock","exchangeRL","PC1","PC2","BIT_SHIFTS","SBOX_P","0","268435456","536870912","805306368","1073741824","1342177280","1610612736","1879048192","2147483648","2415919104","2684354560","2952790016","3221225472","3489660928","3758096384","4026531840","134217728","402653184","671088640","939524096","1207959552","1476395008","1744830464","2013265920","2281701376","2550136832","2818572288","3087007744","3355443200","3623878656","3892314112","4160749568","1","268435457","536870913","805306369","1073741825","1342177281","1610612737","1879048193","2147483649","2415919105","2684354561","2952790017","3221225473","3489660929","3758096385","4026531841","134217729","402653185","671088641","939524097","1207959553","1476395009","1744830465","2013265921","2281701377","2550136833","2818572289","3087007745","3355443201","3623878657","3892314113","4160749569","16777216","33554432","50331648","67108864","83886080","100663296","117440512","150994944","167772160","184549376","201326592","218103808","234881024","251658240","8388608","25165824","41943040","58720256","75497472","92274688","109051904","125829120","142606336","159383552","176160768","192937984","209715200","226492416","243269632","260046848","285212672","301989888","318767104","335544320","352321536","369098752","385875968","419430400","436207616","452984832","469762048","486539264","503316480","520093696","276824064","293601280","310378496","327155712","343932928","360710144","377487360","394264576","411041792","427819008","444596224","461373440","478150656","494927872","511705088","528482304","1048576","2097152","3145728","4194304","5242880","6291456","7340032","9437184","10485760","11534336","12582912","13631488","14680064","15728640","524288","1572864","2621440","3670016","4718592","5767168","6815744","7864320","8912896","9961472","11010048","12058624","13107200","14155776","15204352","16252928","17825792","18874368","19922944","20971520","22020096","23068672","24117248","26214400","27262976","28311552","29360128","30408704","31457280","32505856","17301504","18350080","19398656","20447232","21495808","22544384","23592960","24641536","25690112","26738688","27787264","28835840","29884416","30932992","31981568","33030144","65536","131072","196608","262144","327680","393216","458752","589824","655360","720896","786432","851968","917504","983040","32768","98304","163840","229376","294912","360448","425984","491520","557056","622592","688128","753664","819200","884736","950272","1015808","1114112","1179648","1245184","1310720","1376256","1441792","1507328","1638400","1703936","1769472","1835008","1900544","1966080","2031616","1081344","1146880","1212416","1277952","1343488","1409024","1474560","1540096","1605632","1671168","1736704","1802240","1867776","1933312","1998848","2064384","4096","8192","12288","16384","20480","24576","28672","36864","40960","45056","49152","53248","57344","61440","2048","6144","10240","14336","18432","22528","26624","30720","34816","38912","43008","47104","51200","55296","59392","63488","69632","73728","77824","81920","86016","90112","94208","102400","106496","110592","114688","118784","122880","126976","67584","71680","75776","79872","83968","88064","92160","96256","100352","104448","108544","112640","116736","120832","124928","129024","256","512","768","1024","1280","1536","1792","2304","2560","2816","3072","3328","3584","3840","128","384","640","896","1152","1408","1664","1920","2176","2432","2688","2944","3200","3456","3712","3968","4352","4608","4864","5120","5376","5632","5888","6400","6656","6912","7168","7424","7680","7936","4224","4480","4736","4992","5248","5504","5760","6016","6272","6528","6784","7040","7296","7552","7808","8064","16","32","48","64","80","96","112","144","160","176","192","208","224","240","8","24","40","56","72","88","104","120","136","152","168","184","200","216","232","248","272","288","304","320","336","352","368","400","416","432","448","464","480","496","264","280","296","312","328","344","360","376","392","408","424","440","456","472","488","504","2","3","9","10","11","12","13","14","15","2147483650","2147483651","2147483652","2147483653","2147483654","2147483655","2147483656","2147483657","2147483658","2147483659","2147483660","2147483661","2147483662","2147483663","17","18","19","20","21","22","23","25","26","27","28","29","30","31","2147483664","2147483665","2147483666","2147483667","2147483668","2147483669","2147483670","2147483671","2147483672","2147483673","2147483674","2147483675","2147483676","2147483677","2147483678","2147483679","SBOX_MASK","DES","keyBits","keyBitPos","subKeys","_subKeys","nSubKey","subKey","bitShift","invSubKeys","_invSubKeys","lBlock","rBlock","TripleDES","_des1","_des2","_des3","generateKeystreamWord","S","_S","_i","_j","keystreamWord","RC4","keySigBytes","keyByteIndex","keyByte","RC4Drop","drop","nextState","X","_X","_C","C_","_b","gx","ga","G","Rabbit","IV","IV_0","IV_1","i0","i2","i1","i3","RabbitLegacy","Array_h","array","Array","at","remove","count","separator","_array_h","_index","ret","head","tail","empty","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","createReduce","dir","iteratee","memo","currentKey","optimizeCb","isArrayLike","createPredicateIndexFinder","predicate","cb","getLength","createIndexFinder","predicateFind","sortedIndex","idx","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","proto","isFunction","ObjProto","has","contains","previousUnderscore","ArrayProto","FuncProto","nativeIsArray","isArray","nativeKeys","nativeBind","nativeCreate","Ctor","_wrapped","VERSION","argCount","other","collection","accumulator","identity","isObject","matcher","property","Infinity","createAssigner","keysFunc","undefinedOnly","source","baseCreate","MAX_ARRAY_INDEX","each","forEach","collect","results","reduce","foldl","inject","reduceRight","foldr","find","detect","findIndex","findKey","filter","negate","every","some","any","includes","include","fromIndex","guard","values","invoke","isFunc","pluck","where","findWhere","computed","lastComputed","shuffle","rand","shuffled","sample","sortBy","criteria","sort","left","right","behavior","groupBy","indexBy","countBy","toArray","partition","pass","first","take","initial","last","rest","compact","flatten","shallow","strict","startIndex","output","isArguments","without","difference","uniq","unique","isSorted","isBoolean","seen","union","intersection","argsLength","zip","unzip","object","findLastIndex","range","stop","step","executeBound","sourceFunc","boundFunc","callingContext","bound","partial","boundArgs","position","bindAll","memoize","cache","address","defer","throttle","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","callNow","wrap","wrapper","compose","after","times","before","once","hasEnumBug","allKeys","mapObject","pairs","invert","functions","methods","names","extendOwn","assign","pick","oiteratee","omit","defaults","props","tap","interceptor","isMatch","aStack","bStack","className","areArrays","aCtor","bCtor","isEqual","isEmpty","isString","isElement","isFinite","isNumber","isNull","isUndefined","noConflict","constant","noop","propertyOf","accum","escapeMap","&","<",">","\"","'","`","unescapeMap","createEscaper","escaper","testRegexp","RegExp","replaceRegexp","string","fallback","idCounter","uniqueId","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","
","
","escapeChar","template","oldSettings","variable","render","chain","_chain","mixin","valueOf","toJSON"],"mappings":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,KAEtQ,SAA2CG,EAAMC,GAC0B,YAAlD,mBAAZC,SAA0B,YAAcR,QAAQQ,WAA8F,YAAjD,mBAAXC,QAAyB,YAAcT,QA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c,EAASi7D,MAA+Eh7D,EAAOD,QAAUk7D,KAEhHv6D,KAAKkE","file":"websdk-1.4.11.min.js","sourcesContent":["'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && (typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') exports[\"WebIM\"] = factory();else root[\"WebIM\"] = factory();\n})(undefined, function () {\n\treturn (/******/function (modules) {\n\t\t\t// webpackBootstrap\n\t\t\t/******/ // The module cache\n\t\t\t/******/var installedModules = {};\n\n\t\t\t/******/ // The require function\n\t\t\t/******/function __webpack_require__(moduleId) {\n\n\t\t\t\t/******/ // Check if module is in cache\n\t\t\t\t/******/if (installedModules[moduleId])\n\t\t\t\t\t/******/return installedModules[moduleId].exports;\n\n\t\t\t\t/******/ // Create a new module (and put it into the cache)\n\t\t\t\t/******/var module = installedModules[moduleId] = {\n\t\t\t\t\t/******/exports: {},\n\t\t\t\t\t/******/id: moduleId,\n\t\t\t\t\t/******/loaded: false\n\t\t\t\t\t/******/ };\n\n\t\t\t\t/******/ // Execute the module function\n\t\t\t\t/******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t\t\t\t/******/ // Flag the module as loaded\n\t\t\t\t/******/module.loaded = true;\n\n\t\t\t\t/******/ // Return the exports of the module\n\t\t\t\t/******/return module.exports;\n\t\t\t\t/******/\n\t\t\t}\n\n\t\t\t/******/ // expose the modules object (__webpack_modules__)\n\t\t\t/******/__webpack_require__.m = modules;\n\n\t\t\t/******/ // expose the module cache\n\t\t\t/******/__webpack_require__.c = installedModules;\n\n\t\t\t/******/ // __webpack_public_path__\n\t\t\t/******/__webpack_require__.p = \"\";\n\n\t\t\t/******/ // Load entry module and return exports\n\t\t\t/******/return __webpack_require__(0);\n\t\t\t/******/\n\t\t}(\n\t\t/************************************************************************/\n\t\t/******/[\n\t\t/* 0 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tmodule.exports = __webpack_require__(1\n\n\t\t\t/***/);\n\t\t},\n\t\t/* 1 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar _version = '1.4.2';\n\t\t\tvar _code = __webpack_require__(2).code;\n\t\t\tvar _utils = __webpack_require__(3).utils;\n\t\t\tvar _msg = __webpack_require__(4);\n\t\t\tvar _message = _msg._msg;\n\t\t\tvar _msgHash = {};\n\t\t\tvar Queue = __webpack_require__(39).Queue;\n\t\t\tvar CryptoJS = __webpack_require__(5);\n\t\t\tvar _ = __webpack_require__(40);\n\t\t\tvar stropheConn = null;\n\n\t\t\twindow.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n\t\t\tif (window.XDomainRequest) {\n\t\t\t\t// not support ie8 send is not a function , canot \n\t\t\t\t// case send is object, doesn't has a attr of call\n\t\t\t\t// XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send;\n\t\t\t\t// XDomainRequest.prototype.send = function () {\n\t\t\t\t// XDomainRequest.prototype.oldsend.call(this, arguments);\n\t\t\t\t// this.readyState = 2;\n\t\t\t\t// };\n\t\t\t}\n\n\t\t\tStrophe.Request.prototype._newXHR = function () {\n\t\t\t\tvar xhr = _utils.xmlrequest(true);\n\t\t\t\tif (xhr.overrideMimeType) {\n\t\t\t\t\txhr.overrideMimeType('text/xml');\n\t\t\t\t}\n\t\t\t\t// use Function.bind() to prepend ourselves as an argument\n\t\t\t\txhr.onreadystatechange = this.func.bind(null, this);\n\t\t\t\treturn xhr;\n\t\t\t};\n\n\t\t\tStrophe.Websocket.prototype._closeSocket = function () {\n\t\t\t\tif (this.socket) {\n\t\t\t\t\tvar me = this;\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tme.socket.close();\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}, 0);\n\t\t\t\t} else {\n\t\t\t\t\tthis.socket = null;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n *\n * Strophe.Websocket has a bug while logout:\n * 1.send: is ok;\n * 2.send: will cause a problem,log as follows:\n * WebSocket connection to 'ws://im-api.easemob.com/ws/' failed: Data frame received after close_connect @ strophe.js:5292connect @ strophe.js:2491_login @ websdk-1.1.2.js:278suc @ websdk-1.1.2.js:636xhr.onreadystatechange @ websdk-1.1.2.js:2582\n * 3 \"Websocket error [object Event]\"\n * _changeConnectStatus\n * onError Object {type: 7, msg: \"The WebSocket connection could not be established or was disconnected.\", reconnect: true}\n *\n * this will trigger socket.onError, therefore _doDisconnect again.\n * Fix it by overide _onMessage\n */\n\t\t\tStrophe.Websocket.prototype._onMessage = function (message) {\n\t\t\t\tlogMessage(message);\n\t\t\t\tvar elem, data;\n\t\t\t\t// check for closing stream\n\t\t\t\t// var close = '';\n\t\t\t\t// if (message.data === close) {\n\t\t\t\t// this._conn.rawInput(close);\n\t\t\t\t// this._conn.xmlInput(message);\n\t\t\t\t// if (!this._conn.disconnecting) {\n\t\t\t\t// this._conn._doDisconnect();\n\t\t\t\t// }\n\t\t\t\t// return;\n\t\t\t\t//\n\t\t\t\t// send and receive close xml: \n\t\t\t\t// so we can't judge whether message.data equals close by === simply.\n\t\t\t\tif (message.data.indexOf(\" from server\");\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} else if (message.data.search(\" tag before we close the connection\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._conn._dataRecv(elem, message.data);\n\t\t\t};\n\n\t\t\tvar _listenNetwork = function _listenNetwork(onlineCallback, offlineCallback) {\n\n\t\t\t\tif (window.addEventListener) {\n\t\t\t\t\twindow.addEventListener('online', onlineCallback);\n\t\t\t\t\twindow.addEventListener('offline', offlineCallback);\n\t\t\t\t} else if (window.attachEvent) {\n\t\t\t\t\tif (document.body) {\n\t\t\t\t\t\tdocument.body.attachEvent('ononline', onlineCallback);\n\t\t\t\t\t\tdocument.body.attachEvent('onoffline', offlineCallback);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.attachEvent('load', function () {\n\t\t\t\t\t\t\tdocument.body.attachEvent('ononline', onlineCallback);\n\t\t\t\t\t\t\tdocument.body.attachEvent('onoffline', offlineCallback);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/*var onlineTmp = window.ononline;\n var offlineTmp = window.onoffline;\n window.attachEvent('ononline', function () {\n try {\n typeof onlineTmp === 'function' && onlineTmp();\n } catch ( e ) {}\n onlineCallback();\n });\n window.attachEvent('onoffline', function () {\n try {\n typeof offlineTmp === 'function' && offlineTmp();\n } catch ( e ) {}\n offlineCallback();\n });*/\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _parseRoom = function _parseRoom(result) {\n\t\t\t\tvar rooms = [];\n\t\t\t\tvar items = result.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar roomJid = item.getAttribute('jid');\n\t\t\t\t\t\tvar tmp = roomJid.split('@')[0];\n\t\t\t\t\t\tvar room = {\n\t\t\t\t\t\t\tjid: roomJid,\n\t\t\t\t\t\t\tname: item.getAttribute('name'),\n\t\t\t\t\t\t\troomId: tmp.split('_')[1]\n\t\t\t\t\t\t};\n\t\t\t\t\t\trooms.push(room);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rooms;\n\t\t\t};\n\n\t\t\tvar _parseRoomOccupants = function _parseRoomOccupants(result) {\n\t\t\t\tvar occupants = [];\n\t\t\t\tvar items = result.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar room = {\n\t\t\t\t\t\t\tjid: item.getAttribute('jid'),\n\t\t\t\t\t\t\tname: item.getAttribute('name')\n\t\t\t\t\t\t};\n\t\t\t\t\t\toccupants.push(room);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn occupants;\n\t\t\t};\n\n\t\t\tvar _parseResponseMessage = function _parseResponseMessage(msginfo) {\n\t\t\t\tvar parseMsgData = { errorMsg: true, data: [] };\n\n\t\t\t\tvar msgBodies = msginfo.getElementsByTagName('body');\n\t\t\t\tif (msgBodies) {\n\t\t\t\t\tfor (var i = 0; i < msgBodies.length; i++) {\n\t\t\t\t\t\tvar msgBody = msgBodies[i];\n\t\t\t\t\t\tvar childNodes = msgBody.childNodes;\n\t\t\t\t\t\tif (childNodes && childNodes.length > 0) {\n\t\t\t\t\t\t\tvar childNode = msgBody.childNodes[0];\n\t\t\t\t\t\t\tif (childNode.nodeType == Strophe.ElementType.TEXT) {\n\t\t\t\t\t\t\t\tvar jsondata = childNode.wholeText || childNode.nodeValue;\n\t\t\t\t\t\t\t\tjsondata = jsondata.replace('\\n', '
');\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tvar data = eval('(' + jsondata + ')');\n\t\t\t\t\t\t\t\t\tparseMsgData.errorMsg = false;\n\t\t\t\t\t\t\t\t\tparseMsgData.data = [data];\n\t\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar delayTags = msginfo.getElementsByTagName('delay');\n\t\t\t\t\tif (delayTags && delayTags.length > 0) {\n\t\t\t\t\t\tvar delayTag = delayTags[0];\n\t\t\t\t\t\tvar delayMsgTime = delayTag.getAttribute('stamp');\n\t\t\t\t\t\tif (delayMsgTime) {\n\t\t\t\t\t\t\tparseMsgData.delayTimeStamp = delayMsgTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar childrens = msginfo.childNodes;\n\t\t\t\t\tif (childrens && childrens.length > 0) {\n\t\t\t\t\t\tvar child = msginfo.childNodes[0];\n\t\t\t\t\t\tif (child.nodeType == Strophe.ElementType.TEXT) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar data = eval('(' + child.nodeValue + ')');\n\t\t\t\t\t\t\t\tparseMsgData.errorMsg = false;\n\t\t\t\t\t\t\t\tparseMsgData.data = [data];\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn parseMsgData;\n\t\t\t};\n\n\t\t\tvar _parseNameFromJidFn = function _parseNameFromJidFn(jid, domain) {\n\t\t\t\tdomain = domain || '';\n\t\t\t\tvar tempstr = jid;\n\t\t\t\tvar findex = tempstr.indexOf('_');\n\n\t\t\t\tif (findex !== -1) {\n\t\t\t\t\ttempstr = tempstr.substring(findex + 1);\n\t\t\t\t}\n\t\t\t\tvar atindex = tempstr.indexOf('@' + domain);\n\t\t\t\tif (atindex !== -1) {\n\t\t\t\t\ttempstr = tempstr.substring(0, atindex);\n\t\t\t\t}\n\t\t\t\treturn tempstr;\n\t\t\t};\n\n\t\t\tvar _parseFriend = function _parseFriend(queryTag, conn, from) {\n\t\t\t\tvar rouster = [];\n\t\t\t\tvar items = queryTag.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('jid');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar subscription = item.getAttribute('subscription');\n\t\t\t\t\t\tvar friend = {\n\t\t\t\t\t\t\tsubscription: subscription,\n\t\t\t\t\t\t\tjid: jid\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar ask = item.getAttribute('ask');\n\t\t\t\t\t\tif (ask) {\n\t\t\t\t\t\t\tfriend.ask = ask;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar name = item.getAttribute('name');\n\t\t\t\t\t\tif (name) {\n\t\t\t\t\t\t\tfriend.name = name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\t\tfriend.name = n;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar groups = [];\n\t\t\t\t\t\tStrophe.forEachChild(item, 'group', function (group) {\n\t\t\t\t\t\t\tgroups.push(Strophe.getText(group));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfriend.groups = groups;\n\t\t\t\t\t\trouster.push(friend);\n\t\t\t\t\t\t// B同意之后 -> B订阅A\n\t\t\t\t\t\t// fix: 含有ask标示的好友代表已经发送过反向订阅消息,不需要再次发送。\n\t\t\t\t\t\tif (conn && subscription == 'from' && !ask) {\n\t\t\t\t\t\t\tconn.subscribe({\n\t\t\t\t\t\t\t\ttoJid: jid,\n\t\t\t\t\t\t\t\tmessage: \"[resp:true]\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (conn && subscription == 'to') {\n\t\t\t\t\t\t\tconn.subscribed({\n\t\t\t\t\t\t\t\ttoJid: jid\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rouster;\n\t\t\t};\n\n\t\t\tvar _login = function _login(options, conn) {\n\t\t\t\tvar accessToken = options.access_token || '';\n\t\t\t\tif (accessToken == '') {\n\t\t\t\t\tvar loginfo = _utils.stringify(options);\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,\n\t\t\t\t\t\tdata: options\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconn.context.accessToken = options.access_token;\n\t\t\t\tconn.context.accessTokenExpires = options.expires_in;\n\t\t\t\tif (conn.isOpening() && conn.context.stropheConn) {\n\t\t\t\t\tstropheConn = conn.context.stropheConn;\n\t\t\t\t} else if (conn.isOpened() && conn.context.stropheConn) {\n\t\t\t\t\t// return;\n\t\t\t\t\tstropheConn = conn.getStrophe();\n\t\t\t\t} else {\n\t\t\t\t\tstropheConn = conn.getStrophe();\n\t\t\t\t}\n\t\t\t\tvar callback = function callback(status, msg) {\n\t\t\t\t\t_loginCallback(status, msg, conn);\n\t\t\t\t};\n\n\t\t\t\tconn.context.stropheConn = stropheConn;\n\t\t\t\tif (conn.route) {\n\t\t\t\t\tstropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold, conn.route);\n\t\t\t\t} else {\n\t\t\t\t\tstropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _parseMessageType = function _parseMessageType(msginfo) {\n\t\t\t\tvar receiveinfo = msginfo.getElementsByTagName('received'),\n\t\t\t\t inviteinfo = msginfo.getElementsByTagName('invite'),\n\t\t\t\t deliveryinfo = msginfo.getElementsByTagName('delivery'),\n\t\t\t\t acked = msginfo.getElementsByTagName('acked'),\n\t\t\t\t error = msginfo.getElementsByTagName('error'),\n\t\t\t\t msgtype = 'normal';\n\t\t\t\tif (receiveinfo && receiveinfo.length > 0 && receiveinfo[0].namespaceURI === 'urn:xmpp:receipts') {\n\n\t\t\t\t\tmsgtype = 'received';\n\t\t\t\t} else if (inviteinfo && inviteinfo.length > 0) {\n\n\t\t\t\t\tmsgtype = 'invite';\n\t\t\t\t} else if (deliveryinfo && deliveryinfo.length > 0) {\n\n\t\t\t\t\tmsgtype = 'delivery'; // 消息送达\n\t\t\t\t} else if (acked && acked.length) {\n\n\t\t\t\t\tmsgtype = 'acked'; // 消息已读\n\t\t\t\t} else if (error && error.length) {\n\n\t\t\t\t\tvar errorItem = error[0],\n\t\t\t\t\t userMuted = errorItem.getElementsByTagName('user-muted');\n\n\t\t\t\t\tif (userMuted && userMuted.length) {\n\n\t\t\t\t\t\tmsgtype = 'userMuted';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn msgtype;\n\t\t\t};\n\n\t\t\tvar _handleMessageQueue = function _handleMessageQueue(conn) {\n\t\t\t\tfor (var i in _msgHash) {\n\t\t\t\t\tif (_msgHash.hasOwnProperty(i)) {\n\t\t\t\t\t\t_msgHash[i].send(conn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _loginCallback = function _loginCallback(status, msg, conn) {\n\t\t\t\tvar conflict, error;\n\n\t\t\t\tif (msg === 'conflict') {\n\t\t\t\t\tconflict = true;\n\t\t\t\t}\n\n\t\t\t\tif (status == Strophe.Status.CONNFAIL) {\n\t\t\t\t\t//client offline, ping/pong timeout, server quit, server offline\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,\n\t\t\t\t\t\tmsg: msg,\n\t\t\t\t\t\treconnect: true\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t} else if (status == Strophe.Status.ATTACHED || status == Strophe.Status.CONNECTED) {\n\t\t\t\t\t// client should limit the speed of sending ack messages up to 5/s\n\t\t\t\t\tconn.autoReconnectNumTotal = 0;\n\t\t\t\t\tconn.intervalId = setInterval(function () {\n\t\t\t\t\t\tconn.handelSendQueue();\n\t\t\t\t\t}, 200);\n\t\t\t\t\tvar handleMessage = function handleMessage(msginfo) {\n\t\t\t\t\t\tvar delivery = msginfo.getElementsByTagName('delivery');\n\t\t\t\t\t\tvar acked = msginfo.getElementsByTagName('acked');\n\t\t\t\t\t\tif (delivery.length) {\n\t\t\t\t\t\t\tconn.handleDeliveredMessage(msginfo);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (acked.length) {\n\t\t\t\t\t\t\tconn.handleAckedMessage(msginfo);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar type = _parseMessageType(msginfo);\n\t\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\t\tcase \"received\":\n\t\t\t\t\t\t\t\tconn.handleReceivedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"invite\":\n\t\t\t\t\t\t\t\tconn.handleInviteMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"delivery\":\n\t\t\t\t\t\t\t\tconn.handleDeliveredMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"acked\":\n\t\t\t\t\t\t\t\tconn.handleAckedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"userMuted\":\n\t\t\t\t\t\t\t\tconn.handleMutedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconn.handleMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tvar handlePresence = function handlePresence(msginfo) {\n\t\t\t\t\t\tconn.handlePresence(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handlePing = function handlePing(msginfo) {\n\t\t\t\t\t\tconn.handlePing(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIqRoster = function handleIqRoster(msginfo) {\n\t\t\t\t\t\tconn.handleIqRoster(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIqPrivacy = function handleIqPrivacy(msginfo) {\n\t\t\t\t\t\tconn.handleIqPrivacy(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIq = function handleIq(msginfo) {\n\t\t\t\t\t\tconn.handleIq(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\n\t\t\t\t\tconn.addHandler(handleMessage, null, 'message', null, null, null);\n\t\t\t\t\tconn.addHandler(handlePresence, null, 'presence', null, null, null);\n\t\t\t\t\tconn.addHandler(handlePing, 'urn:xmpp:ping', 'iq', 'get', null, null);\n\t\t\t\t\tconn.addHandler(handleIqRoster, 'jabber:iq:roster', 'iq', 'set', null, null);\n\t\t\t\t\tconn.addHandler(handleIqPrivacy, 'jabber:iq:privacy', 'iq', 'set', null, null);\n\t\t\t\t\tconn.addHandler(handleIq, null, 'iq', null, null, null);\n\n\t\t\t\t\tconn.registerConfrIQHandler && conn.registerConfrIQHandler();\n\n\t\t\t\t\tconn.context.status = _code.STATUS_OPENED;\n\n\t\t\t\t\tvar supportRecMessage = [_code.WEBIM_MESSAGE_REC_TEXT, _code.WEBIM_MESSAGE_REC_EMOJI];\n\n\t\t\t\t\tif (_utils.isCanDownLoadFile) {\n\t\t\t\t\t\tsupportRecMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO);\n\t\t\t\t\t\tsupportRecMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE);\n\t\t\t\t\t}\n\t\t\t\t\tvar supportSedMessage = [_code.WEBIM_MESSAGE_SED_TEXT];\n\t\t\t\t\tif (_utils.isCanUploadFile) {\n\t\t\t\t\t\tsupportSedMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO);\n\t\t\t\t\t\tsupportSedMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE);\n\t\t\t\t\t}\n\t\t\t\t\tconn.notifyVersion();\n\t\t\t\t\tconn.retry && _handleMessageQueue(conn);\n\t\t\t\t\tconn.heartBeat();\n\t\t\t\t\tconn.isAutoLogin && conn.setPresence();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (conn.unSendMsgArr.length > 0) {\n\t\t\t\t\t\t\tfor (var i in conn.unSendMsgArr) {\n\t\t\t\t\t\t\t\tvar dom = conn.unSendMsgArr[i];\n\t\t\t\t\t\t\t\tconn.sendCommand(dom);\n\t\t\t\t\t\t\t\tdelete conn.unSendMsgArr[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e.message);\n\t\t\t\t\t}\n\t\t\t\t\tconn.offLineSendConnecting = false;\n\t\t\t\t\tconn.logOut = false;\n\n\t\t\t\t\tconn.onOpened({\n\t\t\t\t\t\tcanReceive: supportRecMessage,\n\t\t\t\t\t\tcanSend: supportSedMessage,\n\t\t\t\t\t\taccessToken: conn.context.accessToken\n\t\t\t\t\t});\n\t\t\t\t} else if (status == Strophe.Status.DISCONNECTING) {\n\t\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\t\tconn.stopHeartBeat();\n\t\t\t\t\t\tconn.context.status = _code.STATUS_CLOSING;\n\n\t\t\t\t\t\terror = {\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,\n\t\t\t\t\t\t\tmsg: msg,\n\t\t\t\t\t\t\treconnect: true\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\t\tconn.onError(error);\n\t\t\t\t\t}\n\t\t\t\t} else if (status == Strophe.Status.DISCONNECTED) {\n\t\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\t\tif (conn.autoReconnectNumTotal < conn.autoReconnectNumMax) {\n\t\t\t\t\t\t\tconn.reconnect();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = {\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconn.onError(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconn.context.status = _code.STATUS_CLOSED;\n\t\t\t\t\tconn.clear();\n\t\t\t\t\tconn.onClosed();\n\t\t\t\t} else if (status == Strophe.Status.AUTHFAIL) {\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AUTH_ERROR\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t\tconn.clear();\n\t\t\t\t} else if (status == Strophe.Status.ERROR) {\n\t\t\t\t\tconn.context.status = _code.STATUS_ERROR;\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_ERROR\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t}\n\t\t\t\tconn.context.status_now = status;\n\t\t\t};\n\n\t\t\tvar _getJid = function _getJid(options, conn) {\n\t\t\t\tvar jid = options.toJid || '';\n\n\t\t\t\tif (jid === '') {\n\t\t\t\t\tvar appKey = conn.context.appKey || '';\n\t\t\t\t\tvar toJid = appKey + '_' + options.to + '@' + conn.domain;\n\n\t\t\t\t\tif (options.resource) {\n\t\t\t\t\t\ttoJid = toJid + '/' + options.resource;\n\t\t\t\t\t}\n\t\t\t\t\tjid = toJid;\n\t\t\t\t}\n\t\t\t\treturn jid;\n\t\t\t};\n\n\t\t\tvar _getJidByName = function _getJidByName(name, conn) {\n\t\t\t\tvar options = {\n\t\t\t\t\tto: name\n\t\t\t\t};\n\t\t\t\treturn _getJid(options, conn);\n\t\t\t};\n\n\t\t\tvar _validCheck = function _validCheck(options, conn) {\n\t\t\t\toptions = options || {};\n\n\t\t\t\tif (options.user == '') {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar user = options.user + '' || '';\n\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\tvar devInfos = appKey.split('#');\n\n\t\t\t\tif (devInfos.length !== 2) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar orgName = devInfos[0];\n\t\t\t\tvar appName = devInfos[1];\n\n\t\t\t\tif (!orgName) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!appName) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar jid = appKey + '_' + user.toLowerCase() + '@' + conn.domain,\n\t\t\t\t resource = options.resource || 'webim';\n\n\t\t\t\tif (conn.isMultiLoginSessions) {\n\t\t\t\t\tresource += user + new Date().getTime() + Math.floor(Math.random().toFixed(6) * 1000000);\n\t\t\t\t}\n\t\t\t\tconn.context.jid = jid + '/' + resource;\n\t\t\t\tconn.context.userId = user;\n\t\t\t\tconn.context.appKey = appKey;\n\t\t\t\tconn.context.appName = appName;\n\t\t\t\tconn.context.orgName = orgName;\n\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tvar _getXmppUrl = function _getXmppUrl(baseUrl, https) {\n\t\t\t\tif (/^(ws|http)s?:\\/\\/?/.test(baseUrl)) {\n\t\t\t\t\treturn baseUrl;\n\t\t\t\t}\n\n\t\t\t\tvar url = {\n\t\t\t\t\tprefix: 'http',\n\t\t\t\t\tbase: '://' + baseUrl,\n\t\t\t\t\tsuffix: '/http-bind/'\n\t\t\t\t};\n\n\t\t\t\tif (https && _utils.isSupportWss) {\n\t\t\t\t\turl.prefix = 'wss';\n\t\t\t\t\turl.suffix = '/ws/';\n\t\t\t\t} else {\n\t\t\t\t\tif (https) {\n\t\t\t\t\t\turl.prefix = 'https';\n\t\t\t\t\t} else if (window.WebSocket) {\n\t\t\t\t\t\turl.prefix = 'ws';\n\t\t\t\t\t\turl.suffix = '/ws/';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn url.prefix + url.base + url.suffix;\n\t\t\t};\n\n\t\t\t/**\n * The connection class.\n * @constructor\n * @param {Object} options -\n * @param {String} options.url - xmppURL for xmpp server\n * @param {String} options.apiUrl - apiURL for restful API server\n * @param {Boolean} options.isHttpDNS - while http:// protocol,use ip directly,instead of ServerName,avoiding DNS problem.default false\n * @param {Boolean} options.isMultiLoginSessions - true: A visitor can sign in to multiple webpages and receive messages at all the webpages. false: A visitor can sign in to only one webpage and receive messages at the webpage.\n * @param {Boolean} options.https - Whether use wss or not.\n * @param {Number} options.heartBeatWait - after login, send empty message to xmpp server like heartBeat every 45s, to keep the ws connection alive.\n * @param {Boolean} options.isAutoLogin - set presence after login\n * @param {Number} options.autoReconnectNumMax - will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.\n * @param {Number} options.autoReconnectInterval - the interval seconds between each auto reconnectting.\n * @param {Boolean} options.isWindowSDK - Whether for windows platform. default false.\n * @param {Boolean} options.encrypt - whether encrypt text message and emoji message\n * @param {Boolean} options.delivery - When a message arrived, whether the receiver send an ack message to the sender or not.\n * @param {Number} options.pollingTime -\n * @param {Number} options.maxRetries -\n * @param {Boolean} options.hold -\n * @param {String} options.route -\n * @param {String} options.domain -\n * @param {Boolean} options.inactivity -\n *\n * @returns {Class} a single instance of connection\n */\n\t\t\tvar connection = function connection(options) {\n\t\t\t\tif (!this instanceof connection) {\n\t\t\t\t\treturn new connection(options);\n\t\t\t\t}\n\n\t\t\t\tvar options = options || {};\n\n\t\t\t\tthis.isHttpDNS = options.isHttpDNS || false;\n\t\t\t\tthis.isMultiLoginSessions = options.isMultiLoginSessions || false;\n\t\t\t\tthis.wait = options.wait || 30;\n\t\t\t\tthis.hold = options.hold || 1;\n\t\t\t\tthis.retry = options.retry || false;\n\t\t\t\tthis.https = options.https || location.protocol === 'https:';\n\t\t\t\tthis.url = _getXmppUrl(options.url, this.https);\n\t\t\t\tthis.route = options.route || null;\n\t\t\t\tthis.domain = options.domain || 'easemob.com';\n\t\t\t\tthis.inactivity = options.inactivity || 30;\n\t\t\t\tthis.heartBeatWait = options.heartBeatWait || 4500;\n\t\t\t\tthis.maxRetries = options.maxRetries || 5;\n\t\t\t\tthis.isAutoLogin = options.isAutoLogin === false ? false : true;\n\t\t\t\tthis.pollingTime = options.pollingTime || 800;\n\t\t\t\tthis.stropheConn = false;\n\t\t\t\tthis.autoReconnectNumMax = options.autoReconnectNumMax || 0;\n\t\t\t\tthis.autoReconnectNumTotal = 0;\n\t\t\t\tthis.autoReconnectInterval = options.autoReconnectInterval || 0;\n\t\t\t\tthis.context = { status: _code.STATUS_INIT };\n\t\t\t\tthis.sendQueue = new Queue(); //instead of sending message immediately,cache them in this queue\n\t\t\t\tthis.intervalId = null; //clearInterval return value\n\t\t\t\tthis.apiUrl = options.apiUrl || '';\n\t\t\t\tthis.isWindowSDK = options.isWindowSDK || false;\n\t\t\t\tthis.encrypt = options.encrypt || { encrypt: { type: 'none' } };\n\t\t\t\tthis.delivery = options.delivery || false;\n\t\t\t\tthis.user = '';\n\t\t\t\tthis.orgName = '';\n\t\t\t\tthis.appName = '';\n\t\t\t\tthis.token = '';\n\t\t\t\tthis.unSendMsgArr = [];\n\t\t\t\tthis.offLineSendConnecting = false;\n\t\t\t\tthis.logOut = false;\n\n\t\t\t\tthis.dnsArr = ['https://rs.easemob.com', 'https://rsbak.easemob.com', 'http://182.92.174.78', 'http://112.126.66.111']; //http dns server hosts\n\t\t\t\tthis.dnsIndex = 0; //the dns ip used in dnsArr currently\n\t\t\t\tthis.dnsTotal = this.dnsArr.length; //max number of getting dns retries\n\t\t\t\tthis.restHosts = null; //rest server ips\n\t\t\t\tthis.restIndex = 0; //the rest ip used in restHosts currently\n\t\t\t\tthis.restTotal = 0; //max number of getting rest token retries\n\t\t\t\tthis.xmppHosts = null; //xmpp server ips\n\t\t\t\tthis.xmppIndex = 0; //the xmpp ip used in xmppHosts currently\n\t\t\t\tthis.xmppTotal = 0; //max number of creating xmpp server connection(ws/bosh) retries\n\n\t\t\t\tthis.groupOption = {};\n\t\t\t};\n\n\t\t\tconnection.prototype.testInit = function (options) {\n\t\t\t\tthis.orgName = options.orgName;\n\t\t\t\tthis.appName = options.appName;\n\t\t\t\tthis.user = options.user;\n\t\t\t\tthis.token = options.token;\n\t\t\t};\n\n\t\t\t/**\n * 注册新用户\n * @param {options} options -\n */\n\t\t\tconnection.prototype.registerUser = function (options) {\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\tthis.dnsIndex = 0;\n\t\t\t\t\tthis.getHttpDNS(options, 'signup');\n\t\t\t\t} else {\n\t\t\t\t\tthis.signup(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 处理发送队列\n * @private\n */\n\t\t\tconnection.prototype.handelSendQueue = function () {\n\t\t\t\tvar options = this.sendQueue.pop();\n\t\t\t\tif (options !== null) {\n\t\t\t\t\tthis.sendReceiptsMessage(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 注册监听函数\n * @param {options} options -\n */\n\t\t\tconnection.prototype.listen = function (options) {\n\t\t\t\tthis.onOpened = options.onOpened || _utils.emptyfn;\n\t\t\t\tthis.onClosed = options.onClosed || _utils.emptyfn;\n\t\t\t\tthis.onTextMessage = options.onTextMessage || _utils.emptyfn;\n\t\t\t\tthis.onEmojiMessage = options.onEmojiMessage || _utils.emptyfn;\n\t\t\t\tthis.onPictureMessage = options.onPictureMessage || _utils.emptyfn;\n\t\t\t\tthis.onAudioMessage = options.onAudioMessage || _utils.emptyfn;\n\t\t\t\tthis.onVideoMessage = options.onVideoMessage || _utils.emptyfn;\n\t\t\t\tthis.onFileMessage = options.onFileMessage || _utils.emptyfn;\n\t\t\t\tthis.onLocationMessage = options.onLocationMessage || _utils.emptyfn;\n\t\t\t\tthis.onCmdMessage = options.onCmdMessage || _utils.emptyfn;\n\t\t\t\tthis.onPresence = options.onPresence || _utils.emptyfn;\n\t\t\t\tthis.onRoster = options.onRoster || _utils.emptyfn;\n\t\t\t\tthis.onError = options.onError || _utils.emptyfn;\n\t\t\t\tthis.onReceivedMessage = options.onReceivedMessage || _utils.emptyfn;\n\t\t\t\tthis.onInviteMessage = options.onInviteMessage || _utils.emptyfn;\n\t\t\t\tthis.onDeliverdMessage = options.onDeliveredMessage || _utils.emptyfn;\n\t\t\t\tthis.onReadMessage = options.onReadMessage || _utils.emptyfn;\n\t\t\t\tthis.onMutedMessage = options.onMutedMessage || _utils.emptyfn;\n\t\t\t\tthis.onOffline = options.onOffline || _utils.emptyfn;\n\t\t\t\tthis.onOnline = options.onOnline || _utils.emptyfn;\n\t\t\t\tthis.onConfirmPop = options.onConfirmPop || _utils.emptyfn;\n\t\t\t\tthis.onCreateGroup = options.onCreateGroup || _utils.emptyfn;\n\t\t\t\t//for WindowSDK start\n\t\t\t\tthis.onUpdateMyGroupList = options.onUpdateMyGroupList || _utils.emptyfn;\n\t\t\t\tthis.onUpdateMyRoster = options.onUpdateMyRoster || _utils.emptyfn;\n\t\t\t\t//for WindowSDK end\n\t\t\t\tthis.onBlacklistUpdate = options.onBlacklistUpdate || _utils.emptyfn;\n\n\t\t\t\t_listenNetwork(this.onOnline, this.onOffline);\n\t\t\t};\n\n\t\t\t/**\n * 发送心跳\n * webrtc需要强制心跳,加个默认为false的参数 向下兼容\n * @param {Boolean} forcing - 是否强制发送\n * @private\n */\n\t\t\tconnection.prototype.heartBeat = function (forcing) {\n\t\t\t\tif (forcing !== true) {\n\t\t\t\t\tforcing = false;\n\t\t\t\t}\n\t\t\t\tvar me = this;\n\t\t\t\t//IE8: strophe auto switch from ws to BOSH, need heartbeat\n\t\t\t\tvar isNeed = !/^ws|wss/.test(me.url) || /mobile/.test(navigator.userAgent);\n\n\t\t\t\tif (this.heartBeatID || !forcing && !isNeed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar options = {\n\t\t\t\t\ttoJid: this.domain,\n\t\t\t\t\ttype: 'normal'\n\t\t\t\t};\n\t\t\t\tthis.heartBeatID = setInterval(function () {\n\t\t\t\t\t// fix: do heartbeat only when websocket \n\t\t\t\t\t_utils.isSupportWss && me.ping(options);\n\t\t\t\t}, this.heartBeatWait);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.stopHeartBeat = function () {\n\t\t\t\tif (typeof this.heartBeatID == \"number\") {\n\t\t\t\t\tthis.heartBeatID = clearInterval(this.heartBeatID);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 发送接收消息回执\n * @param {Object} options -\n * @private\n */\n\t\t\tconnection.prototype.sendReceiptsMessage = function (options) {\n\t\t\t\tvar dom = $msg({\n\t\t\t\t\tfrom: this.context.jid || '',\n\t\t\t\t\tto: this.domain,\n\t\t\t\t\tid: options.id || ''\n\t\t\t\t}).c('received', {\n\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\tid: options.id || ''\n\t\t\t\t});\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.cacheReceiptsMessage = function (options) {\n\t\t\t\tthis.sendQueue.push(options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getStrophe = function () {\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\t//TODO: try this.xmppTotal times on fail\n\t\t\t\t\tvar url = '';\n\t\t\t\t\tvar host = this.xmppHosts[this.xmppIndex];\n\t\t\t\t\tvar domain = _utils.getXmlFirstChild(host, 'domain');\n\t\t\t\t\tvar ip = _utils.getXmlFirstChild(host, 'ip');\n\t\t\t\t\tif (ip) {\n\t\t\t\t\t\turl = ip.textContent;\n\t\t\t\t\t\tvar port = _utils.getXmlFirstChild(host, 'port');\n\t\t\t\t\t\tif (port.textContent != '80') {\n\t\t\t\t\t\t\turl += ':' + port.textContent;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\turl = domain.textContent;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (url != '') {\n\t\t\t\t\t\tvar parter = /(.+\\/\\/).+(\\/.+)/;\n\t\t\t\t\t\tthis.url = this.url.replace(parter, \"$1\" + url + \"$2\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar stropheConn = new Strophe.Connection(this.url, {\n\t\t\t\t\tinactivity: this.inactivity,\n\t\t\t\t\tmaxRetries: this.maxRetries,\n\t\t\t\t\tpollingTime: this.pollingTime\n\t\t\t\t});\n\t\t\t\treturn stropheConn;\n\t\t\t};\n\n\t\t\t/**\n *\n * @param data\n * @param tagName\n * @private\n */\n\t\t\tconnection.prototype.getHostsByTag = function (data, tagName) {\n\t\t\t\tvar tag = _utils.getXmlFirstChild(data, tagName);\n\t\t\t\tif (!tag) {\n\t\t\t\t\tconsole.log(tagName + ' hosts error');\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar hosts = tag.getElementsByTagName('hosts');\n\t\t\t\tif (hosts.length == 0) {\n\t\t\t\t\tconsole.log(tagName + ' hosts error2');\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn hosts[0].getElementsByTagName('host');\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getRestFromHttpDNS = function (options, type) {\n\t\t\t\tif (this.restIndex > this.restTotal) {\n\t\t\t\t\tconsole.log('rest hosts all tried,quit');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar url = '';\n\t\t\t\tvar host = this.restHosts[this.restIndex];\n\t\t\t\tvar domain = _utils.getXmlFirstChild(host, 'domain');\n\t\t\t\tvar ip = _utils.getXmlFirstChild(host, 'ip');\n\t\t\t\tif (ip) {\n\t\t\t\t\tvar port = _utils.getXmlFirstChild(host, 'port');\n\t\t\t\t\turl = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + ip.textContent + ':' + port.textContent;\n\t\t\t\t} else {\n\t\t\t\t\turl = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + domain.textContent;\n\t\t\t\t}\n\n\t\t\t\tif (url != '') {\n\t\t\t\t\tthis.apiUrl = url;\n\t\t\t\t\toptions.apiUrl = url;\n\t\t\t\t}\n\n\t\t\t\tif (type == 'login') {\n\t\t\t\t\tthis.login(options);\n\t\t\t\t} else {\n\t\t\t\t\tthis.signup(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getHttpDNS = function (options, type) {\n\t\t\t\tif (this.restHosts) {\n\t\t\t\t\tthis.getRestFromHttpDNS(options, type);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar self = this;\n\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\tdata = new DOMParser().parseFromString(data, \"text/xml\").documentElement;\n\t\t\t\t\t//get rest ips\n\t\t\t\t\tvar restHosts = self.getHostsByTag(data, 'rest');\n\t\t\t\t\tif (!restHosts) {\n\t\t\t\t\t\tconsole.log('rest hosts error3');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tself.restHosts = restHosts;\n\t\t\t\t\tself.restTotal = restHosts.length;\n\n\t\t\t\t\t//get xmpp ips\n\t\t\t\t\tvar xmppHosts = self.getHostsByTag(data, 'xmpp');\n\t\t\t\t\tif (!xmppHosts) {\n\t\t\t\t\t\tconsole.log('xmpp hosts error3');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tself.xmppHosts = xmppHosts;\n\t\t\t\t\tself.xmppTotal = xmppHosts.length;\n\n\t\t\t\t\tself.getRestFromHttpDNS(options, type);\n\t\t\t\t};\n\t\t\t\tvar error = function error(res, xhr, msg) {\n\n\t\t\t\t\tconsole.log('getHttpDNS error', res, msg);\n\t\t\t\t\tself.dnsIndex++;\n\t\t\t\t\tif (self.dnsIndex < self.dnsTotal) {\n\t\t\t\t\t\tself.getHttpDNS(options, type);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tvar options2 = {\n\t\t\t\t\turl: this.dnsArr[this.dnsIndex] + '/easemob/server.xml',\n\t\t\t\t\tdataType: 'text',\n\t\t\t\t\ttype: 'GET',\n\n\t\t\t\t\t// url: 'http://www.easemob.com/easemob/server.xml',\n\t\t\t\t\t// dataType: 'xml',\n\t\t\t\t\tdata: { app_key: encodeURIComponent(options.appKey) },\n\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t};\n\t\t\t\t_utils.ajax(options2);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.signup = function (options) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar orgName = options.orgName || '';\n\t\t\t\tvar appName = options.appName || '';\n\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\tvar err = options.error || EMPTYFN;\n\n\t\t\t\tif (!orgName && !appName && appKey) {\n\t\t\t\t\tvar devInfos = appKey.split('#');\n\t\t\t\t\tif (devInfos.length === 2) {\n\t\t\t\t\t\torgName = devInfos[0];\n\t\t\t\t\t\tappName = devInfos[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!orgName && !appName) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\tif (location.protocol != 'https:' && self.isHttpDNS) {\n\t\t\t\t\t\tif (self.restIndex + 1 < self.restTotal) {\n\t\t\t\t\t\t\tself.restIndex++;\n\t\t\t\t\t\t\tself.getRestFromHttpDNS(options, 'signup');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tself.clear();\n\t\t\t\t\terr(res);\n\t\t\t\t};\n\t\t\t\tvar https = options.https || https;\n\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\tvar restUrl = apiUrl + '/' + orgName + '/' + appName + '/users';\n\n\t\t\t\tvar userjson = {\n\t\t\t\t\tusername: options.username,\n\t\t\t\t\tpassword: options.password,\n\t\t\t\t\tnickname: options.nickname || ''\n\t\t\t\t};\n\n\t\t\t\tvar userinfo = _utils.stringify(userjson);\n\t\t\t\tvar options2 = {\n\t\t\t\t\turl: restUrl,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: userinfo,\n\t\t\t\t\tsuccess: suc,\n\t\t\t\t\terror: error\n\t\t\t\t};\n\t\t\t\t_utils.ajax(options2);\n\t\t\t};\n\n\t\t\t/**\n * 登录\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.open = function (options) {\n\t\t\t\tvar appkey = options.appKey,\n\t\t\t\t orgName = appkey.split('#')[0],\n\t\t\t\t appName = appkey.split('#')[1];\n\t\t\t\tthis.orgName = orgName;\n\t\t\t\tthis.appName = appName;\n\t\t\t\tif (options.accessToken) {\n\t\t\t\t\tthis.token = options.accessToken;\n\t\t\t\t}\n\t\t\t\tif (options.xmppURL) {\n\t\t\t\t\tthis.url = _getXmppUrl(options.xmppURL, this.https);\n\t\t\t\t}\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\tthis.dnsIndex = 0;\n\t\t\t\t\tthis.getHttpDNS(options, 'login');\n\t\t\t\t} else {\n\t\t\t\t\tthis.login(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n *\n * @param options\n * @private\n */\n\t\t\tconnection.prototype.login = function (options) {\n\t\t\t\tthis.user = options.user;\n\t\t\t\tvar pass = _validCheck(options, this);\n\n\t\t\t\tif (!pass) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar conn = this;\n\n\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (options.accessToken) {\n\t\t\t\t\toptions.access_token = options.accessToken;\n\t\t\t\t\tconn.context.restTokenData = options;\n\t\t\t\t\t_login(options, conn);\n\t\t\t\t} else {\n\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\tvar userId = this.context.userId;\n\t\t\t\t\tvar pwd = options.pwd || '';\n\t\t\t\t\tvar appName = this.context.appName;\n\t\t\t\t\tvar orgName = this.context.orgName;\n\n\t\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\t\tconn.context.status = _code.STATUS_DOLOGIN_IM;\n\t\t\t\t\t\tconn.context.restTokenData = data;\n\t\t\t\t\t\tif (options.success) options.success(data);\n\t\t\t\t\t\tconn.token = data.access_token;\n\t\t\t\t\t\t_login(data, conn);\n\t\t\t\t\t};\n\t\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\t\tif (options.error) options.error();\n\t\t\t\t\t\tif (location.protocol != 'https:' && conn.isHttpDNS) {\n\t\t\t\t\t\t\tif (conn.restIndex + 1 < conn.restTotal) {\n\t\t\t\t\t\t\t\tconn.restIndex++;\n\t\t\t\t\t\t\t\tconn.getRestFromHttpDNS(options, 'login');\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconn.clear();\n\t\t\t\t\t\tif (res.error && res.error_description) {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_ERROR,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.context.status = _code.STATUS_DOLOGIN_USERGRID;\n\n\t\t\t\t\tvar loginJson = {\n\t\t\t\t\t\tgrant_type: 'password',\n\t\t\t\t\t\tusername: userId,\n\t\t\t\t\t\tpassword: pwd,\n\t\t\t\t\t\ttimestamp: +new Date()\n\t\t\t\t\t};\n\t\t\t\t\tvar loginfo = _utils.stringify(loginJson);\n\n\t\t\t\t\tvar options2 = {\n\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/token',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: loginfo,\n\t\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t\t};\n\t\t\t\t\t_utils.ajax(options2);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * attach to xmpp server for BOSH\n * @private\n */\n\t\t\tconnection.prototype.attach = function (options) {\n\t\t\t\tvar pass = _validCheck(options, this);\n\n\t\t\t\tif (!pass) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\toptions = options || {};\n\n\t\t\t\tvar accessToken = options.accessToken || '';\n\t\t\t\tif (accessToken == '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar sid = options.sid || '';\n\t\t\t\tif (sid === '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rid = options.rid || '';\n\t\t\t\tif (rid === '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstropheConn = this.getStrophe();\n\n\t\t\t\tthis.context.accessToken = accessToken;\n\t\t\t\tthis.context.stropheConn = stropheConn;\n\t\t\t\tthis.context.status = _code.STATUS_DOLOGIN_IM;\n\n\t\t\t\tvar conn = this;\n\t\t\t\tvar callback = function callback(status, msg) {\n\t\t\t\t\t_loginCallback(status, msg, conn);\n\t\t\t\t};\n\n\t\t\t\tvar jid = this.context.jid;\n\t\t\t\tvar wait = this.wait;\n\t\t\t\tvar hold = this.hold;\n\t\t\t\tvar wind = this.wind || 5;\n\t\t\t\tstropheConn.attach(jid, sid, rid, callback, wait, hold, wind);\n\t\t\t};\n\n\t\t\t/**\n * close connection\n * @param {String} reason\n */\n\t\t\tconnection.prototype.close = function (reason) {\n\t\t\t\tthis.logOut = true;\n\t\t\t\tthis.stopHeartBeat();\n\n\t\t\t\tvar status = this.context.status;\n\t\t\t\tif (status == _code.STATUS_INIT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.isClosed() || this.isClosing()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.context.status = _code.STATUS_CLOSING;\n\t\t\t\tthis.context.stropheConn.disconnect(reason);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.addHandler = function (handler, ns, name, type, id, from, options) {\n\t\t\t\tthis.context.stropheConn.addHandler(handler, ns, name, type, id, from, options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.notifyVersion = function (suc, fail) {\n\t\t\t\tvar jid = stropheConn.getJid();\n\t\t\t\tthis.context.jid = jid;\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: jid || '',\n\t\t\t\t\tto: this.domain,\n\t\t\t\t\ttype: 'result'\n\t\t\t\t}).c('query', { xmlns: 'jabber:iq:version' }).c('name').t('easemob').up().c('version').t(_version).up().c('os').t('webim');\n\n\t\t\t\tvar suc = suc || _utils.emptyfn;\n\t\t\t\tvar error = fail || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_NOTIFYVERSION_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), suc, failFn);\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\t/**\n * handle all types of presence message\n * @private\n */\n\t\t\tconnection.prototype.handlePresence = function (msginfo) {\n\t\t\t\tconsole.log('Info: ', typeof msginfo === 'undefined' ? 'undefined' : _typeof(msginfo));\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar from = msginfo.getAttribute('from') || '';\n\t\t\t\tvar to = msginfo.getAttribute('to') || '';\n\t\t\t\tvar type = msginfo.getAttribute('type') || '';\n\t\t\t\tvar presence_type = msginfo.getAttribute('presence_type') || '';\n\t\t\t\tvar fromUser = _parseNameFromJidFn(from);\n\t\t\t\tvar toUser = _parseNameFromJidFn(to);\n\t\t\t\tvar isCreate = false;\n\t\t\t\tvar isMemberJoin = false;\n\t\t\t\tvar isDecline = false;\n\t\t\t\tvar isApply = false;\n\t\t\t\tvar info = {\n\t\t\t\t\tfrom: fromUser,\n\t\t\t\t\tto: toUser,\n\t\t\t\t\tfromJid: from,\n\t\t\t\t\ttoJid: to,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tchatroom: msginfo.getElementsByTagName('roomtype').length ? true : false\n\t\t\t\t};\n\n\t\t\t\tvar showTags = msginfo.getElementsByTagName('show');\n\t\t\t\tif (showTags && showTags.length > 0) {\n\t\t\t\t\tvar showTag = showTags[0];\n\t\t\t\t\tinfo.show = Strophe.getText(showTag);\n\t\t\t\t}\n\t\t\t\tvar statusTags = msginfo.getElementsByTagName('status');\n\t\t\t\tif (statusTags && statusTags.length > 0) {\n\t\t\t\t\tvar statusTag = statusTags[0];\n\t\t\t\t\tinfo.status = Strophe.getText(statusTag);\n\t\t\t\t\tinfo.code = statusTag.getAttribute('code');\n\t\t\t\t}\n\n\t\t\t\tvar priorityTags = msginfo.getElementsByTagName('priority');\n\t\t\t\tif (priorityTags && priorityTags.length > 0) {\n\t\t\t\t\tvar priorityTag = priorityTags[0];\n\t\t\t\t\tinfo.priority = Strophe.getText(priorityTag);\n\t\t\t\t}\n\n\t\t\t\tvar error = msginfo.getElementsByTagName('error');\n\t\t\t\tif (error && error.length > 0) {\n\t\t\t\t\tvar error = error[0];\n\t\t\t\t\tinfo.error = {\n\t\t\t\t\t\tcode: error.getAttribute('code')\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tvar destroy = msginfo.getElementsByTagName('destroy');\n\t\t\t\tif (destroy && destroy.length > 0) {\n\t\t\t\t\tvar destroy = destroy[0];\n\t\t\t\t\tinfo.destroy = true;\n\n\t\t\t\t\tvar reason = destroy.getElementsByTagName('reason');\n\t\t\t\t\tif (reason && reason.length > 0) {\n\t\t\t\t\t\tinfo.reason = Strophe.getText(reason[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar members = msginfo.getElementsByTagName('item');\n\t\t\t\tif (members && members.length > 0) {\n\t\t\t\t\tvar member = members[0];\n\t\t\t\t\tvar role = member.getAttribute('role');\n\t\t\t\t\tvar jid = member.getAttribute('jid');\n\t\t\t\t\tvar affiliation = member.getAttribute('affiliation');\n\t\t\t\t\t// dismissed by group\n\t\t\t\t\tif (role == 'none' && jid) {\n\t\t\t\t\t\tvar kickedMember = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tvar actor = member.getElementsByTagName('actor')[0];\n\t\t\t\t\t\tvar actorNick = actor.getAttribute('nick');\n\t\t\t\t\t\tinfo.actor = actorNick;\n\t\t\t\t\t\tinfo.kicked = kickedMember;\n\t\t\t\t\t}\n\t\t\t\t\t// Service Acknowledges Room Creation `createGroupACK`\n\t\t\t\t\tif (role == 'moderator' && info.code == '201') {\n\t\t\t\t\t\tif (affiliation === 'owner') {\n\t\t\t\t\t\t\tinfo.type = 'createGroupACK';\n\t\t\t\t\t\t\tisCreate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// info.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar x = msginfo.getElementsByTagName('x');\n\t\t\t\tif (x && x.length > 0) {\n\t\t\t\t\t// 加群申请\n\t\t\t\t\tvar apply = x[0].getElementsByTagName('apply');\n\t\t\t\t\t// 加群成功\n\t\t\t\t\tvar accept = x[0].getElementsByTagName('accept');\n\t\t\t\t\t// 同意加群后用户进群通知\n\t\t\t\t\tvar item = x[0].getElementsByTagName('item');\n\t\t\t\t\t// 加群被拒绝\n\t\t\t\t\tvar decline = x[0].getElementsByTagName('decline');\n\t\t\t\t\t// 被设为管理员\n\t\t\t\t\tvar addAdmin = x[0].getElementsByTagName('add_admin');\n\t\t\t\t\t// 被取消管理员\n\t\t\t\t\tvar removeAdmin = x[0].getElementsByTagName('remove_admin');\n\t\t\t\t\t// 被禁言\n\t\t\t\t\tvar addMute = x[0].getElementsByTagName('add_mute');\n\t\t\t\t\t// 取消禁言\n\t\t\t\t\tvar removeMute = x[0].getElementsByTagName('remove_mute');\n\n\t\t\t\t\tif (apply && apply.length > 0) {\n\t\t\t\t\t\tisApply = true;\n\t\t\t\t\t\tinfo.toNick = apply[0].getAttribute('toNick');\n\t\t\t\t\t\tinfo.type = 'joinGroupNotifications';\n\t\t\t\t\t\tvar groupJid = apply[0].getAttribute('to');\n\t\t\t\t\t\tvar gid = groupJid.split('@')[0].split('_');\n\t\t\t\t\t\tgid = gid[gid.length - 1];\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t} else if (accept && accept.length > 0) {\n\t\t\t\t\t\tinfo.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t} else if (item && item.length > 0) {\n\t\t\t\t\t\tvar affiliation = item[0].getAttribute('affiliation'),\n\t\t\t\t\t\t role = item[0].getAttribute('role');\n\t\t\t\t\t\tif (affiliation == 'member' || role == 'participant') {\n\t\t\t\t\t\t\tisMemberJoin = true;\n\t\t\t\t\t\t\tinfo.mid = info.fromJid.split('/');\n\t\t\t\t\t\t\tinfo.mid = info.mid[info.mid.length - 1];\n\t\t\t\t\t\t\tinfo.type = 'memberJoinPublicGroupSuccess';\n\t\t\t\t\t\t\tvar roomtype = msginfo.getElementsByTagName('roomtype');\n\t\t\t\t\t\t\tif (roomtype && roomtype.length > 0) {\n\t\t\t\t\t\t\t\tvar type = roomtype[0].getAttribute('type');\n\t\t\t\t\t\t\t\tif (type == 'chatroom') {\n\t\t\t\t\t\t\t\t\tinfo.type = 'memberJoinChatRoomSuccess';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (decline && decline.length) {\n\t\t\t\t\t\tisDecline = true;\n\t\t\t\t\t\tvar gid = decline[0].getAttribute(\"fromNick\");\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(decline[0].getAttribute(\"from\"));\n\t\t\t\t\t\tinfo.type = \"joinPublicGroupDeclined\";\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t} else if (addAdmin && addAdmin.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(addAdmin[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(addAdmin[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"addAdmin\";\n\t\t\t\t\t} else if (removeAdmin && removeAdmin.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(removeAdmin[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(removeAdmin[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"removeAdmin\";\n\t\t\t\t\t} else if (addMute && addMute.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(addMute[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(addMute[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"addMute\";\n\t\t\t\t\t} else if (removeMute && removeMute.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(removeMute[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(removeMute[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"removeMute\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (info.chatroom) {\n\t\t\t\t\t// diff the\n\t\t\t\t\tinfo.presence_type = presence_type;\n\t\t\t\t\tinfo.original_type = info.type;\n\t\t\t\t\tvar reflectUser = from.slice(from.lastIndexOf('/') + 1);\n\n\t\t\t\t\tif (reflectUser === this.context.userId) {\n\t\t\t\t\t\tif (info.type === '' && !info.code) {\n\t\t\t\t\t\t\tinfo.type = 'joinChatRoomSuccess';\n\t\t\t\t\t\t} else if (presence_type === 'unavailable' || info.type === 'unavailable') {\n\t\t\t\t\t\t\tif (!info.status) {\n\t\t\t\t\t\t\t\t// logout successfully.\n\t\t\t\t\t\t\t\tinfo.type = 'leaveChatRoom';\n\t\t\t\t\t\t\t} else if (info.code == 110) {\n\t\t\t\t\t\t\t\t// logout or dismissied by admin.\n\t\t\t\t\t\t\t\tinfo.type = 'leaveChatRoom';\n\t\t\t\t\t\t\t} else if (info.error && info.error.code == 406) {\n\t\t\t\t\t\t\t\t// The chat room is full.\n\t\t\t\t\t\t\t\tinfo.type = 'reachChatRoomCapacity';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tinfo.presence_type = presence_type;\n\t\t\t\t\tinfo.original_type = type;\n\n\t\t\t\t\tif (/subscribe/.test(info.type)) {\n\t\t\t\t\t\t//subscribe | subscribed | unsubscribe | unsubscribed\n\t\t\t\t\t} else if (type == \"\" && !info.status && !info.error && !isCreate && !isApply && !isMemberJoin && !isDecline) {\n\t\t\t\t\t\tconsole.log(2222222, msginfo, info, isApply);\n\t\t\t\t\t\t// info.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t} else if (presence_type === 'unavailable' || type === 'unavailable') {\n\t\t\t\t\t\t// There is no roomtype when a chat room is deleted.\n\t\t\t\t\t\tif (info.destroy) {\n\t\t\t\t\t\t\t// Group or Chat room Deleted.\n\t\t\t\t\t\t\tinfo.type = 'deleteGroupChat';\n\t\t\t\t\t\t} else if (info.code == 307 || info.code == 321) {\n\t\t\t\t\t\t\t// Dismissed by group.\n\t\t\t\t\t\t\tvar nick = msginfo.getAttribute('nick');\n\t\t\t\t\t\t\tif (!nick) info.type = 'leaveGroup';else info.type = 'removedFromGroup';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.onPresence(info, msginfo);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handlePing = function (e) {\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar id = e.getAttribute('id');\n\t\t\t\tvar from = e.getAttribute('from');\n\t\t\t\tvar to = e.getAttribute('to');\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: to,\n\t\t\t\t\tto: from,\n\t\t\t\t\tid: id,\n\t\t\t\t\ttype: 'result'\n\t\t\t\t});\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIq = function (iq) {\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIqPrivacy = function (msginfo) {\n\t\t\t\tvar list = msginfo.getElementsByTagName('list');\n\t\t\t\tif (list.length == 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.getBlacklist();\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIqRoster = function (e) {\n\t\t\t\tvar id = e.getAttribute('id');\n\t\t\t\tvar from = e.getAttribute('from') || '';\n\t\t\t\tvar name = _parseNameFromJidFn(from);\n\t\t\t\tvar curJid = this.context.jid;\n\t\t\t\tvar curUser = this.context.userId;\n\n\t\t\t\tvar iqresult = $iq({ type: 'result', id: id, from: curJid });\n\t\t\t\tthis.sendCommand(iqresult.tree());\n\n\t\t\t\tvar msgBodies = e.getElementsByTagName('query');\n\t\t\t\tif (msgBodies && msgBodies.length > 0) {\n\t\t\t\t\tvar queryTag = msgBodies[0];\n\t\t\t\t\tvar rouster = _parseFriend(queryTag, this, from);\n\t\t\t\t\tthis.onRoster(rouster);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleMessage = function (msginfo) {\n\t\t\t\tvar self = this;\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar id = msginfo.getAttribute('id') || '';\n\n\t\t\t\t// cache ack into sendQueue first , handelSendQueue will do the send thing with the speed of 5/s\n\t\t\t\tthis.cacheReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t\tvar parseMsgData = _parseResponseMessage(msginfo);\n\t\t\t\tif (parseMsgData.errorMsg) {\n\t\t\t\t\tthis.handlePresence(msginfo);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// send error\n\t\t\t\tvar error = msginfo.getElementsByTagName('error');\n\t\t\t\tvar errorCode = '';\n\t\t\t\tvar errorText = '';\n\t\t\t\tvar errorBool = false;\n\t\t\t\tif (error.length > 0) {\n\t\t\t\t\terrorBool = true;\n\t\t\t\t\terrorCode = error[0].getAttribute('code');\n\t\t\t\t\tvar textDOM = error[0].getElementsByTagName('text');\n\t\t\t\t\terrorText = textDOM[0].textContent || textDOM[0].text;\n\t\t\t\t}\n\n\t\t\t\tvar msgDatas = parseMsgData.data;\n\t\t\t\tfor (var i in msgDatas) {\n\t\t\t\t\tif (!msgDatas.hasOwnProperty(i)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar msg = msgDatas[i];\n\t\t\t\t\tif (!msg.from || !msg.to) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar from = (msg.from + '').toLowerCase();\n\t\t\t\t\tvar too = (msg.to + '').toLowerCase();\n\t\t\t\t\tvar extmsg = msg.ext || {};\n\t\t\t\t\tvar chattype = '';\n\t\t\t\t\tvar typeEl = msginfo.getElementsByTagName('roomtype');\n\t\t\t\t\tif (typeEl.length) {\n\t\t\t\t\t\tchattype = typeEl[0].getAttribute('type') || 'chat';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchattype = msginfo.getAttribute('type') || 'chat';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar msgBodies = msg.bodies;\n\t\t\t\t\tif (!msgBodies || msgBodies.length == 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar msgBody = msg.bodies[0];\n\t\t\t\t\tvar type = msgBody.type;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\t\tcase 'txt':\n\t\t\t\t\t\t\t\tvar receiveMsg = msgBody.msg;\n\t\t\t\t\t\t\t\tif (self.encrypt.type === 'base64') {\n\t\t\t\t\t\t\t\t\treceiveMsg = atob(receiveMsg);\n\t\t\t\t\t\t\t\t} else if (self.encrypt.type === 'aes') {\n\t\t\t\t\t\t\t\t\tvar key = CryptoJS.enc.Utf8.parse(self.encrypt.key);\n\t\t\t\t\t\t\t\t\tvar iv = CryptoJS.enc.Utf8.parse(self.encrypt.iv);\n\t\t\t\t\t\t\t\t\tvar mode = self.encrypt.mode.toLowerCase();\n\t\t\t\t\t\t\t\t\tvar option = {};\n\t\t\t\t\t\t\t\t\tif (mode === 'cbc') {\n\t\t\t\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\t\t\t\tiv: iv,\n\t\t\t\t\t\t\t\t\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\t\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t} else if (mode === 'ebc') {\n\t\t\t\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\t\t\t\tmode: CryptoJS.mode.ECB,\n\t\t\t\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar encryptedBase64Str = receiveMsg;\n\t\t\t\t\t\t\t\t\tvar decryptedData = CryptoJS.AES.decrypt(encryptedBase64Str, key, option);\n\t\t\t\t\t\t\t\t\tvar decryptedStr = decryptedData.toString(CryptoJS.enc.Utf8);\n\t\t\t\t\t\t\t\t\treceiveMsg = decryptedStr;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar emojibody = _utils.parseTextMessage(receiveMsg, WebIM.Emoji);\n\t\t\t\t\t\t\t\tif (emojibody.isemoji) {\n\t\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp,\n\t\t\t\t\t\t\t\t\t\tdata: emojibody.body,\n\t\t\t\t\t\t\t\t\t\text: extmsg\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\t\tthis.onEmojiMessage(msg);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp,\n\t\t\t\t\t\t\t\t\t\tdata: receiveMsg,\n\t\t\t\t\t\t\t\t\t\text: extmsg\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\t\tthis.onTextMessage(msg);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'img':\n\t\t\t\t\t\t\t\tvar rwidth = 0;\n\t\t\t\t\t\t\t\tvar rheight = 0;\n\t\t\t\t\t\t\t\tif (msgBody.size) {\n\t\t\t\t\t\t\t\t\trwidth = msgBody.size.width;\n\t\t\t\t\t\t\t\t\trheight = msgBody.size.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tthumb: msgBody.thumb,\n\t\t\t\t\t\t\t\t\tthumb_secret: msgBody.thumb_secret,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length || '',\n\t\t\t\t\t\t\t\t\twidth: rwidth,\n\t\t\t\t\t\t\t\t\theight: rheight,\n\t\t\t\t\t\t\t\t\tfiletype: msgBody.filetype || '',\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onPictureMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'audio':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tlength: msgBody.length || '',\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length || '',\n\t\t\t\t\t\t\t\t\tfiletype: msgBody.filetype || '',\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onAudioMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length,\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onFileMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'loc':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\taddr: msgBody.addr,\n\t\t\t\t\t\t\t\t\tlat: msgBody.lat,\n\t\t\t\t\t\t\t\t\tlng: msgBody.lng,\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onLocationMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length,\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onVideoMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'cmd':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\taction: msgBody.action,\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onCmdMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;\n\t\t\t\t\t\tif (self.delivery) {\n\t\t\t\t\t\t\tvar msgId = self.getUniqueId();\n\t\t\t\t\t\t\tvar bodyId = msg.id;\n\t\t\t\t\t\t\tvar deliverMessage = new WebIM.message('delivery', msgId);\n\t\t\t\t\t\t\tdeliverMessage.set({\n\t\t\t\t\t\t\t\tid: bodyId,\n\t\t\t\t\t\t\t\tto: msg.from\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tself.send(deliverMessage.body);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleDeliveredMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tvar body = message.getElementsByTagName('body');\n\t\t\t\tvar mid = 0;\n\t\t\t\tif (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML;\n\t\t\t\tvar msg = {\n\t\t\t\t\tmid: mid\n\t\t\t\t};\n\t\t\t\tthis.onDeliverdMessage(msg);\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleAckedMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tvar body = message.getElementsByTagName('body');\n\t\t\t\tvar mid = 0;\n\t\t\t\tif (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML;\n\t\t\t\tvar msg = {\n\t\t\t\t\tmid: mid\n\t\t\t\t};\n\t\t\t\tthis.onReadMessage(msg);\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleReceivedMessage = function (message) {\n\t\t\t\ttry {\n\t\t\t\t\tvar received = message.getElementsByTagName(\"received\");\n\t\t\t\t\tvar mid = received[0].getAttribute('mid');\n\t\t\t\t\tvar body = message.getElementsByTagName(\"body\");\n\t\t\t\t\tvar id = body[0].innerHTML;\n\t\t\t\t\tvar msg = {\n\t\t\t\t\t\tmid: mid,\n\t\t\t\t\t\tid: id\n\t\t\t\t\t};\n\t\t\t\t\tthis.onReceivedMessage(msg);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\tdata: e\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tvar rcv = message.getElementsByTagName('received'),\n\t\t\t\t id,\n\t\t\t\t mid;\n\n\t\t\t\tif (rcv.length > 0) {\n\t\t\t\t\tif (rcv[0].childNodes && rcv[0].childNodes.length > 0) {\n\t\t\t\t\t\tid = rcv[0].childNodes[0].nodeValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tid = rcv[0].innerHTML || rcv[0].innerText;\n\t\t\t\t\t}\n\t\t\t\t\tmid = rcv[0].getAttribute('mid');\n\t\t\t\t}\n\n\t\t\t\tif (_msgHash[id]) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t_msgHash[id].msg.success instanceof Function && _msgHash[id].msg.success(id, mid);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tdelete _msgHash[id];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleInviteMessage = function (message) {\n\t\t\t\tvar form = null;\n\t\t\t\tvar invitemsg = message.getElementsByTagName('invite');\n\t\t\t\tvar reasonDom = message.getElementsByTagName('reason')[0];\n\t\t\t\tvar reasonMsg = reasonDom.textContent;\n\t\t\t\tvar id = message.getAttribute('id') || '';\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\n\t\t\t\tif (invitemsg && invitemsg.length > 0) {\n\t\t\t\t\tvar fromJid = invitemsg[0].getAttribute('from');\n\t\t\t\t\tform = _parseNameFromJidFn(fromJid);\n\t\t\t\t}\n\t\t\t\tvar xmsg = message.getElementsByTagName('x');\n\t\t\t\tvar roomid = null;\n\t\t\t\tif (xmsg && xmsg.length > 0) {\n\t\t\t\t\tfor (var i = 0; i < xmsg.length; i++) {\n\t\t\t\t\t\tif ('jabber:x:conference' === xmsg[i].namespaceURI) {\n\t\t\t\t\t\t\tvar roomjid = xmsg[i].getAttribute('jid');\n\t\t\t\t\t\t\troomid = _parseNameFromJidFn(roomjid);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.onInviteMessage({\n\t\t\t\t\ttype: 'invite',\n\t\t\t\t\tfrom: form,\n\t\t\t\t\troomid: roomid,\n\t\t\t\t\treason: reasonMsg\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleMutedMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tthis.onMutedMessage({\n\t\t\t\t\tmid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.sendCommand = function (dom, id) {\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.send(dom);\n\t\t\t\t} else {\n\t\t\t\t\tthis.unSendMsgArr.push(dom);\n\t\t\t\t\tif (!this.offLineSendConnecting && !this.logOut) {\n\t\t\t\t\t\tthis.offLineSendConnecting = true;\n\t\t\t\t\t\tthis.reconnect();\n\t\t\t\t\t}\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED,\n\t\t\t\t\t\treconnect: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * gen uuid with customized prefix\n * @param {String} prefix\n * @returns {string}\n */\n\t\t\tconnection.prototype.getUniqueId = function (prefix) {\n\t\t\t\t// fix: too frequently msg sending will make same id\n\t\t\t\tif (this.autoIncrement) {\n\t\t\t\t\tthis.autoIncrement++;\n\t\t\t\t} else {\n\t\t\t\t\tthis.autoIncrement = 1;\n\t\t\t\t}\n\t\t\t\tvar cdate = new Date();\n\t\t\t\tvar offdate = new Date(2010, 1, 1);\n\t\t\t\tvar offset = cdate.getTime() - offdate.getTime();\n\t\t\t\tvar hexd = parseFloat(offset).toString(16) + this.autoIncrement;\n\n\t\t\t\tif (typeof prefix === 'string' || typeof prefix === 'number') {\n\t\t\t\t\treturn prefix + '_' + hexd;\n\t\t\t\t} else {\n\t\t\t\t\treturn 'WEBIM_' + hexd;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * send message\n * @param {Object} messageSource\n */\n\t\t\tconnection.prototype.send = function (messageSource) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar message = messageSource;\n\t\t\t\tif (message.type === 'txt') {\n\t\t\t\t\tif (this.encrypt.type === 'base64') {\n\t\t\t\t\t\tmessage = _.clone(messageSource);\n\t\t\t\t\t\tmessage.msg = btoa(message.msg);\n\t\t\t\t\t} else if (this.encrypt.type === 'aes') {\n\t\t\t\t\t\tmessage = _.clone(messageSource);\n\t\t\t\t\t\tvar key = CryptoJS.enc.Utf8.parse(this.encrypt.key);\n\t\t\t\t\t\tvar iv = CryptoJS.enc.Utf8.parse(this.encrypt.iv);\n\t\t\t\t\t\tvar mode = this.encrypt.mode.toLowerCase();\n\t\t\t\t\t\tvar option = {};\n\t\t\t\t\t\tif (mode === 'cbc') {\n\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\tiv: iv,\n\t\t\t\t\t\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if (mode === 'ebc') {\n\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\tmode: CryptoJS.mode.ECB,\n\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar encryptedData = CryptoJS.AES.encrypt(message.msg, key, option);\n\n\t\t\t\t\t\tmessage.msg = encryptedData.toString();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.isWindowSDK) {\n\t\t\t\t\tWebIM.doQuery('{\"type\":\"sendMessage\",\"to\":\"' + message.to + '\",\"message_type\":\"' + message.type + '\",\"msg\":\"' + encodeURI(message.msg) + '\",\"chatType\":\"' + message.chatType + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tdata: \"send\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: _code.WEBIM_MESSAGE_SED_ERROR\n\t\t\t\t\t\t};\n\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (Object.prototype.toString.call(message) === '[object Object]') {\n\t\t\t\t\t\tvar appKey = this.context.appKey || '';\n\t\t\t\t\t\tvar toJid = appKey + '_' + message.to + '@' + this.domain;\n\n\t\t\t\t\t\tif (message.group) {\n\t\t\t\t\t\t\ttoJid = appKey + '_' + message.to + '@conference.' + this.domain;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.resource) {\n\t\t\t\t\t\t\ttoJid = toJid + '/' + message.resource;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmessage.toJid = toJid;\n\t\t\t\t\t\tmessage.id = message.id || this.getUniqueId();\n\t\t\t\t\t\t_msgHash[message.id] = new _message(message);\n\t\t\t\t\t\t_msgHash[message.id].send(this);\n\t\t\t\t\t} else if (typeof message === 'string') {\n\t\t\t\t\t\t_msgHash[message] && _msgHash[message].send(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 添加联系人\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.addRoster = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar name = options.name || '';\n\t\t\t\tvar groups = options.groups || '';\n\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tiq.c('query', { xmlns: 'jabber:iq:roster' });\n\t\t\t\tiq.c('item', { jid: jid, name: name });\n\n\t\t\t\tif (groups) {\n\t\t\t\t\tfor (var i = 0; i < groups.length; i++) {\n\t\t\t\t\t\tiq.c('group').t(groups[i]).up();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || _utils.emptyfn;\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, error);\n\t\t\t};\n\n\t\t\t/**\n * 删除联系人\n * @param {Object} options\n */\n\t\t\tconnection.prototype.removeRoster = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar iq = $iq({ type: 'set' }).c('query', { xmlns: 'jabber:iq:roster' }).c('item', {\n\t\t\t\t\tjid: jid,\n\t\t\t\t\tsubscription: 'remove'\n\t\t\t\t});\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || _utils.emptyfn;\n\t\t\t\tthis.context.stropheConn.sendIQ(iq, suc, error);\n\t\t\t};\n\n\t\t\t/**\n * 获取联系人\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getRoster = function (options) {\n\t\t\t\tvar conn = this;\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: 'jabber:iq:roster' });\n\n\t\t\t\tvar options = options || {};\n\t\t\t\tvar suc = options.success || this.onRoster;\n\t\t\t\tvar completeFn = function completeFn(ele) {\n\t\t\t\t\tvar rouster = [];\n\t\t\t\t\tvar msgBodies = ele.getElementsByTagName('query');\n\t\t\t\t\tif (msgBodies && msgBodies.length > 0) {\n\t\t\t\t\t\tvar queryTag = msgBodies[0];\n\t\t\t\t\t\trouster = _parseFriend(queryTag);\n\t\t\t\t\t}\n\t\t\t\t\tsuc(rouster, ele);\n\t\t\t\t};\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROSTER_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), completeFn, failFn);\n\t\t\t\t} else {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 订阅\n * @param {Object} options\n */\n\t\t\tconnection.prototype.subscribe = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'subscribe' });\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tif (options.nick) {\n\t\t\t\t\tpres.c('nick', { 'xmlns': 'http://jabber.org/protocol/nick' }).t(options.nick);\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 订阅成功\n * @param {Object} options\n */\n\t\t\tconnection.prototype.subscribed = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'subscribed' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 取消订阅成功\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.unsubscribe = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'unsubscribe' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message);\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 取消订阅成功\n * @param {Object} options\n */\n\t\t\tconnection.prototype.unsubscribed = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'unsubscribed' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 加入公开群组\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.joinPublicGroup = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_JOINROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室列表\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.listRooms = function (options) {\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: options.server || 'conference.' + this.domain,\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.DISCO_ITEMS });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar rooms = [];\n\t\t\t\t\trooms = _parseRoom(result);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuc(rooms);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\terror({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOM_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室成员列表\n * @param {Object} options\n */\n\t\t\tconnection.prototype.queryRoomMember = function (options) {\n\t\t\t\tvar domain = this.domain;\n\t\t\t\tvar members = [];\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.MUC + '#admin' }).c('item', { affiliation: 'member' });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar items = result.getElementsByTagName('item');\n\n\t\t\t\t\tif (items) {\n\t\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\t\tvar mem = {\n\t\t\t\t\t\t\t\tjid: item.getAttribute('jid'),\n\t\t\t\t\t\t\t\taffiliation: 'member'\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tmembers.push(mem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsuc(members);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室信息\n * @param {Object} options\n */\n\t\t\tconnection.prototype.queryRoomInfo = function (options) {\n\t\t\t\tvar domain = this.domain;\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.DISCO_INFO });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar members = [];\n\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar settings = '';\n\t\t\t\t\tvar features = result.getElementsByTagName('feature');\n\t\t\t\t\tif (features) {\n\t\t\t\t\t\tsettings = features[1].getAttribute('var') + '|' + features[3].getAttribute('var') + '|' + features[4].getAttribute('var');\n\t\t\t\t\t}\n\t\t\t\t\tswitch (settings) {\n\t\t\t\t\t\tcase 'muc_public|muc_membersonly|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PUBLIC_JOIN_APPROVAL';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_public|muc_open|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PUBLIC_JOIN_OPEN';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_hidden|muc_membersonly|muc_allowinvites':\n\t\t\t\t\t\t\tsettings = 'PRIVATE_MEMBER_INVITE';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_hidden|muc_membersonly|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PRIVATE_OWNER_INVITE';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar owner = '';\n\t\t\t\t\tvar fields = result.getElementsByTagName('field');\n\t\t\t\t\tvar fieldValues = {};\n\t\t\t\t\tif (fields) {\n\t\t\t\t\t\tfor (var i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tvar field = fields[i];\n\t\t\t\t\t\t\tvar fieldVar = field.getAttribute('var');\n\t\t\t\t\t\t\tvar fieldSimplify = fieldVar.split('_')[1];\n\t\t\t\t\t\t\tswitch (fieldVar) {\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_occupants':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_maxusers':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_affiliations':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_description':\n\t\t\t\t\t\t\t\t\tfieldValues[fieldSimplify] = field.textContent || field.text || '';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_owner':\n\t\t\t\t\t\t\t\t\tvar mem = {\n\t\t\t\t\t\t\t\t\t\tjid: (field.textContent || field.text) + '@' + domain,\n\t\t\t\t\t\t\t\t\t\taffiliation: 'owner'\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tmembers.push(mem);\n\t\t\t\t\t\t\t\t\tfieldValues[fieldSimplify] = field.textContent || field.text;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// if (field.getAttribute('label') === 'owner') {\n\t\t\t\t\t\t\t// var mem = {\n\t\t\t\t\t\t\t// jid: (field.textContent || field.text) + '@' + domain\n\t\t\t\t\t\t\t// , affiliation: 'owner'\n\t\t\t\t\t\t\t// };\n\t\t\t\t\t\t\t// members.push(mem);\n\t\t\t\t\t\t\t// break;\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfieldValues['name'] = result.getElementsByTagName('identity')[0].getAttribute('name');\n\t\t\t\t\t}\n\t\t\t\t\tsuc(settings, members, fieldValues);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMINFO_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室管理员\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.queryRoomOccupants = function (options) {\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar occupants = [];\n\t\t\t\t\toccupants = _parseRoomOccupants(result);\n\t\t\t\t\tsuc(occupants);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar attrs = {\n\t\t\t\t\txmlns: Strophe.NS.DISCO_ITEMS\n\t\t\t\t};\n\t\t\t\tvar info = $iq({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', attrs);\n\t\t\t\tthis.context.stropheConn.sendIQ(info.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @deprecated\n * @private\n */\n\t\t\tconnection.prototype.setUserSig = function (desc) {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tdesc = desc || '';\n\t\t\t\tdom.c('status').t(desc);\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tconnection.prototype.setPresence = function (type, status) {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tif (type) {\n\t\t\t\t\tif (status) {\n\t\t\t\t\t\tdom.c('show').t(type);\n\t\t\t\t\t\tdom.up().c('status').t(status);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdom.c('show').t(type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.getPresence = function () {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tvar conn = this;\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.ping = function (options) {\n\t\t\t\tvar options = options || {};\n\t\t\t\tvar jid = _getJid(options, this);\n\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: this.context.jid || '',\n\t\t\t\t\tto: jid,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('ping', { xmlns: 'urn:xmpp:ping' });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_PING_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), suc, failFn);\n\t\t\t\t} else {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isOpened = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_OPENED;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isOpening = function () {\n\t\t\t\tvar status = this.context.status;\n\t\t\t\treturn status == _code.STATUS_DOLOGIN_USERGRID || status == _code.STATUS_DOLOGIN_IM;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isClosing = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_CLOSING;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isClosed = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_CLOSED;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.clear = function () {\n\t\t\t\tvar key = this.context.appKey;\n\t\t\t\tif (this.errorType != _code.WEBIM_CONNCTION_DISCONNECTED) {\n\t\t\t\t\tif (this.logOut) {\n\t\t\t\t\t\tthis.unSendMsgArr = [];\n\t\t\t\t\t\tthis.offLineSendConnecting = false;\n\t\t\t\t\t\tthis.context = {\n\t\t\t\t\t\t\tstatus: _code.STATUS_INIT,\n\t\t\t\t\t\t\tappKey: key\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.intervalId) {\n\t\t\t\t\tclearInterval(this.intervalId);\n\t\t\t\t}\n\t\t\t\tthis.restIndex = 0;\n\t\t\t\tthis.xmppIndex = 0;\n\n\t\t\t\tif (this.errorType == _code.WEBIM_CONNCTION_CLIENT_LOGOUT || this.errorType == -1) {\n\t\t\t\t\tvar message = {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tdata: \"logout\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CLIENT_LOGOUT\n\t\t\t\t\t};\n\t\t\t\t\tthis.onError(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室列表\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getChatRooms = function (options) {\n\n\t\t\t\tvar conn = this,\n\t\t\t\t token = options.accessToken || this.context.accessToken;\n\n\t\t\t\tif (!_utils.isCanSetRequestHeader) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (token) {\n\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\tvar appName = this.context.appName;\n\t\t\t\t\tvar orgName = this.context.orgName;\n\n\t\t\t\t\tif (!appName || !orgName) {\n\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AUTH_ERROR\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\t\ttypeof options.success === 'function' && options.success(data);\n\t\t\t\t\t};\n\n\t\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\t\tif (res.error && res.error_description) {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,\n\t\t\t\t\t\t\t\tmsg: res.error_description,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tvar pageInfo = {\n\t\t\t\t\t\tpagenum: parseInt(options.pagenum) || 1,\n\t\t\t\t\t\tpagesize: parseInt(options.pagesize) || 20\n\t\t\t\t\t};\n\n\t\t\t\t\tvar opts = {\n\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/chatrooms',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\theaders: { 'Authorization': 'Bearer ' + token },\n\t\t\t\t\t\tdata: pageInfo,\n\t\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t\t};\n\t\t\t\t\t_utils.ajax(opts);\n\t\t\t\t} else {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 加入聊天室\n * @param {Object} options\n */\n\t\t\tconnection.prototype.joinChatRoom = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_JOINCHATROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'member', role: 'participant' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 退出聊天室\n * @param {Object} options\n */\n\t\t\tconnection.prototype.quitChatRoom = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_QUITCHATROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick,\n\t\t\t\t\ttype: 'unavailable'\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'none', role: 'none' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar self = this;\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation\",\n\t\t\t\t\tmsg: info.user + \" invites you to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"acceptInvitationFromGroup\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"acceptInvitationFromGroup error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\treject: function reject() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"declineInvitationFromGroup\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"declineInvitationFromGroup error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteAcceptionFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation response\",\n\t\t\t\t\tmsg: info.user + \" agreed to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteDeclineFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation response\",\n\t\t\t\t\tmsg: info.user + \" rejected to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onAutoAcceptInvitationFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation\",\n\t\t\t\t\tmsg: \"You had joined into the group:\" + info.group_name + \" automatically.Inviter:\" + info.user,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onLeaveGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You have been out of the group:\" + info.group_id + \".Reason:\" + info.msg,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveJoinGroupApplication = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar self = this;\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group join application\",\n\t\t\t\t\tmsg: info.user + \" applys to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"acceptJoinGroupApplication\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"acceptJoinGroupApplication error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\treject: function reject() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"declineJoinGroupApplication\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"declineJoinGroupApplication error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveAcceptionFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You had joined into the group:\" + info.group_name + \".\",\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveRejectionFromGroup = function () {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You have been rejected to join into the group:\" + info.group_name + \".\",\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onUpdateMyGroupList = function (options) {\n\t\t\t\tthis.onUpdateMyGroupList(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onUpdateMyRoster = function (options) {\n\t\t\t\tthis.onUpdateMyRoster(options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.reconnect = function () {\n\t\t\t\tvar that = this;\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_login(that.context.restTokenData, that);\n\t\t\t\t}, (this.autoReconnectNumTotal == 0 ? 0 : this.autoReconnectInterval) * 1000);\n\t\t\t\tthis.autoReconnectNumTotal++;\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n * @deprecated\n */\n\t\t\tconnection.prototype.closed = function () {\n\t\t\t\tvar message = {\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tdata: \"Closed error\"\n\t\t\t\t\t},\n\t\t\t\t\ttype: _code.WEBIM_CONNECTION_CLOSED\n\t\t\t\t};\n\t\t\t\tthis.onError(message);\n\t\t\t};\n\n\t\t\t/**\n * used for blacklist\n * @private\n *\n */\n\t\t\tfunction _parsePrivacy(iq) {\n\t\t\t\tvar list = [];\n\t\t\t\tvar items = iq.getElementsByTagName('item');\n\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('value');\n\t\t\t\t\t\tvar order = item.getAttribute('order');\n\t\t\t\t\t\tvar type = item.getAttribute('type');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tlist[n] = {\n\t\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\t\torder: order,\n\t\t\t\t\t\t\tjid: jid,\n\t\t\t\t\t\t\tname: n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn list;\n\t\t\t};\n\n\t\t\t/**\n * 获取好友黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.getBlacklist = function (options) {\n\t\t\t\toptions = options || {};\n\t\t\t\tvar iq = $iq({ type: 'get' });\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar me = this;\n\n\t\t\t\tiq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (iq) {\n\t\t\t\t\tme.onBlacklistUpdate(_parsePrivacy(iq));\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\tme.onBlacklistUpdate([]);\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 加入好友黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.addToBlackList = function (options) {\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tvar blacklist = options.list || {};\n\t\t\t\tvar type = options.type || 'jid';\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tvar keys = Object.keys(blacklist);\n\t\t\t\tvar len = keys.length;\n\t\t\t\tvar order = 2;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar item = blacklist[keys[i]];\n\t\t\t\t\tvar type = item.type || 'jid';\n\t\t\t\t\tvar jid = item.jid;\n\n\t\t\t\t\tpiece = piece.c('item', { action: 'deny', order: order++, type: type, value: jid }).c('message');\n\t\t\t\t\tif (i !== len - 1) {\n\t\t\t\t\t\tpiece = piece.up().up();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// console.log('addToBlackList', blacklist, piece.tree());\n\t\t\t\tthis.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n * 从好友黑名单删除\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.removeFromBlackList = function (options) {\n\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tvar blacklist = options.list || {};\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tvar keys = Object.keys(blacklist);\n\t\t\t\tvar len = keys.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar item = blacklist[keys[i]];\n\t\t\t\t\tvar type = item.type || 'jid';\n\t\t\t\t\tvar jid = item.jid;\n\t\t\t\t\tvar order = item.order;\n\n\t\t\t\t\tpiece = piece.c('item', { action: 'deny', order: order, type: type, value: jid }).c('message');\n\t\t\t\t\tif (i !== len - 1) {\n\t\t\t\t\t\tpiece = piece.up().up();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// console.log('removeFromBlackList', blacklist, piece.tree());\n\t\t\t\tthis.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tconnection.prototype._getGroupJid = function (to) {\n\t\t\t\tvar appKey = this.context.appKey || '';\n\t\t\t\treturn appKey + '_' + to + '@conference.' + this.domain;\n\t\t\t};\n\n\t\t\t/**\n * 加入群组黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.addToGroupBlackList = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'outcast',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tfunction _parseGroupBlacklist(iq) {\n\t\t\t\tvar list = {};\n\t\t\t\tvar items = iq.getElementsByTagName('item');\n\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('jid');\n\t\t\t\t\t\tvar affiliation = item.getAttribute('affiliation');\n\t\t\t\t\t\tvar nick = item.getAttribute('nick');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tlist[n] = {\n\t\t\t\t\t\t\tjid: jid,\n\t\t\t\t\t\t\taffiliation: affiliation,\n\t\t\t\t\t\t\tnick: nick,\n\t\t\t\t\t\t\tname: n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\n\t\t\t/**\n * 获取群组黑名单\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getGroupBlacklist = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// var jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'get', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'outcast'\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn(_parseGroupBlacklist(msginfo));\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 从群组黑名单删除\n * @param {Object} options\n */\n\t\t\tconnection.prototype.removeGroupMemberFromBlacklist = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 修改群名称\n *\n * @param {Object} options -\n * @example\n \n \n \n http://jabber.org/protocol/muc#roomconfig\n Room Name\n \n \n \n */\n\t\t\tconnection.prototype.changeGroupSubject = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar affiliation = 'owner';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('x', { type: 'submit', xmlns: 'jabber:x:data' }).c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up().c('field', { 'var': 'muc#roomconfig_roomname' }).c('value').t(options.subject).up().up().c('field', { 'var': 'muc#roomconfig_roomdesc' }).c('value').t(options.description);\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 删除群组\n *\n * @param {Object} options -\n * @example\n \n \n \n xxx destory group yyy\n \n \n \n */\n\t\t\tconnection.prototype.destroyGroup = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar affiliation = 'owner';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('destroy').c('reason').t(options.reason || '');\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 主动离开群组\n *\n * @param {Object} options -\n * @example\n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.leaveGroupBySelf = function (options) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t\tvar pres = $pres({ type: 'unavailable', to: to + '/' + self.context.userId });\n\t\t\t\t\tself.sendCommand(pres.tree());\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 被踢出群组\n *\n * @param {Object} options -\n * @example\n \n \n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.leaveGroup = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar list = options.list || [];\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation });\n\t\t\t\tvar keys = Object.keys(list);\n\t\t\t\tvar len = keys.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar name = list[keys[i]];\n\t\t\t\t\tvar jid = _getJidByName(name, this);\n\n\t\t\t\t\tpiece = piece.c('item', {\n\t\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up().c('item', {\n\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up();\n\t\t\t\t}\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 添加群组成员\n *\n * @param {Object} options -\n * @example\n Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发)\n \n \n \n \n liuwz invite you to join group '谢谢'\n \n \n \n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.addGroupMembers = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar list = options.list || [];\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation });\n\t\t\t\tvar len = list.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\n\t\t\t\t\tvar name = list[i];\n\t\t\t\t\tvar jid = _getJidByName(name, this);\n\n\t\t\t\t\tpiece = piece.c('item', {\n\t\t\t\t\t\taffiliation: 'member',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up();\n\n\t\t\t\t\tvar dom = $msg({\n\t\t\t\t\t\tto: to\n\t\t\t\t\t}).c('x', {\n\t\t\t\t\t\txmlns: 'http://jabber.org/protocol/muc#user'\n\t\t\t\t\t}).c('invite', {\n\t\t\t\t\t\tto: jid\n\t\t\t\t\t}).c('reason').t(options.reason || '');\n\n\t\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t\t}\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 接受加入申请\n *\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.acceptInviteFromGroup = function (options) {\n\t\t\t\toptions.success = function () {\n\t\t\t\t\t// then send sendAcceptInviteMessage\n\t\t\t\t\t// connection.prototype.sendAcceptInviteMessage(optoins);\n\t\t\t\t};\n\t\t\t\tthis.addGroupMembers(options);\n\t\t\t};\n\n\t\t\t/**\n * 拒绝入群申请\n * @param {Object} options -\n * @example\n throw request for now 暂时不处理,直接丢弃\n \t \n \n \n reject\n \n \n \n */\n\t\t\tconnection.prototype.rejectInviteFromGroup = function (options) {\n\t\t\t\t// var from = _getJidByName(options.from, this);\n\t\t\t\t// var dom = $msg({\n\t\t\t\t// from: from,\n\t\t\t\t// to: _getJidByName(options.to, this)\n\t\t\t\t// }).c('x', {\n\t\t\t\t// xmlns: 'http://jabber.org/protocol/muc#user'\n\t\t\t\t// }).c('apply', {\n\t\t\t\t// from: from,\n\t\t\t\t// to: this._getGroupJid(options.groupId),\n\t\t\t\t// toNick: options.groupName\n\t\t\t\t// }).c('reason').t(options.reason || '');\n\t\t\t\t//\n\t\t\t\t// this.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * 创建群组-异步\n * @param {Object} p -\n */\n\t\t\tconnection.prototype.createGroupAsync = function (p) {\n\t\t\t\tvar roomId = p.from;\n\t\t\t\tvar me = this;\n\t\t\t\tvar toRoom = this._getGroupJid(roomId);\n\t\t\t\tvar to = toRoom + '/' + this.context.userId;\n\t\t\t\tvar options = this.groupOption;\n\t\t\t\tvar suc = p.success || _utils.emptyfn;\n\n\t\t\t\t// Creating a Reserved Room\n\t\t\t\tvar iq = $iq({ type: 'get', to: toRoom }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });\n\n\t\t\t\t// Strophe.info('step 1 ----------');\n\t\t\t\t// Strophe.info(options);\n\t\t\t\tme.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\t// console.log(msgInfo);\n\n\t\t\t\t\t// for ie hack\n\t\t\t\t\tif ('setAttribute' in msgInfo) {\n\t\t\t\t\t\t// Strophe.info('step 3 ----------');\n\t\t\t\t\t\tvar x = msgInfo.getElementsByTagName('x')[0];\n\t\t\t\t\t\tx.setAttribute('type', 'submit');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Strophe.info('step 4 ----------');\n\t\t\t\t\t\tStrophe.forEachChild(msgInfo, 'x', function (field) {\n\t\t\t\t\t\t\tfield.setAttribute('type', 'submit');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tStrophe.info('step 5 ----------');\n\t\t\t\t\tStrophe.forEachChild(x, 'field', function (field) {\n\t\t\t\t\t\tvar fieldVar = field.getAttribute('var');\n\t\t\t\t\t\tvar valueDom = field.getElementsByTagName('value')[0];\n\t\t\t\t\t\tStrophe.info(fieldVar);\n\t\t\t\t\t\tswitch (fieldVar) {\n\t\t\t\t\t\t\tcase 'muc#roomconfig_maxusers':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.optionsMaxUsers || 200);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_roomname':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.subject || '');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_roomdesc':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.description || '');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_publicroom':\n\t\t\t\t\t\t\t\t// public 1\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsPublic);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_membersonly':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsMembersOnly);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_moderatedroom':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsModerate);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_persistentroom':\n\t\t\t\t\t\t\t\t_setText(valueDom, 1);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowinvites':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsAllowInvites);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowvisitornickchange':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowvisitorstatus':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'allow_private_messages':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'allow_private_messages_from_visitors':\n\t\t\t\t\t\t\t\t_setText(valueDom, 'nobody');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tvar iq = $iq({ to: toRoom, type: 'set' }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }).cnode(x);\n\n\t\t\t\t\tme.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\t\tme.addGroupMembers({\n\t\t\t\t\t\t\tlist: options.members,\n\t\t\t\t\t\t\troomId: roomId\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsuc(options);\n\t\t\t\t\t}, function (errInfo) {\n\t\t\t\t\t\t// errFn(errInfo);\n\t\t\t\t\t});\n\t\t\t\t\t// sucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\t// errFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 创建群组\n * @param {Object} options -\n * @example\n * 1. 创建申请 -> 得到房主身份\n * 2. 获取房主信息 -> 得到房间form\n * 3. 完善房间form -> 创建成功\n * 4. 添加房间成员\n * 5. 消息通知成员\n */\n\t\t\tconnection.prototype.createGroup = function (options) {\n\t\t\t\tthis.groupOption = options;\n\t\t\t\tvar roomId = +new Date();\n\t\t\t\tvar toRoom = this._getGroupJid(roomId);\n\t\t\t\tvar to = toRoom + '/' + this.context.userId;\n\n\t\t\t\tvar pres = $pres({ to: to }).c('x', { xmlns: 'http://jabber.org/protocol/muc' }).up().c('create', { xmlns: 'http://jabber.org/protocol/muc' }).up();\n\n\t\t\t\t// createGroupACK\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\t\t\t// 通过RestFul API接口创建群组\n\t\t\tconnection.prototype.createGroupNew = function (opt) {\n\t\t\t\topt.data.owner = this.user;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: JSON.stringify(opt.data),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = function (respData) {\n\t\t\t\t\topt.success(respData);\n\t\t\t\t\tthis.onCreateGroup(respData);\n\t\t\t\t}.bind(this);\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API屏蔽群组\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.blockGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tgroupId = 'notification_ignore_' + groupId;\n\t\t\t\tvar data = {\n\t\t\t\t\tentities: []\n\t\t\t\t};\n\t\t\t\tdata.entities[0] = {};\n\t\t\t\tdata.entities[0][groupId] = true;\n\t\t\t\tvar options = {\n\t\t\t\t\ttype: 'PUT',\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user,\n\t\t\t\t\tdata: JSON.stringify(data),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API发出入群申请\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.joinGroup = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + opt.groupId + '/' + 'apply',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组列表\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.listGroups = function (opt) {\n\t\t\t\tvar requestData = [];\n\t\t\t\trequestData['limit'] = opt.limit;\n\t\t\t\trequestData['cursor'] = opt.cursor;\n\t\t\t\tif (!requestData['cursor']) delete requestData['cursor'];\n\t\t\t\tif (isNaN(opt.limit)) {\n\t\t\t\t\tthrow 'The parameter \\\"limit\\\" should be a number';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/publicchatgroups',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: requestData,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API根据groupid获取群组详情\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupInfo = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups/' + opt.groupId,\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API列出某用户所加入的所有群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroup = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user + '/' + 'joined_chatgroups',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API列出群组的所有成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.listGroupMember = function (opt) {\n\t\t\t\tif (isNaN(opt.pageNum) || opt.pageNum <= 0) {\n\t\t\t\t\tthrow 'The parameter \\\"pageNum\\\" should be a positive number';\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isNaN(opt.pageSize) || opt.pageSize <= 0) {\n\t\t\t\t\tthrow 'The parameter \\\"pageSize\\\" should be a positive number';\n\t\t\t\t\treturn;\n\t\t\t\t} else if (opt.groupId === null && typeof opt.groupId === 'undefined') {\n\t\t\t\t\tthrow 'The parameter \\\"groupId\\\" should be added';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar requestData = [],\n\t\t\t\t groupId = opt.groupId;\n\t\t\t\trequestData['pagenum'] = opt.pageNum;\n\t\t\t\trequestData['pagesize'] = opt.pageSize;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/users',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdata: requestData,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API禁止群用户发言\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.mute = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"usernames\": [opt.username],\n\t\t\t\t\t\"mute_duration\": opt.muteDuration\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t},\n\t\t\t\t\tdata: JSON.stringify(requestData)\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API取消对用户禁言\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeMute = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute' + '/' + username,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组下所有管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/admin',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组下所有被禁言成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getMuted = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/mute',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API设置群管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.setAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\tnewadmin: opt.username\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin',\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API取消群管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API同意用户加入群\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.agreeJoinGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"applicant\": opt.applicant,\n\t\t\t\t\t\"verifyResult\": true,\n\t\t\t\t\t\"reason\": \"no clue\"\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API拒绝用户加入群\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.rejectJoinGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"applicant\": opt.applicant,\n\t\t\t\t\t\"verifyResult\": false,\n\t\t\t\t\t\"reason\": \"no clue\"\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API添加用户至群组黑名单(单个)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.groupBlockSingle = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API添加用户至群组黑名单(批量)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.groupBlockMulti = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t usernames = opt.usernames,\n\t\t\t\t requestData = {\n\t\t\t\t\tusernames: usernames\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API将用户从群黑名单移除(单个)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeGroupBlockSingle = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API将用户从群黑名单移除(批量)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeGroupBlockMulti = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username.join(','),\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API解散群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.dissolveGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '?version=v3',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组黑名单\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupBlacklistNew = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API离开群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.quitGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'quit',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API修改群信息\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.modifyGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\tgroupname: opt.groupName,\n\t\t\t\t\tdescription: opt.description\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId,\n\t\t\t\t\ttype: 'PUT',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API删除单个群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeSingleGroupMember = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API删除多个群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeMultiGroupMember = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t users = opt.users.join(','),\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + users,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API邀请群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.inviteToGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t users = opt.users,\n\t\t\t\t requestData = {\n\t\t\t\t\tusernames: users\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'invite',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\tfunction _setText(valueDom, v) {\n\t\t\t\tif ('textContent' in valueDom) {\n\t\t\t\t\tvalueDom.textContent = v;\n\t\t\t\t} else if ('text' in valueDom) {\n\t\t\t\t\tvalueDom.text = v;\n\t\t\t\t} else {\n\t\t\t\t\t// Strophe.info('_setText 4 ----------');\n\t\t\t\t\t// valueDom.innerHTML = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar WebIM = window.WebIM || {};\n\t\t\tWebIM.connection = connection;\n\t\t\tWebIM.utils = _utils;\n\t\t\tWebIM.statusCode = _code;\n\t\t\tWebIM.message = _msg.message;\n\t\t\tWebIM.doQuery = function (str, suc, fail) {\n\t\t\t\tif (typeof window.cefQuery === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twindow.cefQuery({\n\t\t\t\t\trequest: str,\n\t\t\t\t\tpersistent: false,\n\t\t\t\t\tonSuccess: suc,\n\t\t\t\t\tonFailure: fail\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**************************** debug ****************************/\n\t\t\tfunction logMessage(message) {\n\t\t\t\t// 获取Resource\n\t\t\t\tvar data = message.data;\n\t\t\t\tif (data.indexOf('') > 0) {\n\t\t\t\t\tvar start = data.indexOf(''),\n\t\t\t\t\t end = data.indexOf(''),\n\t\t\t\t\t data = data.substring(start + 5, end);\n\t\t\t\t\tstropheConn.setJid(data);\n\t\t\t\t}\n\t\t\t\tWebIM && WebIM.config.isDebug && console.log(WebIM.utils.ts() + '[recv] ', message.data);\n\t\t\t}\n\n\t\t\tif (WebIM && WebIM.config.isDebug) {\n\t\t\t\tStrophe.Connection.prototype.rawOutput = function (data) {\n\t\t\t\t\tconsole.log('%c ' + WebIM.utils.ts() + '[send] ' + data, \"background-color: #e2f7da\");\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (WebIM && WebIM.config && WebIM.config.isSandBox) {\n\t\t\t\tWebIM.config.xmppURL = WebIM.config.xmppURL.replace('.easemob.', '-sandbox.easemob.');\n\t\t\t\tWebIM.config.apiURL = WebIM.config.apiURL.replace('.easemob.', '-sdb.easemob.');\n\t\t\t}\n\n\t\t\tmodule.exports = WebIM;\n\n\t\t\tif (false) {\n\t\t\t\tmodule.hot.accept();\n\t\t\t}\n\n\t\t\t/***/\n\t\t},\n\t\t/* 2 */\n\t\t/***/function (module, exports) {\n\n\t\t\t;\n\t\t\t(function () {\n\n\t\t\t\texports.code = {\n\t\t\t\t\tWEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0,\n\t\t\t\t\tWEBIM_CONNCTION_OPEN_ERROR: 1,\n\t\t\t\t\tWEBIM_CONNCTION_AUTH_ERROR: 2,\n\t\t\t\t\tWEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3,\n\t\t\t\t\tWEBIM_CONNCTION_ATTACH_ERROR: 4,\n\t\t\t\t\tWEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5,\n\t\t\t\t\tWEBIM_CONNCTION_REOPEN_ERROR: 6,\n\t\t\t\t\tWEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7, //7: client-side network offline (net::ERR_INTERNET_DISCONNECTED)\n\t\t\t\t\tWEBIM_CONNCTION_SERVER_ERROR: 8, //8: offline by multi login\n\t\t\t\t\tWEBIM_CONNCTION_IQ_ERROR: 9,\n\n\t\t\t\t\tWEBIM_CONNCTION_PING_ERROR: 10,\n\t\t\t\t\tWEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11,\n\t\t\t\t\tWEBIM_CONNCTION_GETROSTER_ERROR: 12,\n\t\t\t\t\tWEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13,\n\t\t\t\t\tWEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14,\n\t\t\t\t\tWEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15,\n\t\t\t\t\tWEBIM_CONNCTION_DISCONNECTED: 16, //16: server-side close the websocket connection\n\t\t\t\t\tWEBIM_CONNCTION_AJAX_ERROR: 17,\n\t\t\t\t\tWEBIM_CONNCTION_JOINROOM_ERROR: 18,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOM_ERROR: 19,\n\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMINFO_ERROR: 20,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22,\n\t\t\t\t\tWEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23,\n\t\t\t\t\tWEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24,\n\t\t\t\t\tWEBIM_CONNCTION_JOINCHATROOM_ERROR: 25,\n\t\t\t\t\tWEBIM_CONNCTION_QUITCHATROOM_ERROR: 26,\n\t\t\t\t\tWEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27,\n\t\t\t\t\tWEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28,\n\t\t\t\t\tWEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29,\n\n\t\t\t\t\tWEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30,\n\t\t\t\t\tWEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31, //31: 处理下行消息出错 try/catch抛出异常\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_OFFLINE: 32, //32: client offline\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_LOGOUT: 33, //33: client logout\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34, // 34: Over amount of the tabs a user opened in the same browser\n\t\t\t\t\tWEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35,\n\t\t\t\t\tWEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36,\n\t\t\t\t\tWEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37,\n\t\t\t\t\tWEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38,\n\t\t\t\t\tWEBIM_CONNECTION_CLOSED: 39,\n\n\t\t\t\t\tWEBIM_UPLOADFILE_BROWSER_ERROR: 100,\n\t\t\t\t\tWEBIM_UPLOADFILE_ERROR: 101,\n\t\t\t\t\tWEBIM_UPLOADFILE_NO_LOGIN: 102,\n\t\t\t\t\tWEBIM_UPLOADFILE_NO_FILE: 103,\n\n\t\t\t\t\tWEBIM_DOWNLOADFILE_ERROR: 200,\n\t\t\t\t\tWEBIM_DOWNLOADFILE_NO_LOGIN: 201,\n\t\t\t\t\tWEBIM_DOWNLOADFILE_BROWSER_ERROR: 202,\n\n\t\t\t\t\tWEBIM_MESSAGE_REC_TEXT: 300,\n\t\t\t\t\tWEBIM_MESSAGE_REC_TEXT_ERROR: 301,\n\t\t\t\t\tWEBIM_MESSAGE_REC_EMOTION: 302,\n\t\t\t\t\tWEBIM_MESSAGE_REC_PHOTO: 303,\n\t\t\t\t\tWEBIM_MESSAGE_REC_AUDIO: 304,\n\t\t\t\t\tWEBIM_MESSAGE_REC_AUDIO_FILE: 305,\n\t\t\t\t\tWEBIM_MESSAGE_REC_VEDIO: 306,\n\t\t\t\t\tWEBIM_MESSAGE_REC_VEDIO_FILE: 307,\n\t\t\t\t\tWEBIM_MESSAGE_REC_FILE: 308,\n\t\t\t\t\tWEBIM_MESSAGE_SED_TEXT: 309,\n\t\t\t\t\tWEBIM_MESSAGE_SED_EMOTION: 310,\n\t\t\t\t\tWEBIM_MESSAGE_SED_PHOTO: 311,\n\t\t\t\t\tWEBIM_MESSAGE_SED_AUDIO: 312,\n\t\t\t\t\tWEBIM_MESSAGE_SED_AUDIO_FILE: 313,\n\t\t\t\t\tWEBIM_MESSAGE_SED_VEDIO: 314,\n\t\t\t\t\tWEBIM_MESSAGE_SED_VEDIO_FILE: 315,\n\t\t\t\t\tWEBIM_MESSAGE_SED_FILE: 316,\n\t\t\t\t\tWEBIM_MESSAGE_SED_ERROR: 317,\n\n\t\t\t\t\tSTATUS_INIT: 400,\n\t\t\t\t\tSTATUS_DOLOGIN_USERGRID: 401,\n\t\t\t\t\tSTATUS_DOLOGIN_IM: 402,\n\t\t\t\t\tSTATUS_OPENED: 403,\n\t\t\t\t\tSTATUS_CLOSING: 404,\n\t\t\t\t\tSTATUS_CLOSED: 405,\n\t\t\t\t\tSTATUS_ERROR: 406\n\t\t\t\t};\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 3 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;\n\t\t\t(function () {\n\n\t\t\t\tvar EMPTYFN = function EMPTYFN() {};\n\t\t\t\tvar _code = __webpack_require__(2).code;\n\t\t\t\tvar WEBIM_FILESIZE_LIMIT = 10485760;\n\n\t\t\t\tvar _createStandardXHR = function _createStandardXHR() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tvar _createActiveXHR = function _createActiveXHR() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn new window.ActiveXObject('Microsoft.XMLHTTP');\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tvar _xmlrequest = function _xmlrequest(crossDomain) {\n\t\t\t\t\tcrossDomain = crossDomain || true;\n\t\t\t\t\tvar temp = _createStandardXHR() || _createActiveXHR();\n\n\t\t\t\t\tif ('withCredentials' in temp) {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tif (!crossDomain) {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof window.XDomainRequest === 'undefined') {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tvar xhr = new XDomainRequest();\n\t\t\t\t\txhr.readyState = 0;\n\t\t\t\t\txhr.status = 100;\n\t\t\t\t\txhr.onreadystatechange = EMPTYFN;\n\t\t\t\t\txhr.onload = function () {\n\t\t\t\t\t\txhr.readyState = 4;\n\t\t\t\t\t\txhr.status = 200;\n\n\t\t\t\t\t\tvar xmlDoc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\t\t\txmlDoc.async = 'false';\n\t\t\t\t\t\txmlDoc.loadXML(xhr.responseText);\n\t\t\t\t\t\txhr.responseXML = xmlDoc;\n\t\t\t\t\t\txhr.response = xhr.responseText;\n\t\t\t\t\t\txhr.onreadystatechange();\n\t\t\t\t\t};\n\t\t\t\t\txhr.ontimeout = xhr.onerror = function () {\n\t\t\t\t\t\txhr.readyState = 4;\n\t\t\t\t\t\txhr.status = 500;\n\t\t\t\t\t\txhr.onreadystatechange();\n\t\t\t\t\t};\n\t\t\t\t\treturn xhr;\n\t\t\t\t};\n\n\t\t\t\tvar _hasFlash = function () {\n\t\t\t\t\tif ('ActiveXObject' in window) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn new ActiveXObject('ShockwaveFlash.ShockwaveFlash');\n\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (navigator.plugins && navigator.plugins.length > 0) {\n\t\t\t\t\t\t\treturn navigator.plugins['Shockwave Flash'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}();\n\n\t\t\t\tvar _tmpUtilXHR = _xmlrequest(),\n\t\t\t\t _hasFormData = typeof FormData !== 'undefined',\n\t\t\t\t _hasBlob = typeof Blob !== 'undefined',\n\t\t\t\t _isCanSetRequestHeader = _tmpUtilXHR.setRequestHeader || false,\n\t\t\t\t _hasOverrideMimeType = _tmpUtilXHR.overrideMimeType || false,\n\t\t\t\t _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData,\n\t\t\t\t _isCanUploadFile = _isCanUploadFileAsync || _hasFlash,\n\t\t\t\t _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType);\n\n\t\t\t\tif (!Object.keys) {\n\t\t\t\t\tObject.keys = function () {\n\t\t\t\t\t\t'use strict';\n\n\t\t\t\t\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\n\t\t\t\t\t\t hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'),\n\t\t\t\t\t\t dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],\n\t\t\t\t\t\t dontEnumsLength = dontEnums.length;\n\n\t\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\t\tif ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && (typeof obj !== 'function' || obj === null)) {\n\t\t\t\t\t\t\t\tthrow new TypeError('Object.keys called on non-object');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar result = [],\n\t\t\t\t\t\t\t prop,\n\t\t\t\t\t\t\t i;\n\n\t\t\t\t\t\t\tfor (prop in obj) {\n\t\t\t\t\t\t\t\tif (hasOwnProperty.call(obj, prop)) {\n\t\t\t\t\t\t\t\t\tresult.push(prop);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hasDontEnumBug) {\n\t\t\t\t\t\t\t\tfor (i = 0; i < dontEnumsLength; i++) {\n\t\t\t\t\t\t\t\t\tif (hasOwnProperty.call(obj, dontEnums[i])) {\n\t\t\t\t\t\t\t\t\t\tresult.push(dontEnums[i]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\t\t\t\t}\n\n\t\t\t\tvar utils = {\n\t\t\t\t\thasFormData: _hasFormData,\n\n\t\t\t\t\thasBlob: _hasBlob,\n\n\t\t\t\t\temptyfn: EMPTYFN,\n\n\t\t\t\t\tisCanSetRequestHeader: _isCanSetRequestHeader,\n\n\t\t\t\t\thasOverrideMimeType: _hasOverrideMimeType,\n\n\t\t\t\t\tisCanUploadFileAsync: _isCanUploadFileAsync,\n\n\t\t\t\t\tisCanUploadFile: _isCanUploadFile,\n\n\t\t\t\t\tisCanDownLoadFile: _isCanDownLoadFile,\n\n\t\t\t\t\tisSupportWss: function () {\n\t\t\t\t\t\tvar notSupportList = [\n\t\t\t\t\t\t//1: QQ browser X5 core\n\t\t\t\t\t\t/MQQBrowser[\\/]5([.]\\d+)?\\sTBS/\n\n\t\t\t\t\t\t//2: etc.\n\t\t\t\t\t\t//...\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (!window.WebSocket) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar ua = window.navigator.userAgent;\n\t\t\t\t\t\tfor (var i = 0, l = notSupportList.length; i < l; i++) {\n\t\t\t\t\t\t\tif (notSupportList[i].test(ua)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}(),\n\n\t\t\t\t\tgetIEVersion: function () {\n\t\t\t\t\t\tvar ua = navigator.userAgent,\n\t\t\t\t\t\t matches,\n\t\t\t\t\t\t tridentMap = { '4': 8, '5': 9, '6': 10, '7': 11 };\n\n\t\t\t\t\t\tmatches = ua.match(/MSIE (\\d+)/i);\n\n\t\t\t\t\t\tif (matches && matches[1]) {\n\t\t\t\t\t\t\treturn +matches[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatches = ua.match(/Trident\\/(\\d+)/i);\n\t\t\t\t\t\tif (matches && matches[1]) {\n\t\t\t\t\t\t\treturn tridentMap[matches[1]] || null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}(),\n\n\t\t\t\t\tstringify: function stringify(json) {\n\t\t\t\t\t\tif (typeof JSON !== 'undefined' && JSON.stringify) {\n\t\t\t\t\t\t\treturn JSON.stringify(json);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar s = '',\n\t\t\t\t\t\t\t arr = [];\n\n\t\t\t\t\t\t\tvar iterate = function iterate(json) {\n\t\t\t\t\t\t\t\tvar isArr = false;\n\n\t\t\t\t\t\t\t\tif (Object.prototype.toString.call(json) === '[object Array]') {\n\t\t\t\t\t\t\t\t\tarr.push(']', '[');\n\t\t\t\t\t\t\t\t\tisArr = true;\n\t\t\t\t\t\t\t\t} else if (Object.prototype.toString.call(json) === '[object Object]') {\n\t\t\t\t\t\t\t\t\tarr.push('}', '{');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor (var o in json) {\n\t\t\t\t\t\t\t\t\tif (Object.prototype.toString.call(json[o]) === '[object Null]') {\n\t\t\t\t\t\t\t\t\t\tjson[o] = 'null';\n\t\t\t\t\t\t\t\t\t} else if (Object.prototype.toString.call(json[o]) === '[object Undefined]') {\n\t\t\t\t\t\t\t\t\t\tjson[o] = 'undefined';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (json[o] && _typeof(json[o]) === 'object') {\n\t\t\t\t\t\t\t\t\t\ts += ',' + (isArr ? '' : '\"' + o + '\":' + (isArr ? '\"' : '')) + iterate(json[o]) + '';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts += ',\"' + (isArr ? '' : o + '\":\"') + json[o] + '\"';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (s != '') {\n\t\t\t\t\t\t\t\t\ts = s.slice(1);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn arr.pop() + s + arr.pop();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn iterate(json);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tlogin: function login(options) {\n\t\t\t\t\t\tvar options = options || {};\n\t\t\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\t\t\tvar err = options.error || EMPTYFN;\n\n\t\t\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\t\t\tvar devInfos = appKey.split('#');\n\t\t\t\t\t\tif (devInfos.length !== 2) {\n\t\t\t\t\t\t\terr({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar orgName = devInfos[0];\n\t\t\t\t\t\tvar appName = devInfos[1];\n\t\t\t\t\t\tvar https = https || options.https;\n\t\t\t\t\t\tvar user = options.user || '';\n\t\t\t\t\t\tvar pwd = options.pwd || '';\n\n\t\t\t\t\t\tvar apiUrl = options.apiUrl;\n\n\t\t\t\t\t\tvar loginJson = {\n\t\t\t\t\t\t\tgrant_type: 'password',\n\t\t\t\t\t\t\tusername: user,\n\t\t\t\t\t\t\tpassword: pwd,\n\t\t\t\t\t\t\ttimestamp: +new Date()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar loginfo = utils.stringify(loginJson);\n\n\t\t\t\t\t\tvar options = {\n\t\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/token',\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tdata: loginfo,\n\t\t\t\t\t\t\tsuccess: suc,\n\t\t\t\t\t\t\terror: err\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn utils.ajax(options);\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileUrl: function getFileUrl(fileInputId) {\n\t\t\t\t\t\tvar uri = {\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tfilename: '',\n\t\t\t\t\t\t\tfiletype: '',\n\t\t\t\t\t\t\tdata: ''\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar fileObj = typeof fileInputId === 'string' ? document.getElementById(fileInputId) : fileInputId;\n\n\t\t\t\t\t\tif (!utils.isCanUploadFileAsync || !fileObj) {\n\t\t\t\t\t\t\treturn uri;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (window.URL.createObjectURL) {\n\t\t\t\t\t\t\t\tvar fileItems = fileObj.files;\n\t\t\t\t\t\t\t\tif (fileItems.length > 0) {\n\t\t\t\t\t\t\t\t\tvar u = fileItems.item(0);\n\t\t\t\t\t\t\t\t\turi.data = u;\n\t\t\t\t\t\t\t\t\turi.url = window.URL.createObjectURL(u);\n\t\t\t\t\t\t\t\t\turi.filename = u.name || '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// IE\n\t\t\t\t\t\t\t\tvar u = document.getElementById(fileInputId).value;\n\t\t\t\t\t\t\t\turi.url = u;\n\t\t\t\t\t\t\t\tvar pos1 = u.lastIndexOf('/');\n\t\t\t\t\t\t\t\tvar pos2 = u.lastIndexOf('\\\\');\n\t\t\t\t\t\t\t\tvar pos = Math.max(pos1, pos2);\n\t\t\t\t\t\t\t\tif (pos < 0) uri.filename = u;else uri.filename = u.substring(pos + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar index = uri.filename.lastIndexOf('.');\n\t\t\t\t\t\t\tif (index != -1) {\n\t\t\t\t\t\t\t\turi.filetype = uri.filename.substring(index + 1).toLowerCase();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn uri;\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileSize: function getFileSize(file) {\n\t\t\t\t\t\tvar fileSize = this.getFileLength(file);\n\t\t\t\t\t\tif (fileSize > 10000000) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar kb = Math.round(fileSize / 1000);\n\t\t\t\t\t\tif (kb < 1000) {\n\t\t\t\t\t\t\tfileSize = kb + ' KB';\n\t\t\t\t\t\t} else if (kb >= 1000) {\n\t\t\t\t\t\t\tvar mb = kb / 1000;\n\t\t\t\t\t\t\tif (mb < 1000) {\n\t\t\t\t\t\t\t\tfileSize = mb.toFixed(1) + ' MB';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar gb = mb / 1000;\n\t\t\t\t\t\t\t\tfileSize = gb.toFixed(1) + ' GB';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fileSize;\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileLength: function getFileLength(file) {\n\t\t\t\t\t\tvar fileLength = 0;\n\t\t\t\t\t\tif (file) {\n\t\t\t\t\t\t\tif (file.files) {\n\t\t\t\t\t\t\t\tif (file.files.length > 0) {\n\t\t\t\t\t\t\t\t\tfileLength = file.files[0].size;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (file.select && 'ActiveXObject' in window) {\n\t\t\t\t\t\t\t\tfile.select();\n\t\t\t\t\t\t\t\tvar fileobject = new ActiveXObject('Scripting.FileSystemObject');\n\t\t\t\t\t\t\t\tvar file = fileobject.GetFile(file.value);\n\t\t\t\t\t\t\t\tfileLength = file.Size;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fileLength;\n\t\t\t\t\t},\n\n\t\t\t\t\thasFlash: _hasFlash,\n\n\t\t\t\t\ttrim: function trim(str) {\n\n\t\t\t\t\t\tstr = typeof str === 'string' ? str : '';\n\n\t\t\t\t\t\treturn str.trim ? str.trim() : str.replace(/^\\s|\\s$/g, '');\n\t\t\t\t\t},\n\n\t\t\t\t\tparseEmoji: function parseEmoji(msg) {\n\t\t\t\t\t\tif (typeof WebIM.Emoji === 'undefined' || typeof WebIM.Emoji.map === 'undefined') {\n\t\t\t\t\t\t\treturn msg;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar emoji = WebIM.Emoji,\n\t\t\t\t\t\t\t reg = null;\n\n\t\t\t\t\t\t\tfor (var face in emoji.map) {\n\t\t\t\t\t\t\t\tif (emoji.map.hasOwnProperty(face)) {\n\t\t\t\t\t\t\t\t\twhile (msg.indexOf(face) > -1) {\n\t\t\t\t\t\t\t\t\t\tmsg = msg.replace(face, '');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn msg;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\tparseLink: function parseLink(msg) {\n\n\t\t\t\t\t\tvar reg = /(https?\\:\\/\\/|www\\.)([a-zA-Z0-9-]+(\\.[a-zA-Z0-9]+)+)(\\:[0-9]{2,4})?\\/?((\\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\\/?)*\\??[:_#@*&%0-9a-zA-Z-/=]*/gm;\n\n\t\t\t\t\t\tmsg = msg.replace(reg, function (v) {\n\n\t\t\t\t\t\t\tvar prefix = /^https?/gm.test(v);\n\n\t\t\t\t\t\t\treturn \"\" + v + \"\";\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn msg;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseJSON: function parseJSON(data) {\n\n\t\t\t\t\t\tif (window.JSON && window.JSON.parse) {\n\t\t\t\t\t\t\treturn window.JSON.parse(data + '');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar requireNonComma,\n\t\t\t\t\t\t depth = null,\n\t\t\t\t\t\t str = utils.trim(data + '');\n\n\t\t\t\t\t\treturn str && !utils.trim(str.replace(/(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g, function (token, comma, open, close) {\n\n\t\t\t\t\t\t\tif (requireNonComma && comma) {\n\t\t\t\t\t\t\t\tdepth = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trequireNonComma = open || comma;\n\t\t\t\t\t\t\tdepth += !close - !open;\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t})) ? Function('return ' + str)() : Function('Invalid JSON: ' + data)();\n\t\t\t\t\t},\n\n\t\t\t\t\tparseUploadResponse: function parseUploadResponse(response) {\n\t\t\t\t\t\treturn response.indexOf('callback') > -1 ? //lte ie9\n\t\t\t\t\t\tresponse.slice(9, -1) : response;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseDownloadResponse: function parseDownloadResponse(response) {\n\t\t\t\t\t\treturn response && response.type && response.type === 'application/json' || 0 > Object.prototype.toString.call(response).indexOf('Blob') ? this.url + '?token=' : window.URL.createObjectURL(response);\n\t\t\t\t\t},\n\n\t\t\t\t\tuploadFile: function uploadFile(options) {\n\t\t\t\t\t\tvar options = options || {};\n\t\t\t\t\t\toptions.onFileUploadProgress = options.onFileUploadProgress || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadComplete = options.onFileUploadComplete || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadError = options.onFileUploadError || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadCanceled = options.onFileUploadCanceled || EMPTYFN;\n\n\t\t\t\t\t\tvar acc = options.accessToken || this.context.accessToken;\n\t\t\t\t\t\tif (!acc) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_NO_LOGIN,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar orgName, appName, devInfos;\n\t\t\t\t\t\tvar appKey = options.appKey || this.context.appKey || '';\n\n\t\t\t\t\t\tif (appKey) {\n\t\t\t\t\t\t\tdevInfos = appKey.split('#');\n\t\t\t\t\t\t\torgName = devInfos[0];\n\t\t\t\t\t\t\tappName = devInfos[1];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!orgName && !appName) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\t\tvar uploadUrl = apiUrl + '/' + orgName + '/' + appName + '/chatfiles';\n\n\t\t\t\t\t\tif (!utils.isCanUploadFileAsync) {\n\t\t\t\t\t\t\tif (utils.hasFlash && typeof options.flashUpload === 'function') {\n\t\t\t\t\t\t\t\toptions.flashUpload && options.flashUpload(uploadUrl, options);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_BROWSER_ERROR,\n\t\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar fileSize = options.file.data ? options.file.data.size : undefined;\n\t\t\t\t\t\tif (fileSize > WEBIM_FILESIZE_LIMIT) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (fileSize <= 0) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\t\t\t\t\t\tvar onError = function onError(e) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (xhr.upload) {\n\t\t\t\t\t\t\txhr.upload.addEventListener('progress', options.onFileUploadProgress, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (xhr.addEventListener) {\n\t\t\t\t\t\t\txhr.addEventListener('abort', options.onFileUploadCanceled, false);\n\t\t\t\t\t\t\txhr.addEventListener('load', function (e) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadComplete(json);\n\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t\txhr.addEventListener('error', onError, false);\n\t\t\t\t\t\t} else if (xhr.onreadystatechange) {\n\t\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\t\tif (ajax.status === 200) {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\toptions.onFileUploadComplete(json);\n\t\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t\t\toptions.onFileUploadCanceled();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\txhr.open('POST', uploadUrl);\n\n\t\t\t\t\t\txhr.setRequestHeader('restrict-access', 'true');\n\t\t\t\t\t\txhr.setRequestHeader('Accept', '*/*'); // Android QQ browser has some problem with this attribute.\n\t\t\t\t\t\txhr.setRequestHeader('Authorization', 'Bearer ' + acc);\n\n\t\t\t\t\t\tvar formData = new FormData();\n\t\t\t\t\t\tformData.append('file', options.file.data);\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(formData);\n\t\t\t\t\t},\n\n\t\t\t\t\tdownload: function download(options) {\n\t\t\t\t\t\toptions.onFileDownloadComplete = options.onFileDownloadComplete || EMPTYFN;\n\t\t\t\t\t\toptions.onFileDownloadError = options.onFileDownloadError || EMPTYFN;\n\n\t\t\t\t\t\tvar accessToken = options.accessToken || this.context.accessToken;\n\t\t\t\t\t\tif (!accessToken) {\n\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_NO_LOGIN,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar onError = function onError(e) {\n\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!utils.isCanDownLoadFile) {\n\t\t\t\t\t\t\toptions.onFileDownloadComplete();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\t\t\t\t\t\tif ('addEventListener' in xhr) {\n\t\t\t\t\t\t\txhr.addEventListener('load', function (e) {\n\t\t\t\t\t\t\t\toptions.onFileDownloadComplete(xhr.response, xhr);\n\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t\txhr.addEventListener('error', onError, false);\n\t\t\t\t\t\t} else if ('onreadystatechange' in xhr) {\n\t\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\t\tif (ajax.status === 200) {\n\t\t\t\t\t\t\t\t\t\toptions.onFileDownloadComplete(xhr.response, xhr);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar method = options.method || 'GET';\n\t\t\t\t\t\tvar resType = options.responseType || 'blob';\n\t\t\t\t\t\tvar mimeType = options.mimeType || 'text/plain; charset=x-user-defined';\n\t\t\t\t\t\txhr.open(method, options.url);\n\t\t\t\t\t\tif (typeof Blob !== 'undefined') {\n\t\t\t\t\t\t\txhr.responseType = resType;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\txhr.overrideMimeType(mimeType);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar innerHeaer = {\n\t\t\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t\t\t\t\t'Accept': 'application/octet-stream',\n\t\t\t\t\t\t\t'share-secret': options.secret,\n\t\t\t\t\t\t\t'Authorization': 'Bearer ' + accessToken\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar headers = options.headers || {};\n\t\t\t\t\t\tfor (var key in headers) {\n\t\t\t\t\t\t\tinnerHeaer[key] = headers[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var key in innerHeaer) {\n\t\t\t\t\t\t\tif (innerHeaer[key]) {\n\t\t\t\t\t\t\t\txhr.setRequestHeader(key, innerHeaer[key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(null);\n\t\t\t\t\t},\n\n\t\t\t\t\tparseTextMessage: function parseTextMessage(message, faces) {\n\t\t\t\t\t\tif (typeof message !== 'string') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (Object.prototype.toString.call(faces) !== '[object Object]') {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar receiveMsg = message;\n\t\t\t\t\t\tvar emessage = [];\n\t\t\t\t\t\tvar expr = /\\[[^[\\]]{2,3}\\]/mg;\n\t\t\t\t\t\tvar emoji = receiveMsg.match(expr);\n\n\t\t\t\t\t\tif (!emoji || emoji.length < 1) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar isemoji = false;\n\t\t\t\t\t\tfor (var i = 0; i < emoji.length; i++) {\n\t\t\t\t\t\t\tvar tmsg = receiveMsg.substring(0, receiveMsg.indexOf(emoji[i])),\n\t\t\t\t\t\t\t existEmoji = WebIM.Emoji.map[emoji[i]];\n\n\t\t\t\t\t\t\tif (tmsg) {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: tmsg\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!existEmoji) {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: emoji[i]\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar emojiStr = WebIM.Emoji.map ? WebIM.Emoji.path + existEmoji : null;\n\n\t\t\t\t\t\t\tif (emojiStr) {\n\t\t\t\t\t\t\t\tisemoji = true;\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'emoji',\n\t\t\t\t\t\t\t\t\tdata: emojiStr\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: emoji[i]\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar restMsgIndex = receiveMsg.indexOf(emoji[i]) + emoji[i].length;\n\t\t\t\t\t\t\treceiveMsg = receiveMsg.substring(restMsgIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (receiveMsg) {\n\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\tdata: receiveMsg\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isemoji) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: isemoji,\n\t\t\t\t\t\t\t\tbody: emessage\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\n\t\t\t\t\tparseUri: function parseUri() {\n\t\t\t\t\t\tvar pattern = /([^\\?|&])\\w+=([^&]+)/g;\n\t\t\t\t\t\tvar uri = {};\n\t\t\t\t\t\tif (window.location.search) {\n\t\t\t\t\t\t\tvar args = window.location.search.match(pattern);\n\t\t\t\t\t\t\tfor (var i in args) {\n\t\t\t\t\t\t\t\tvar str = args[i];\n\t\t\t\t\t\t\t\tvar eq = str.indexOf('=');\n\t\t\t\t\t\t\t\tvar key = str.substr(0, eq);\n\t\t\t\t\t\t\t\tvar value = str.substr(eq + 1);\n\t\t\t\t\t\t\t\turi[key] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn uri;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseHrefHash: function parseHrefHash() {\n\t\t\t\t\t\tvar pattern = /([^\\#|&])\\w+=([^&]+)/g;\n\t\t\t\t\t\tvar uri = {};\n\t\t\t\t\t\tif (window.location.hash) {\n\t\t\t\t\t\t\tvar args = window.location.hash.match(pattern);\n\t\t\t\t\t\t\tfor (var i in args) {\n\t\t\t\t\t\t\t\tvar str = args[i];\n\t\t\t\t\t\t\t\tvar eq = str.indexOf('=');\n\t\t\t\t\t\t\t\tvar key = str.substr(0, eq);\n\t\t\t\t\t\t\t\tvar value = str.substr(eq + 1);\n\t\t\t\t\t\t\t\turi[key] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn uri;\n\t\t\t\t\t},\n\n\t\t\t\t\txmlrequest: _xmlrequest,\n\n\t\t\t\t\tgetXmlFirstChild: function getXmlFirstChild(data, tagName) {\n\t\t\t\t\t\tvar children = data.getElementsByTagName(tagName);\n\t\t\t\t\t\tif (children.length == 0) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn children[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tajax: function ajax(options) {\n\t\t\t\t\t\tvar dataType = options.dataType || 'text';\n\t\t\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\t\t\tvar error = options.error || EMPTYFN;\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\n\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\tvar status = xhr.status || 0;\n\t\t\t\t\t\t\t\tif (status === 200) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tswitch (dataType) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\t\t\t\t\tsuc(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\tcase 'json':\n\t\t\t\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\t\tsuc(json, xhr);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\tcase 'xml':\n\t\t\t\t\t\t\t\t\t\t\t\tif (xhr.responseXML && xhr.responseXML.documentElement) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuc(xhr.responseXML.documentElement, xhr);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsuc(xhr.response || xhr.responseText, xhr);\n\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (xhr.readyState === 0) {\n\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (options.responseType) {\n\t\t\t\t\t\t\tif (xhr.responseType) {\n\t\t\t\t\t\t\t\txhr.responseType = options.responseType;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (options.mimeType) {\n\t\t\t\t\t\t\tif (utils.hasOverrideMimeType) {\n\t\t\t\t\t\t\t\txhr.overrideMimeType(options.mimeType);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar type = options.type || 'POST',\n\t\t\t\t\t\t data = options.data || null,\n\t\t\t\t\t\t tempData = '';\n\n\t\t\t\t\t\tif (type.toLowerCase() === 'get' && data) {\n\t\t\t\t\t\t\tfor (var o in data) {\n\t\t\t\t\t\t\t\tif (data.hasOwnProperty(o)) {\n\t\t\t\t\t\t\t\t\ttempData += o + '=' + data[o] + '&';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttempData = tempData ? tempData.slice(0, -1) : tempData;\n\t\t\t\t\t\t\toptions.url += (options.url.indexOf('?') > 0 ? '&' : '?') + (tempData ? tempData + '&' : tempData) + '_v=' + new Date().getTime();\n\t\t\t\t\t\t\tdata = null;\n\t\t\t\t\t\t\ttempData = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\txhr.open(type, options.url, utils.isCanSetRequestHeader);\n\n\t\t\t\t\t\tif (utils.isCanSetRequestHeader) {\n\t\t\t\t\t\t\tvar headers = options.headers || {};\n\t\t\t\t\t\t\tfor (var key in headers) {\n\t\t\t\t\t\t\t\tif (headers.hasOwnProperty(key)) {\n\t\t\t\t\t\t\t\t\txhr.setRequestHeader(key, headers[key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(data);\n\t\t\t\t\t\treturn xhr;\n\t\t\t\t\t},\n\t\t\t\t\tts: function ts() {\n\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\tvar Hours = d.getHours(); //获取当前小时数(0-23)\n\t\t\t\t\t\tvar Minutes = d.getMinutes(); //获取当前分钟数(0-59)\n\t\t\t\t\t\tvar Seconds = d.getSeconds(); //获取当前秒数(0-59)\n\t\t\t\t\t\tvar Milliseconds = d.getMilliseconds(); //获取当前毫秒\n\t\t\t\t\t\treturn (Hours < 10 ? \"0\" + Hours : Hours) + ':' + (Minutes < 10 ? \"0\" + Minutes : Minutes) + ':' + (Seconds < 10 ? \"0\" + Seconds : Seconds) + ':' + Milliseconds + ' ';\n\t\t\t\t\t},\n\n\t\t\t\t\tgetObjectKey: function getObjectKey(obj, val) {\n\t\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\t\tif (obj[key] == val) {\n\t\t\t\t\t\t\t\treturn key;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t},\n\n\t\t\t\t\tsprintf: function sprintf() {\n\t\t\t\t\t\tvar arg = arguments,\n\t\t\t\t\t\t str = arg[0] || '',\n\t\t\t\t\t\t i,\n\t\t\t\t\t\t len;\n\t\t\t\t\t\tfor (i = 1, len = arg.length; i < len; i++) {\n\t\t\t\t\t\t\tstr = str.replace(/%s/, arg[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str;\n\t\t\t\t\t},\n\n\t\t\t\t\tsetCookie: function setCookie(name, value, days) {\n\t\t\t\t\t\tvar cookie = name + '=' + encodeURIComponent(value);\n\t\t\t\t\t\tif (typeof days == 'number') {\n\t\t\t\t\t\t\tcookie += '; max-age: ' + days * 60 * 60 * 24;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.cookie = cookie;\n\t\t\t\t\t},\n\n\t\t\t\t\tgetCookie: function getCookie() {\n\t\t\t\t\t\tvar allCookie = {};\n\t\t\t\t\t\tvar all = document.cookie;\n\t\t\t\t\t\tif (all === \"\") {\n\t\t\t\t\t\t\treturn allCookie;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar list = all.split(\"; \");\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\t\t\t\t\tvar cookie = list[i];\n\t\t\t\t\t\t\tvar p = cookie.indexOf('=');\n\t\t\t\t\t\t\tvar name = cookie.substring(0, p);\n\t\t\t\t\t\t\tvar value = cookie.substring(p + 1);\n\t\t\t\t\t\t\tvalue = decodeURIComponent(value);\n\t\t\t\t\t\t\tallCookie[name] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn allCookie;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\texports.utils = utils;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 4 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar CryptoJS = __webpack_require__(5);\n\t\t\t;(function () {\n\t\t\t\t'use strict';\n\n\t\t\t\tvar _utils = __webpack_require__(3).utils;\n\t\t\t\tvar Message = function Message(type, id) {\n\t\t\t\t\tif (!this instanceof Message) {\n\t\t\t\t\t\treturn new Message(type);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._msg = {};\n\n\t\t\t\t\tif (typeof Message[type] === 'function') {\n\t\t\t\t\t\tMessage[type].prototype.setGroup = this.setGroup;\n\t\t\t\t\t\tthis._msg = new Message[type](id);\n\t\t\t\t\t}\n\t\t\t\t\treturn this._msg;\n\t\t\t\t};\n\t\t\t\tMessage.prototype.setGroup = function (group) {\n\t\t\t\t\tthis.body.group = group;\n\t\t\t\t};\n\n\t\t\t\t/*\n * Read Message\n */\n\t\t\t\tMessage.read = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'read';\n\t\t\t\t};\n\n\t\t\t\tMessage.read.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tackId: opt.id,\n\t\t\t\t\t\tto: opt.to\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * deliver message\n */\n\t\t\t\tMessage.delivery = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'delivery';\n\t\t\t\t};\n\n\t\t\t\tMessage.delivery.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tbodyId: opt.id,\n\t\t\t\t\t\tto: opt.to\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * text message\n */\n\t\t\t\tMessage.txt = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'txt';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.txt.prototype.set = function (opt) {\n\t\t\t\t\tthis.value = opt.msg;\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\tmsg: this.value,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail\n\t\t\t\t\t};\n\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * cmd message\n */\n\t\t\t\tMessage.cmd = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'cmd';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.cmd.prototype.set = function (opt) {\n\t\t\t\t\tthis.value = '';\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\taction: opt.action,\n\t\t\t\t\t\tmsg: this.value,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tsuccess: opt.success\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * loc message\n */\n\t\t\t\tMessage.location = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'loc';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.location.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\taddr: opt.addr,\n\t\t\t\t\t\tlat: opt.lat,\n\t\t\t\t\t\tlng: opt.lng,\n\t\t\t\t\t\text: opt.ext || {}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * img message\n */\n\t\t\t\tMessage.img = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'img';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.img.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\twidth: opt.width,\n\t\t\t\t\t\theight: opt.height,\n\t\t\t\t\t\tbody: opt.body,\n\t\t\t\t\t\tuploadError: opt.uploadError,\n\t\t\t\t\t\tuploadComplete: opt.uploadComplete\n\t\t\t\t\t};\n\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * audio message\n */\n\t\t\t\tMessage.audio = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'audio';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.audio.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\t\t\t\t\tthis.filename = opt.filename || this.value.filename;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tfilename: this.filename,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tlength: opt.length || 0,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tfile_length: opt.file_length,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\tbody: opt.body\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * file message\n */\n\t\t\t\tMessage.file = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'file';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.file.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\t\t\t\t\tthis.filename = opt.filename || this.value.filename;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tfilename: this.filename,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\tbody: opt.body\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * video message\n */\n\t\t\t\tMessage.video = function (id) {};\n\t\t\t\tMessage.video.prototype.set = function (opt) {};\n\n\t\t\t\tvar _Message = function _Message(message) {\n\n\t\t\t\t\tif (!this instanceof _Message) {\n\t\t\t\t\t\treturn new _Message(message, conn);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.msg = message;\n\t\t\t\t};\n\n\t\t\t\t_Message.prototype.send = function (conn) {\n\t\t\t\t\tvar me = this;\n\n\t\t\t\t\tvar _send = function _send(message) {\n\n\t\t\t\t\t\tmessage.ext = message.ext || {};\n\t\t\t\t\t\tmessage.ext.weichat = message.ext.weichat || {};\n\t\t\t\t\t\tmessage.ext.weichat.originType = message.ext.weichat.originType || 'webim';\n\n\t\t\t\t\t\tvar dom;\n\t\t\t\t\t\tvar json = {\n\t\t\t\t\t\t\tfrom: conn.context.userId || '',\n\t\t\t\t\t\t\tto: message.to,\n\t\t\t\t\t\t\tbodies: [message.body],\n\t\t\t\t\t\t\text: message.ext || {}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar jsonstr = _utils.stringify(json);\n\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\ttype: message.group || 'chat',\n\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t}).c('body').t(jsonstr);\n\n\t\t\t\t\t\tif (message.roomType) {\n\t\t\t\t\t\t\tdom.up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.bodyId) {\n\t\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\t\tfrom: conn.context.jid || '',\n\t\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t\t}).c('body').t(message.bodyId);\n\t\t\t\t\t\t\tvar delivery = {\n\t\t\t\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\t\t\t\tid: message.bodyId\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdom.up().c('delivery', delivery);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.ackId) {\n\n\t\t\t\t\t\t\tif (conn.context.jid.indexOf(message.toJid) >= 0) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\t\tfrom: conn.context.jid || '',\n\t\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t\t}).c('body').t(message.ackId);\n\t\t\t\t\t\t\tvar read = {\n\t\t\t\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\t\t\t\tid: message.ackId\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdom.up().c('acked', read);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tif (typeof _msgHash !== 'undefined' && _msgHash[message.id]) {\n\t\t\t\t\t\t\t\t_msgHash[message.id].msg.fail instanceof Function && _msgHash[message.id].msg.fail(message.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 60000);\n\t\t\t\t\t\tconn.sendCommand(dom.tree(), message.id);\n\t\t\t\t\t};\n\n\t\t\t\t\tif (me.msg.file) {\n\t\t\t\t\t\tif (me.msg.body && me.msg.body.url) {\n\t\t\t\t\t\t\t// Only send msg\n\t\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar _tmpComplete = me.msg.onFileUploadComplete;\n\t\t\t\t\t\tvar _complete = function _complete(data) {\n\t\t\t\t\t\t\tif (data.entities[0]['file-metadata']) {\n\t\t\t\t\t\t\t\tvar file_len = data.entities[0]['file-metadata']['content-length'];\n\t\t\t\t\t\t\t\t// me.msg.file_length = file_len;\n\t\t\t\t\t\t\t\tme.msg.filetype = data.entities[0]['file-metadata']['content-type'];\n\t\t\t\t\t\t\t\tif (file_len > 204800) {\n\t\t\t\t\t\t\t\t\tme.msg.thumbnail = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tme.msg.body = {\n\t\t\t\t\t\t\t\ttype: me.msg.type || 'file',\n\n\t\t\t\t\t\t\t\turl: (location.protocol != 'https:' && conn.isHttpDNS ? conn.apiUrl + data.uri.substr(data.uri.indexOf(\"/\", 9)) : data.uri) + '/' + data.entities[0]['uuid'],\n\t\t\t\t\t\t\t\tsecret: data.entities[0]['share-secret'],\n\t\t\t\t\t\t\t\tfilename: me.msg.file.filename || me.msg.filename,\n\t\t\t\t\t\t\t\tsize: {\n\t\t\t\t\t\t\t\t\twidth: me.msg.width || 0,\n\t\t\t\t\t\t\t\t\theight: me.msg.height || 0\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlength: me.msg.length || 0,\n\t\t\t\t\t\t\t\tfile_length: me.msg.ext.file_length || 0,\n\t\t\t\t\t\t\t\tfiletype: me.msg.filetype\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t\t\t_tmpComplete instanceof Function && _tmpComplete(data, me.msg.id);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tme.msg.onFileUploadComplete = _complete;\n\t\t\t\t\t\t_utils.uploadFile.call(conn, me.msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme.msg.body = {\n\t\t\t\t\t\t\ttype: me.msg.type === 'chat' ? 'txt' : me.msg.type,\n\t\t\t\t\t\t\tmsg: me.msg.msg\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (me.msg.type === 'cmd') {\n\t\t\t\t\t\t\tme.msg.body.action = me.msg.action;\n\t\t\t\t\t\t} else if (me.msg.type === 'loc') {\n\t\t\t\t\t\t\tme.msg.body.addr = me.msg.addr;\n\t\t\t\t\t\t\tme.msg.body.lat = me.msg.lat;\n\t\t\t\t\t\t\tme.msg.body.lng = me.msg.lng;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\texports._msg = _Message;\n\t\t\t\texports.message = Message;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 5 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(8), __webpack_require__(9), __webpack_require__(10), __webpack_require__(11), __webpack_require__(12), __webpack_require__(13), __webpack_require__(14), __webpack_require__(15), __webpack_require__(16), __webpack_require__(17), __webpack_require__(18), __webpack_require__(19), __webpack_require__(20), __webpack_require__(21), __webpack_require__(22), __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(26), __webpack_require__(27), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\", \"./lib-typedarrays\", \"./enc-utf16\", \"./enc-base64\", \"./md5\", \"./sha1\", \"./sha256\", \"./sha224\", \"./sha512\", \"./sha384\", \"./sha3\", \"./ripemd160\", \"./hmac\", \"./pbkdf2\", \"./evpkdf\", \"./cipher-core\", \"./mode-cfb\", \"./mode-ctr\", \"./mode-ctr-gladman\", \"./mode-ofb\", \"./mode-ecb\", \"./pad-ansix923\", \"./pad-iso10126\", \"./pad-iso97971\", \"./pad-zeropadding\", \"./pad-nopadding\", \"./format-hex\", \"./aes\", \"./tripledes\", \"./rc4\", \"./rabbit\", \"./rabbit-legacy\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\troot.CryptoJS = factory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 6 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory();\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\troot.CryptoJS = factory();\n\t\t\t\t}\n\t\t\t})(this, function () {\n\n\t\t\t\t/**\n * CryptoJS core components.\n */\n\t\t\t\tvar CryptoJS = CryptoJS || function (Math, undefined) {\n\t\t\t\t\t/*\n * Local polyfil of Object.create\n */\n\t\t\t\t\tvar create = Object.create || function () {\n\t\t\t\t\t\tfunction F() {};\n\n\t\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\t\tvar subtype;\n\n\t\t\t\t\t\t\tF.prototype = obj;\n\n\t\t\t\t\t\t\tsubtype = new F();\n\n\t\t\t\t\t\t\tF.prototype = null;\n\n\t\t\t\t\t\t\treturn subtype;\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * CryptoJS namespace.\n */\n\t\t\t\t\tvar C = {};\n\n\t\t\t\t\t/**\n * Library namespace.\n */\n\t\t\t\t\tvar C_lib = C.lib = {};\n\n\t\t\t\t\t/**\n * Base object for prototypal inheritance.\n */\n\t\t\t\t\tvar Base = C_lib.Base = function () {\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t/**\n * Creates a new object that inherits from this object.\n *\n * @param {Object} overrides Properties to copy into the new object.\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * field: 'value',\n *\n * method: function () {\n * }\n * });\n */\n\t\t\t\t\t\t\textend: function extend(overrides) {\n\t\t\t\t\t\t\t\t// Spawn\n\t\t\t\t\t\t\t\tvar subtype = create(this);\n\n\t\t\t\t\t\t\t\t// Augment\n\t\t\t\t\t\t\t\tif (overrides) {\n\t\t\t\t\t\t\t\t\tsubtype.mixIn(overrides);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Create default initializer\n\t\t\t\t\t\t\t\tif (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t\t\t\t\t\t\t\t\tsubtype.init = function () {\n\t\t\t\t\t\t\t\t\t\tsubtype.$super.init.apply(this, arguments);\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Initializer's prototype is the subtype object\n\t\t\t\t\t\t\t\tsubtype.init.prototype = subtype;\n\n\t\t\t\t\t\t\t\t// Reference supertype\n\t\t\t\t\t\t\t\tsubtype.$super = this;\n\n\t\t\t\t\t\t\t\treturn subtype;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Extends this object and runs the init method.\n * Arguments to create() will be passed to init().\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var instance = MyType.create();\n */\n\t\t\t\t\t\t\tcreate: function create() {\n\t\t\t\t\t\t\t\tvar instance = this.extend();\n\t\t\t\t\t\t\t\tinstance.init.apply(instance, arguments);\n\n\t\t\t\t\t\t\t\treturn instance;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Initializes a newly created object.\n * Override this method to add some logic when your objects are created.\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * init: function () {\n * // ...\n * }\n * });\n */\n\t\t\t\t\t\t\tinit: function init() {},\n\n\t\t\t\t\t\t\t/**\n * Copies properties into this object.\n *\n * @param {Object} properties The properties to mix in.\n *\n * @example\n *\n * MyType.mixIn({\n * field: 'value'\n * });\n */\n\t\t\t\t\t\t\tmixIn: function mixIn(properties) {\n\t\t\t\t\t\t\t\tfor (var propertyName in properties) {\n\t\t\t\t\t\t\t\t\tif (properties.hasOwnProperty(propertyName)) {\n\t\t\t\t\t\t\t\t\t\tthis[propertyName] = properties[propertyName];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// IE won't copy toString using the loop above\n\t\t\t\t\t\t\t\tif (properties.hasOwnProperty('toString')) {\n\t\t\t\t\t\t\t\t\tthis.toString = properties.toString;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = instance.clone();\n */\n\t\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\t\treturn this.init.prototype.extend(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * An array of 32-bit words.\n *\n * @property {Array} words The array of 32-bit words.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\n\t\t\t\t\tvar WordArray = C_lib.WordArray = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of 32-bit words.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.create();\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n */\n\t\t\t\t\t\tinit: function init(words, sigBytes) {\n\t\t\t\t\t\t\twords = this.words = words || [];\n\n\t\t\t\t\t\t\tif (sigBytes != undefined) {\n\t\t\t\t\t\t\t\tthis.sigBytes = sigBytes;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.sigBytes = words.length * 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this word array to a string.\n *\n * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n *\n * @return {string} The stringified word array.\n *\n * @example\n *\n * var string = wordArray + '';\n * var string = wordArray.toString();\n * var string = wordArray.toString(CryptoJS.enc.Utf8);\n */\n\t\t\t\t\t\ttoString: function toString(encoder) {\n\t\t\t\t\t\t\treturn (encoder || Hex).stringify(this);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Concatenates a word array to this word array.\n *\n * @param {WordArray} wordArray The word array to append.\n *\n * @return {WordArray} This word array.\n *\n * @example\n *\n * wordArray1.concat(wordArray2);\n */\n\t\t\t\t\t\tconcat: function concat(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar thisWords = this.words;\n\t\t\t\t\t\t\tvar thatWords = wordArray.words;\n\t\t\t\t\t\t\tvar thisSigBytes = this.sigBytes;\n\t\t\t\t\t\t\tvar thatSigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\tthis.clamp();\n\n\t\t\t\t\t\t\t// Concat\n\t\t\t\t\t\t\tif (thisSigBytes % 4) {\n\t\t\t\t\t\t\t\t// Copy one byte at a time\n\t\t\t\t\t\t\t\tfor (var i = 0; i < thatSigBytes; i++) {\n\t\t\t\t\t\t\t\t\tvar thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\t\tthisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Copy one word at a time\n\t\t\t\t\t\t\t\tfor (var i = 0; i < thatSigBytes; i += 4) {\n\t\t\t\t\t\t\t\t\tthisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.sigBytes += thatSigBytes;\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Removes insignificant bits.\n *\n * @example\n *\n * wordArray.clamp();\n */\n\t\t\t\t\t\tclamp: function clamp() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = this.words;\n\t\t\t\t\t\t\tvar sigBytes = this.sigBytes;\n\n\t\t\t\t\t\t\t// Clamp\n\t\t\t\t\t\t\twords[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;\n\t\t\t\t\t\t\twords.length = Math.ceil(sigBytes / 4);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this word array.\n *\n * @return {WordArray} The clone.\n *\n * @example\n *\n * var clone = wordArray.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\t\t\t\t\t\t\tclone.words = this.words.slice(0);\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a word array filled with random bytes.\n *\n * @param {number} nBytes The number of random bytes to generate.\n *\n * @return {WordArray} The random word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.random(16);\n */\n\t\t\t\t\t\trandom: function random(nBytes) {\n\t\t\t\t\t\t\tvar words = [];\n\n\t\t\t\t\t\t\tvar r = function r(m_w) {\n\t\t\t\t\t\t\t\tvar m_w = m_w;\n\t\t\t\t\t\t\t\tvar m_z = 0x3ade68b1;\n\t\t\t\t\t\t\t\tvar mask = 0xffffffff;\n\n\t\t\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\t\t\tm_z = 0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10) & mask;\n\t\t\t\t\t\t\t\t\tm_w = 0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10) & mask;\n\t\t\t\t\t\t\t\t\tvar result = (m_z << 0x10) + m_w & mask;\n\t\t\t\t\t\t\t\t\tresult /= 0x100000000;\n\t\t\t\t\t\t\t\t\tresult += 0.5;\n\t\t\t\t\t\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfor (var i = 0, rcache; i < nBytes; i += 4) {\n\t\t\t\t\t\t\t\tvar _r = r((rcache || Math.random()) * 0x100000000);\n\n\t\t\t\t\t\t\t\trcache = _r() * 0x3ade67b7;\n\t\t\t\t\t\t\t\twords.push(_r() * 0x100000000 | 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, nBytes);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Encoder namespace.\n */\n\t\t\t\t\tvar C_enc = C.enc = {};\n\n\t\t\t\t\t/**\n * Hex encoding strategy.\n */\n\t\t\t\t\tvar Hex = C_enc.Hex = {\n\t\t\t\t\t\t/**\n * Converts a word array to a hex string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The hex string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar hexChars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i++) {\n\t\t\t\t\t\t\t\tvar bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\thexChars.push((bite >>> 4).toString(16));\n\t\t\t\t\t\t\t\thexChars.push((bite & 0x0f).toString(16));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn hexChars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a hex string to a word array.\n *\n * @param {string} hexStr The hex string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n */\n\t\t\t\t\t\tparse: function parse(hexStr) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hexStrLength = hexStr.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < hexStrLength; i += 2) {\n\t\t\t\t\t\t\t\twords[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, hexStrLength / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Latin1 encoding strategy.\n */\n\t\t\t\t\tvar Latin1 = C_enc.Latin1 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a Latin1 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Latin1 string.\n *\n * @static\n *\n * @example\n *\n * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar latin1Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i++) {\n\t\t\t\t\t\t\t\tvar bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tlatin1Chars.push(String.fromCharCode(bite));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn latin1Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a Latin1 string to a word array.\n *\n * @param {string} latin1Str The Latin1 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n */\n\t\t\t\t\t\tparse: function parse(latin1Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar latin1StrLength = latin1Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < latin1StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, latin1StrLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * UTF-8 encoding strategy.\n */\n\t\t\t\t\tvar Utf8 = C_enc.Utf8 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-8 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-8 string.\n *\n * @static\n *\n * @example\n *\n * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\treturn decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tthrow new Error('Malformed UTF-8 data');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-8 string to a word array.\n *\n * @param {string} utf8Str The UTF-8 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n */\n\t\t\t\t\t\tparse: function parse(utf8Str) {\n\t\t\t\t\t\t\treturn Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Abstract buffered block algorithm template.\n *\n * The property blockSize must be implemented in a concrete subtype.\n *\n * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n */\n\t\t\t\t\tvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t\t\t\t\t\t/**\n * Resets this block algorithm's data buffer to its initial state.\n *\n * @example\n *\n * bufferedBlockAlgorithm.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tthis._data = new WordArray.init();\n\t\t\t\t\t\t\tthis._nDataBytes = 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Adds new data to this block algorithm's buffer.\n *\n * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n *\n * @example\n *\n * bufferedBlockAlgorithm._append('data');\n * bufferedBlockAlgorithm._append(wordArray);\n */\n\t\t\t\t\t\t_append: function _append(data) {\n\t\t\t\t\t\t\t// Convert string to WordArray, else assume WordArray already\n\t\t\t\t\t\t\tif (typeof data == 'string') {\n\t\t\t\t\t\t\t\tdata = Utf8.parse(data);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._data.concat(data);\n\t\t\t\t\t\t\tthis._nDataBytes += data.sigBytes;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Processes available data blocks.\n *\n * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n *\n * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n *\n * @return {WordArray} The processed data.\n *\n * @example\n *\n * var processedData = bufferedBlockAlgorithm._process();\n * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n */\n\t\t\t\t\t\t_process: function _process(doFlush) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\t\t\t\t\t\t\tvar dataSigBytes = data.sigBytes;\n\t\t\t\t\t\t\tvar blockSize = this.blockSize;\n\t\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t\t// Count blocks ready\n\t\t\t\t\t\t\tvar nBlocksReady = dataSigBytes / blockSizeBytes;\n\t\t\t\t\t\t\tif (doFlush) {\n\t\t\t\t\t\t\t\t// Round up to include partial blocks\n\t\t\t\t\t\t\t\tnBlocksReady = Math.ceil(nBlocksReady);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Round down to include only full blocks,\n\t\t\t\t\t\t\t\t// less the number of blocks that must remain in the buffer\n\t\t\t\t\t\t\t\tnBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Count words ready\n\t\t\t\t\t\t\tvar nWordsReady = nBlocksReady * blockSize;\n\n\t\t\t\t\t\t\t// Count bytes ready\n\t\t\t\t\t\t\tvar nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t\t\t\t\t\t\t// Process blocks\n\t\t\t\t\t\t\tif (nWordsReady) {\n\t\t\t\t\t\t\t\tfor (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t\t\t\t\t\t\t\t\t// Perform concrete-algorithm logic\n\t\t\t\t\t\t\t\t\tthis._doProcessBlock(dataWords, offset);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Remove processed words\n\t\t\t\t\t\t\t\tvar processedWords = dataWords.splice(0, nWordsReady);\n\t\t\t\t\t\t\t\tdata.sigBytes -= nBytesReady;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return processed words\n\t\t\t\t\t\t\treturn new WordArray.init(processedWords, nBytesReady);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = bufferedBlockAlgorithm.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\t\t\t\t\t\t\tclone._data = this._data.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_minBufferSize: 0\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Abstract hasher template.\n *\n * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n */\n\t\t\t\t\tvar Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n */\n\t\t\t\t\t\tcfg: Base.extend(),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created hasher.\n *\n * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n *\n * @example\n *\n * var hasher = CryptoJS.algo.SHA256.create();\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this hasher to its initial state.\n *\n * @example\n *\n * hasher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset data buffer\n\t\t\t\t\t\t\tBufferedBlockAlgorithm.reset.call(this);\n\n\t\t\t\t\t\t\t// Perform concrete-hasher logic\n\t\t\t\t\t\t\tthis._doReset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Updates this hasher with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {Hasher} This hasher.\n *\n * @example\n *\n * hasher.update('message');\n * hasher.update(wordArray);\n */\n\t\t\t\t\t\tupdate: function update(messageUpdate) {\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._append(messageUpdate);\n\n\t\t\t\t\t\t\t// Update the hash\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the hash computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The hash.\n *\n * @example\n *\n * var hash = hasher.finalize();\n * var hash = hasher.finalize('message');\n * var hash = hasher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(messageUpdate) {\n\t\t\t\t\t\t\t// Final message update\n\t\t\t\t\t\t\tif (messageUpdate) {\n\t\t\t\t\t\t\t\tthis._append(messageUpdate);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Perform concrete-hasher logic\n\t\t\t\t\t\t\tvar hash = this._doFinalize();\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 512 / 32,\n\n\t\t\t\t\t\t/**\n * Creates a shortcut function to a hasher's object interface.\n *\n * @param {Hasher} hasher The hasher to create a helper for.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n */\n\t\t\t\t\t\t_createHelper: function _createHelper(hasher) {\n\t\t\t\t\t\t\treturn function (message, cfg) {\n\t\t\t\t\t\t\t\treturn new hasher.init(cfg).finalize(message);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a shortcut function to the HMAC's object interface.\n *\n * @param {Hasher} hasher The hasher to use in this HMAC helper.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n */\n\t\t\t\t\t\t_createHmacHelper: function _createHmacHelper(hasher) {\n\t\t\t\t\t\t\treturn function (message, key) {\n\t\t\t\t\t\t\t\treturn new C_algo.HMAC.init(hasher, key).finalize(message);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Algorithm namespace.\n */\n\t\t\t\t\tvar C_algo = C.algo = {};\n\n\t\t\t\t\treturn C;\n\t\t\t\t}(Math);\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 7 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar X32WordArray = C_lib.WordArray;\n\n\t\t\t\t\t/**\n * x64 namespace.\n */\n\t\t\t\t\tvar C_x64 = C.x64 = {};\n\n\t\t\t\t\t/**\n * A 64-bit word.\n */\n\t\t\t\t\tvar X64Word = C_x64.Word = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created 64-bit word.\n *\n * @param {number} high The high 32 bits.\n * @param {number} low The low 32 bits.\n *\n * @example\n *\n * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n */\n\t\t\t\t\t\tinit: function init(high, low) {\n\t\t\t\t\t\t\tthis.high = high;\n\t\t\t\t\t\t\tthis.low = low;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n * Bitwise NOTs this word.\n *\n * @return {X64Word} A new x64-Word object after negating.\n *\n * @example\n *\n * var negated = x64Word.not();\n */\n\t\t\t\t\t\t// not: function () {\n\t\t\t\t\t\t// var high = ~this.high;\n\t\t\t\t\t\t// var low = ~this.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise ANDs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to AND with this word.\n *\n * @return {X64Word} A new x64-Word object after ANDing.\n *\n * @example\n *\n * var anded = x64Word.and(anotherX64Word);\n */\n\t\t\t\t\t\t// and: function (word) {\n\t\t\t\t\t\t// var high = this.high & word.high;\n\t\t\t\t\t\t// var low = this.low & word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise ORs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to OR with this word.\n *\n * @return {X64Word} A new x64-Word object after ORing.\n *\n * @example\n *\n * var ored = x64Word.or(anotherX64Word);\n */\n\t\t\t\t\t\t// or: function (word) {\n\t\t\t\t\t\t// var high = this.high | word.high;\n\t\t\t\t\t\t// var low = this.low | word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise XORs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to XOR with this word.\n *\n * @return {X64Word} A new x64-Word object after XORing.\n *\n * @example\n *\n * var xored = x64Word.xor(anotherX64Word);\n */\n\t\t\t\t\t\t// xor: function (word) {\n\t\t\t\t\t\t// var high = this.high ^ word.high;\n\t\t\t\t\t\t// var low = this.low ^ word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Shifts this word n bits to the left.\n *\n * @param {number} n The number of bits to shift.\n *\n * @return {X64Word} A new x64-Word object after shifting.\n *\n * @example\n *\n * var shifted = x64Word.shiftL(25);\n */\n\t\t\t\t\t\t// shiftL: function (n) {\n\t\t\t\t\t\t// if (n < 32) {\n\t\t\t\t\t\t// var high = (this.high << n) | (this.low >>> (32 - n));\n\t\t\t\t\t\t// var low = this.low << n;\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t// var high = this.low << (n - 32);\n\t\t\t\t\t\t// var low = 0;\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Shifts this word n bits to the right.\n *\n * @param {number} n The number of bits to shift.\n *\n * @return {X64Word} A new x64-Word object after shifting.\n *\n * @example\n *\n * var shifted = x64Word.shiftR(7);\n */\n\t\t\t\t\t\t// shiftR: function (n) {\n\t\t\t\t\t\t// if (n < 32) {\n\t\t\t\t\t\t// var low = (this.low >>> n) | (this.high << (32 - n));\n\t\t\t\t\t\t// var high = this.high >>> n;\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t// var low = this.high >>> (n - 32);\n\t\t\t\t\t\t// var high = 0;\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Rotates this word n bits to the left.\n *\n * @param {number} n The number of bits to rotate.\n *\n * @return {X64Word} A new x64-Word object after rotating.\n *\n * @example\n *\n * var rotated = x64Word.rotL(25);\n */\n\t\t\t\t\t\t// rotL: function (n) {\n\t\t\t\t\t\t// return this.shiftL(n).or(this.shiftR(64 - n));\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Rotates this word n bits to the right.\n *\n * @param {number} n The number of bits to rotate.\n *\n * @return {X64Word} A new x64-Word object after rotating.\n *\n * @example\n *\n * var rotated = x64Word.rotR(7);\n */\n\t\t\t\t\t\t// rotR: function (n) {\n\t\t\t\t\t\t// return this.shiftR(n).or(this.shiftL(64 - n));\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Adds this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to add with this word.\n *\n * @return {X64Word} A new x64-Word object after adding.\n *\n * @example\n *\n * var added = x64Word.add(anotherX64Word);\n */\n\t\t\t\t\t\t// add: function (word) {\n\t\t\t\t\t\t// var low = (this.low + word.low) | 0;\n\t\t\t\t\t\t// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;\n\t\t\t\t\t\t// var high = (this.high + word.high + carry) | 0;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// }\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * An array of 64-bit words.\n *\n * @property {Array} words The array of CryptoJS.x64.Word objects.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.x64.WordArray.create();\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ]);\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ], 10);\n */\n\t\t\t\t\t\tinit: function init(words, sigBytes) {\n\t\t\t\t\t\t\twords = this.words = words || [];\n\n\t\t\t\t\t\t\tif (sigBytes != undefined) {\n\t\t\t\t\t\t\t\tthis.sigBytes = sigBytes;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.sigBytes = words.length * 8;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this 64-bit word array to a 32-bit word array.\n *\n * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n *\n * @example\n *\n * var x32WordArray = x64WordArray.toX32();\n */\n\t\t\t\t\t\ttoX32: function toX32() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar x64Words = this.words;\n\t\t\t\t\t\t\tvar x64WordsLength = x64Words.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar x32Words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < x64WordsLength; i++) {\n\t\t\t\t\t\t\t\tvar x64Word = x64Words[i];\n\t\t\t\t\t\t\t\tx32Words.push(x64Word.high);\n\t\t\t\t\t\t\t\tx32Words.push(x64Word.low);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn X32WordArray.create(x32Words, this.sigBytes);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this word array.\n *\n * @return {X64WordArray} The clone.\n *\n * @example\n *\n * var clone = x64WordArray.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\n\t\t\t\t\t\t\t// Clone \"words\" array\n\t\t\t\t\t\t\tvar words = clone.words = this.words.slice(0);\n\n\t\t\t\t\t\t\t// Clone each X64Word object\n\t\t\t\t\t\t\tvar wordsLength = words.length;\n\t\t\t\t\t\t\tfor (var i = 0; i < wordsLength; i++) {\n\t\t\t\t\t\t\t\twords[i] = words[i].clone();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 8 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Check if typed arrays are supported\n\t\t\t\t\tif (typeof ArrayBuffer != 'function') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\n\t\t\t\t\t// Reference original init\n\t\t\t\t\tvar superInit = WordArray.init;\n\n\t\t\t\t\t// Augment WordArray.init to handle typed arrays\n\t\t\t\t\tvar subInit = WordArray.init = function (typedArray) {\n\t\t\t\t\t\t// Convert buffers to uint8\n\t\t\t\t\t\tif (typedArray instanceof ArrayBuffer) {\n\t\t\t\t\t\t\ttypedArray = new Uint8Array(typedArray);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Convert other array views to uint8\n\t\t\t\t\t\tif (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== \"undefined\" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {\n\t\t\t\t\t\t\ttypedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle Uint8Array\n\t\t\t\t\t\tif (typedArray instanceof Uint8Array) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar typedArrayByteLength = typedArray.byteLength;\n\n\t\t\t\t\t\t\t// Extract bytes\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < typedArrayByteLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Initialize this word array\n\t\t\t\t\t\t\tsuperInit.call(this, words, typedArrayByteLength);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Else call normal init\n\t\t\t\t\t\t\tsuperInit.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tsubInit.prototype = WordArray;\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.lib.WordArray;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 9 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_enc = C.enc;\n\n\t\t\t\t\t/**\n * UTF-16 BE encoding strategy.\n */\n\t\t\t\t\tvar Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-16 BE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 BE string.\n *\n * @static\n *\n * @example\n *\n * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar utf16Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 2) {\n\t\t\t\t\t\t\t\tvar codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff;\n\t\t\t\t\t\t\t\tutf16Chars.push(String.fromCharCode(codePoint));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn utf16Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-16 BE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 BE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);\n */\n\t\t\t\t\t\tparse: function parse(utf16Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar utf16StrLength = utf16Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < utf16StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn WordArray.create(words, utf16StrLength * 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * UTF-16 LE encoding strategy.\n */\n\t\t\t\t\tC_enc.Utf16LE = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-16 LE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 LE string.\n *\n * @static\n *\n * @example\n *\n * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar utf16Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 2) {\n\t\t\t\t\t\t\t\tvar codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff);\n\t\t\t\t\t\t\t\tutf16Chars.push(String.fromCharCode(codePoint));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn utf16Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-16 LE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 LE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);\n */\n\t\t\t\t\t\tparse: function parse(utf16Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar utf16StrLength = utf16Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < utf16StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn WordArray.create(words, utf16StrLength * 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tfunction swapEndian(word) {\n\t\t\t\t\t\treturn word << 8 & 0xff00ff00 | word >>> 8 & 0x00ff00ff;\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.enc.Utf16;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 10 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_enc = C.enc;\n\n\t\t\t\t\t/**\n * Base64 encoding strategy.\n */\n\t\t\t\t\tvar Base64 = C_enc.Base64 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a Base64 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Base64 string.\n *\n * @static\n *\n * @example\n *\n * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\t\t\t\t\t\t\tvar map = this._map;\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\twordArray.clamp();\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar base64Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 3) {\n\t\t\t\t\t\t\t\tvar byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tvar byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tvar byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff;\n\n\t\t\t\t\t\t\t\tvar triplet = byte1 << 16 | byte2 << 8 | byte3;\n\n\t\t\t\t\t\t\t\tfor (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {\n\t\t\t\t\t\t\t\t\tbase64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tvar paddingChar = map.charAt(64);\n\t\t\t\t\t\t\tif (paddingChar) {\n\t\t\t\t\t\t\t\twhile (base64Chars.length % 4) {\n\t\t\t\t\t\t\t\t\tbase64Chars.push(paddingChar);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn base64Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a Base64 string to a word array.\n *\n * @param {string} base64Str The Base64 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n */\n\t\t\t\t\t\tparse: function parse(base64Str) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar base64StrLength = base64Str.length;\n\t\t\t\t\t\t\tvar map = this._map;\n\t\t\t\t\t\t\tvar reverseMap = this._reverseMap;\n\n\t\t\t\t\t\t\tif (!reverseMap) {\n\t\t\t\t\t\t\t\treverseMap = this._reverseMap = [];\n\t\t\t\t\t\t\t\tfor (var j = 0; j < map.length; j++) {\n\t\t\t\t\t\t\t\t\treverseMap[map.charCodeAt(j)] = j;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Ignore padding\n\t\t\t\t\t\t\tvar paddingChar = map.charAt(64);\n\t\t\t\t\t\t\tif (paddingChar) {\n\t\t\t\t\t\t\t\tvar paddingIndex = base64Str.indexOf(paddingChar);\n\t\t\t\t\t\t\t\tif (paddingIndex !== -1) {\n\t\t\t\t\t\t\t\t\tbase64StrLength = paddingIndex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\treturn parseLoop(base64Str, base64StrLength, reverseMap);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t\t\t\t\t};\n\n\t\t\t\t\tfunction parseLoop(base64Str, base64StrLength, reverseMap) {\n\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\tvar nBytes = 0;\n\t\t\t\t\t\tfor (var i = 0; i < base64StrLength; i++) {\n\t\t\t\t\t\t\tif (i % 4) {\n\t\t\t\t\t\t\t\tvar bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;\n\t\t\t\t\t\t\t\tvar bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;\n\t\t\t\t\t\t\t\twords[nBytes >>> 2] |= (bits1 | bits2) << 24 - nBytes % 4 * 8;\n\t\t\t\t\t\t\t\tnBytes++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn WordArray.create(words, nBytes);\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.enc.Base64;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 11 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants table\n\t\t\t\t\tvar T = [];\n\n\t\t\t\t\t// Compute constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 64; i++) {\n\t\t\t\t\t\t\tT[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * MD5 hash algorithm.\n */\n\t\t\t\t\tvar MD5 = C_algo.MD5 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar offset_i = offset + i;\n\t\t\t\t\t\t\t\tvar M_offset_i = M[offset_i];\n\n\t\t\t\t\t\t\t\tM[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\tvar M_offset_0 = M[offset + 0];\n\t\t\t\t\t\t\tvar M_offset_1 = M[offset + 1];\n\t\t\t\t\t\t\tvar M_offset_2 = M[offset + 2];\n\t\t\t\t\t\t\tvar M_offset_3 = M[offset + 3];\n\t\t\t\t\t\t\tvar M_offset_4 = M[offset + 4];\n\t\t\t\t\t\t\tvar M_offset_5 = M[offset + 5];\n\t\t\t\t\t\t\tvar M_offset_6 = M[offset + 6];\n\t\t\t\t\t\t\tvar M_offset_7 = M[offset + 7];\n\t\t\t\t\t\t\tvar M_offset_8 = M[offset + 8];\n\t\t\t\t\t\t\tvar M_offset_9 = M[offset + 9];\n\t\t\t\t\t\t\tvar M_offset_10 = M[offset + 10];\n\t\t\t\t\t\t\tvar M_offset_11 = M[offset + 11];\n\t\t\t\t\t\t\tvar M_offset_12 = M[offset + 12];\n\t\t\t\t\t\t\tvar M_offset_13 = M[offset + 13];\n\t\t\t\t\t\t\tvar M_offset_14 = M[offset + 14];\n\t\t\t\t\t\t\tvar M_offset_15 = M[offset + 15];\n\n\t\t\t\t\t\t\t// Working varialbes\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\n\t\t\t\t\t\t\tvar nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tvar nBitsTotalL = nBitsTotal;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\tdata.sigBytes = (dataWords.length + 1) * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hash = this._hash;\n\t\t\t\t\t\t\tvar H = hash.words;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar H_i = H[i];\n\n\t\t\t\t\t\t\t\tH[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction FF(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b & c | ~b & d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction GG(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b & d | c & ~d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction HH(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b ^ c ^ d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction II(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (c ^ (b | ~d)) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.MD5('message');\n * var hash = CryptoJS.MD5(wordArray);\n */\n\t\t\t\t\tC.MD5 = Hasher._createHelper(MD5);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacMD5(message, key);\n */\n\t\t\t\t\tC.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.MD5;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 12 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable object\n\t\t\t\t\tvar W = [];\n\n\t\t\t\t\t/**\n * SHA-1 hash algorithm.\n */\n\t\t\t\t\tvar SHA1 = C_algo.SHA1 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\t\t\t\t\t\t\tvar e = H[4];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tW[i] = M[offset + i] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t\t\t\t\t\t\t\t\tW[i] = n << 1 | n >>> 31;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar t = (a << 5 | a >>> 27) + e + W[i];\n\t\t\t\t\t\t\t\tif (i < 20) {\n\t\t\t\t\t\t\t\t\tt += (b & c | ~b & d) + 0x5a827999;\n\t\t\t\t\t\t\t\t} else if (i < 40) {\n\t\t\t\t\t\t\t\t\tt += (b ^ c ^ d) + 0x6ed9eba1;\n\t\t\t\t\t\t\t\t} else if (i < 60) {\n\t\t\t\t\t\t\t\t\tt += (b & c | b & d | c & d) - 0x70e44324;\n\t\t\t\t\t\t\t\t} else /* if (i < 80) */{\n\t\t\t\t\t\t\t\t\t\tt += (b ^ c ^ d) - 0x359d3e2a;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\te = d;\n\t\t\t\t\t\t\t\td = c;\n\t\t\t\t\t\t\t\tc = b << 30 | b >>> 2;\n\t\t\t\t\t\t\t\tb = a;\n\t\t\t\t\t\t\t\ta = t;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t\tH[4] = H[4] + e | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn this._hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA1('message');\n * var hash = CryptoJS.SHA1(wordArray);\n */\n\t\t\t\t\tC.SHA1 = Hasher._createHelper(SHA1);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA1(message, key);\n */\n\t\t\t\t\tC.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA1;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 13 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Initialization and round constants tables\n\t\t\t\t\tvar H = [];\n\t\t\t\t\tvar K = [];\n\n\t\t\t\t\t// Compute constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfunction isPrime(n) {\n\t\t\t\t\t\t\tvar sqrtN = Math.sqrt(n);\n\t\t\t\t\t\t\tfor (var factor = 2; factor <= sqrtN; factor++) {\n\t\t\t\t\t\t\t\tif (!(n % factor)) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction getFractionalBits(n) {\n\t\t\t\t\t\t\treturn (n - (n | 0)) * 0x100000000 | 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar n = 2;\n\t\t\t\t\t\tvar nPrime = 0;\n\t\t\t\t\t\twhile (nPrime < 64) {\n\t\t\t\t\t\t\tif (isPrime(n)) {\n\t\t\t\t\t\t\t\tif (nPrime < 8) {\n\t\t\t\t\t\t\t\t\tH[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tK[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t\t\t\t\t\t\t\tnPrime++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tn++;\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Reusable object\n\t\t\t\t\tvar W = [];\n\n\t\t\t\t\t/**\n * SHA-256 hash algorithm.\n */\n\t\t\t\t\tvar SHA256 = C_algo.SHA256 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init(H.slice(0));\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\t\t\t\t\t\t\tvar e = H[4];\n\t\t\t\t\t\t\tvar f = H[5];\n\t\t\t\t\t\t\tvar g = H[6];\n\t\t\t\t\t\t\tvar h = H[7];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tfor (var i = 0; i < 64; i++) {\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tW[i] = M[offset + i] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar gamma0x = W[i - 15];\n\t\t\t\t\t\t\t\t\tvar gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;\n\n\t\t\t\t\t\t\t\t\tvar gamma1x = W[i - 2];\n\t\t\t\t\t\t\t\t\tvar gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;\n\n\t\t\t\t\t\t\t\t\tW[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar ch = e & f ^ ~e & g;\n\t\t\t\t\t\t\t\tvar maj = a & b ^ a & c ^ b & c;\n\n\t\t\t\t\t\t\t\tvar sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);\n\t\t\t\t\t\t\t\tvar sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);\n\n\t\t\t\t\t\t\t\tvar t1 = h + sigma1 + ch + K[i] + W[i];\n\t\t\t\t\t\t\t\tvar t2 = sigma0 + maj;\n\n\t\t\t\t\t\t\t\th = g;\n\t\t\t\t\t\t\t\tg = f;\n\t\t\t\t\t\t\t\tf = e;\n\t\t\t\t\t\t\t\te = d + t1 | 0;\n\t\t\t\t\t\t\t\td = c;\n\t\t\t\t\t\t\t\tc = b;\n\t\t\t\t\t\t\t\tb = a;\n\t\t\t\t\t\t\t\ta = t1 + t2 | 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t\tH[4] = H[4] + e | 0;\n\t\t\t\t\t\t\tH[5] = H[5] + f | 0;\n\t\t\t\t\t\t\tH[6] = H[6] + g | 0;\n\t\t\t\t\t\t\tH[7] = H[7] + h | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn this._hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA256('message');\n * var hash = CryptoJS.SHA256(wordArray);\n */\n\t\t\t\t\tC.SHA256 = Hasher._createHelper(SHA256);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA256(message, key);\n */\n\t\t\t\t\tC.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.SHA256;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 14 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(13));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha256\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA256 = C_algo.SHA256;\n\n\t\t\t\t\t/**\n * SHA-224 hash algorithm.\n */\n\t\t\t\t\tvar SHA224 = C_algo.SHA224 = SHA256.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\tvar hash = SHA256._doFinalize.call(this);\n\n\t\t\t\t\t\t\thash.sigBytes -= 4;\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA224('message');\n * var hash = CryptoJS.SHA224(wordArray);\n */\n\t\t\t\t\tC.SHA224 = SHA256._createHelper(SHA224);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA224(message, key);\n */\n\t\t\t\t\tC.HmacSHA224 = SHA256._createHmacHelper(SHA224);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA224;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 15 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\tfunction X64Word_create() {\n\t\t\t\t\t\treturn X64Word.create.apply(X64Word, arguments);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Constants\n\t\t\t\t\tvar K = [X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)];\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar W = [];\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\tW[i] = X64Word_create();\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * SHA-512 hash algorithm.\n */\n\t\t\t\t\tvar SHA512 = C_algo.SHA512 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new X64WordArray.init([new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\tvar H0 = H[0];\n\t\t\t\t\t\t\tvar H1 = H[1];\n\t\t\t\t\t\t\tvar H2 = H[2];\n\t\t\t\t\t\t\tvar H3 = H[3];\n\t\t\t\t\t\t\tvar H4 = H[4];\n\t\t\t\t\t\t\tvar H5 = H[5];\n\t\t\t\t\t\t\tvar H6 = H[6];\n\t\t\t\t\t\t\tvar H7 = H[7];\n\n\t\t\t\t\t\t\tvar H0h = H0.high;\n\t\t\t\t\t\t\tvar H0l = H0.low;\n\t\t\t\t\t\t\tvar H1h = H1.high;\n\t\t\t\t\t\t\tvar H1l = H1.low;\n\t\t\t\t\t\t\tvar H2h = H2.high;\n\t\t\t\t\t\t\tvar H2l = H2.low;\n\t\t\t\t\t\t\tvar H3h = H3.high;\n\t\t\t\t\t\t\tvar H3l = H3.low;\n\t\t\t\t\t\t\tvar H4h = H4.high;\n\t\t\t\t\t\t\tvar H4l = H4.low;\n\t\t\t\t\t\t\tvar H5h = H5.high;\n\t\t\t\t\t\t\tvar H5l = H5.low;\n\t\t\t\t\t\t\tvar H6h = H6.high;\n\t\t\t\t\t\t\tvar H6l = H6.low;\n\t\t\t\t\t\t\tvar H7h = H7.high;\n\t\t\t\t\t\t\tvar H7l = H7.low;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar ah = H0h;\n\t\t\t\t\t\t\tvar al = H0l;\n\t\t\t\t\t\t\tvar bh = H1h;\n\t\t\t\t\t\t\tvar bl = H1l;\n\t\t\t\t\t\t\tvar ch = H2h;\n\t\t\t\t\t\t\tvar cl = H2l;\n\t\t\t\t\t\t\tvar dh = H3h;\n\t\t\t\t\t\t\tvar dl = H3l;\n\t\t\t\t\t\t\tvar eh = H4h;\n\t\t\t\t\t\t\tvar el = H4l;\n\t\t\t\t\t\t\tvar fh = H5h;\n\t\t\t\t\t\t\tvar fl = H5l;\n\t\t\t\t\t\t\tvar gh = H6h;\n\t\t\t\t\t\t\tvar gl = H6l;\n\t\t\t\t\t\t\tvar hh = H7h;\n\t\t\t\t\t\t\tvar hl = H7l;\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar Wi = W[i];\n\n\t\t\t\t\t\t\t\t// Extend message\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tvar Wih = Wi.high = M[offset + i * 2] | 0;\n\t\t\t\t\t\t\t\t\tvar Wil = Wi.low = M[offset + i * 2 + 1] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Gamma0\n\t\t\t\t\t\t\t\t\tvar gamma0x = W[i - 15];\n\t\t\t\t\t\t\t\t\tvar gamma0xh = gamma0x.high;\n\t\t\t\t\t\t\t\t\tvar gamma0xl = gamma0x.low;\n\t\t\t\t\t\t\t\t\tvar gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;\n\t\t\t\t\t\t\t\t\tvar gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);\n\n\t\t\t\t\t\t\t\t\t// Gamma1\n\t\t\t\t\t\t\t\t\tvar gamma1x = W[i - 2];\n\t\t\t\t\t\t\t\t\tvar gamma1xh = gamma1x.high;\n\t\t\t\t\t\t\t\t\tvar gamma1xl = gamma1x.low;\n\t\t\t\t\t\t\t\t\tvar gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;\n\t\t\t\t\t\t\t\t\tvar gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);\n\n\t\t\t\t\t\t\t\t\t// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n\t\t\t\t\t\t\t\t\tvar Wi7 = W[i - 7];\n\t\t\t\t\t\t\t\t\tvar Wi7h = Wi7.high;\n\t\t\t\t\t\t\t\t\tvar Wi7l = Wi7.low;\n\n\t\t\t\t\t\t\t\t\tvar Wi16 = W[i - 16];\n\t\t\t\t\t\t\t\t\tvar Wi16h = Wi16.high;\n\t\t\t\t\t\t\t\t\tvar Wi16l = Wi16.low;\n\n\t\t\t\t\t\t\t\t\tvar Wil = gamma0l + Wi7l;\n\t\t\t\t\t\t\t\t\tvar Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\t\tvar Wil = Wil + gamma1l;\n\t\t\t\t\t\t\t\t\tvar Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\t\tvar Wil = Wil + Wi16l;\n\t\t\t\t\t\t\t\t\tvar Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t\tWi.high = Wih;\n\t\t\t\t\t\t\t\t\tWi.low = Wil;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar chh = eh & fh ^ ~eh & gh;\n\t\t\t\t\t\t\t\tvar chl = el & fl ^ ~el & gl;\n\t\t\t\t\t\t\t\tvar majh = ah & bh ^ ah & ch ^ bh & ch;\n\t\t\t\t\t\t\t\tvar majl = al & bl ^ al & cl ^ bl & cl;\n\n\t\t\t\t\t\t\t\tvar sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);\n\t\t\t\t\t\t\t\tvar sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);\n\t\t\t\t\t\t\t\tvar sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);\n\t\t\t\t\t\t\t\tvar sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);\n\n\t\t\t\t\t\t\t\t// t1 = h + sigma1 + ch + K[i] + W[i]\n\t\t\t\t\t\t\t\tvar Ki = K[i];\n\t\t\t\t\t\t\t\tvar Kih = Ki.high;\n\t\t\t\t\t\t\t\tvar Kil = Ki.low;\n\n\t\t\t\t\t\t\t\tvar t1l = hl + sigma1l;\n\t\t\t\t\t\t\t\tvar t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + chl;\n\t\t\t\t\t\t\t\tvar t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + Kil;\n\t\t\t\t\t\t\t\tvar t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + Wil;\n\t\t\t\t\t\t\t\tvar t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t// t2 = sigma0 + maj\n\t\t\t\t\t\t\t\tvar t2l = sigma0l + majl;\n\t\t\t\t\t\t\t\tvar t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t// Update working variables\n\t\t\t\t\t\t\t\thh = gh;\n\t\t\t\t\t\t\t\thl = gl;\n\t\t\t\t\t\t\t\tgh = fh;\n\t\t\t\t\t\t\t\tgl = fl;\n\t\t\t\t\t\t\t\tfh = eh;\n\t\t\t\t\t\t\t\tfl = el;\n\t\t\t\t\t\t\t\tel = dl + t1l | 0;\n\t\t\t\t\t\t\t\teh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\t\t\tdh = ch;\n\t\t\t\t\t\t\t\tdl = cl;\n\t\t\t\t\t\t\t\tch = bh;\n\t\t\t\t\t\t\t\tcl = bl;\n\t\t\t\t\t\t\t\tbh = ah;\n\t\t\t\t\t\t\t\tbl = al;\n\t\t\t\t\t\t\t\tal = t1l + t2l | 0;\n\t\t\t\t\t\t\t\tah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH0l = H0.low = H0l + al;\n\t\t\t\t\t\t\tH0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH1l = H1.low = H1l + bl;\n\t\t\t\t\t\t\tH1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH2l = H2.low = H2l + cl;\n\t\t\t\t\t\t\tH2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH3l = H3.low = H3l + dl;\n\t\t\t\t\t\t\tH3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH4l = H4.low = H4l + el;\n\t\t\t\t\t\t\tH4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH5l = H5.low = H5l + fl;\n\t\t\t\t\t\t\tH5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH6l = H6.low = H6l + gl;\n\t\t\t\t\t\t\tH6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH7l = H7.low = H7l + hl;\n\t\t\t\t\t\t\tH7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Convert hash to 32-bit word array before returning\n\t\t\t\t\t\t\tvar hash = this._hash.toX32();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 1024 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA512('message');\n * var hash = CryptoJS.SHA512(wordArray);\n */\n\t\t\t\t\tC.SHA512 = Hasher._createHelper(SHA512);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA512(message, key);\n */\n\t\t\t\t\tC.HmacSHA512 = Hasher._createHmacHelper(SHA512);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA512;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 16 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(15));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\", \"./sha512\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA512 = C_algo.SHA512;\n\n\t\t\t\t\t/**\n * SHA-384 hash algorithm.\n */\n\t\t\t\t\tvar SHA384 = C_algo.SHA384 = SHA512.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new X64WordArray.init([new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\tvar hash = SHA512._doFinalize.call(this);\n\n\t\t\t\t\t\t\thash.sigBytes -= 16;\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA384('message');\n * var hash = CryptoJS.SHA384(wordArray);\n */\n\t\t\t\t\tC.SHA384 = SHA512._createHelper(SHA384);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA384(message, key);\n */\n\t\t\t\t\tC.HmacSHA384 = SHA512._createHmacHelper(SHA384);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA384;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 17 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants tables\n\t\t\t\t\tvar RHO_OFFSETS = [];\n\t\t\t\t\tvar PI_INDEXES = [];\n\t\t\t\t\tvar ROUND_CONSTANTS = [];\n\n\t\t\t\t\t// Compute Constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t// Compute rho offset constants\n\t\t\t\t\t\tvar x = 1,\n\t\t\t\t\t\t y = 0;\n\t\t\t\t\t\tfor (var t = 0; t < 24; t++) {\n\t\t\t\t\t\t\tRHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;\n\n\t\t\t\t\t\t\tvar newX = y % 5;\n\t\t\t\t\t\t\tvar newY = (2 * x + 3 * y) % 5;\n\t\t\t\t\t\t\tx = newX;\n\t\t\t\t\t\t\ty = newY;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Compute pi index constants\n\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\tPI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Compute round constants\n\t\t\t\t\t\tvar LFSR = 0x01;\n\t\t\t\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\t\t\t\tvar roundConstantMsw = 0;\n\t\t\t\t\t\t\tvar roundConstantLsw = 0;\n\n\t\t\t\t\t\t\tfor (var j = 0; j < 7; j++) {\n\t\t\t\t\t\t\t\tif (LFSR & 0x01) {\n\t\t\t\t\t\t\t\t\tvar bitPosition = (1 << j) - 1;\n\t\t\t\t\t\t\t\t\tif (bitPosition < 32) {\n\t\t\t\t\t\t\t\t\t\troundConstantLsw ^= 1 << bitPosition;\n\t\t\t\t\t\t\t\t\t} else /* if (bitPosition >= 32) */{\n\t\t\t\t\t\t\t\t\t\t\troundConstantMsw ^= 1 << bitPosition - 32;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Compute next LFSR\n\t\t\t\t\t\t\t\tif (LFSR & 0x80) {\n\t\t\t\t\t\t\t\t\t// Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n\t\t\t\t\t\t\t\t\tLFSR = LFSR << 1 ^ 0x71;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tLFSR <<= 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Reusable objects for temporary values\n\t\t\t\t\tvar T = [];\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\tT[i] = X64Word.create();\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * SHA-3 hash algorithm.\n */\n\t\t\t\t\tvar SHA3 = C_algo.SHA3 = Hasher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} outputLength\n * The desired number of bits in the output hash.\n * Only values permitted are: 224, 256, 384, 512.\n * Default: 512\n */\n\t\t\t\t\t\tcfg: Hasher.cfg.extend({\n\t\t\t\t\t\t\toutputLength: 512\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tvar state = this._state = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\t\tstate[i] = new X64Word.init();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar state = this._state;\n\t\t\t\t\t\t\tvar nBlockSizeLanes = this.blockSize / 2;\n\n\t\t\t\t\t\t\t// Absorb\n\t\t\t\t\t\t\tfor (var i = 0; i < nBlockSizeLanes; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar M2i = M[offset + 2 * i];\n\t\t\t\t\t\t\t\tvar M2i1 = M[offset + 2 * i + 1];\n\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tM2i = (M2i << 8 | M2i >>> 24) & 0x00ff00ff | (M2i << 24 | M2i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tM2i1 = (M2i1 << 8 | M2i1 >>> 24) & 0x00ff00ff | (M2i1 << 24 | M2i1 >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Absorb message into state\n\t\t\t\t\t\t\t\tvar lane = state[i];\n\t\t\t\t\t\t\t\tlane.high ^= M2i1;\n\t\t\t\t\t\t\t\tlane.low ^= M2i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 0; round < 24; round++) {\n\t\t\t\t\t\t\t\t// Theta\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\t// Mix column lanes\n\t\t\t\t\t\t\t\t\tvar tMsw = 0,\n\t\t\t\t\t\t\t\t\t tLsw = 0;\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\tvar lane = state[x + 5 * y];\n\t\t\t\t\t\t\t\t\t\ttMsw ^= lane.high;\n\t\t\t\t\t\t\t\t\t\ttLsw ^= lane.low;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Temporary values\n\t\t\t\t\t\t\t\t\tvar Tx = T[x];\n\t\t\t\t\t\t\t\t\tTx.high = tMsw;\n\t\t\t\t\t\t\t\t\tTx.low = tLsw;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\tvar Tx4 = T[(x + 4) % 5];\n\t\t\t\t\t\t\t\t\tvar Tx1 = T[(x + 1) % 5];\n\t\t\t\t\t\t\t\t\tvar Tx1Msw = Tx1.high;\n\t\t\t\t\t\t\t\t\tvar Tx1Lsw = Tx1.low;\n\n\t\t\t\t\t\t\t\t\t// Mix surrounding columns\n\t\t\t\t\t\t\t\t\tvar tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);\n\t\t\t\t\t\t\t\t\tvar tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\tvar lane = state[x + 5 * y];\n\t\t\t\t\t\t\t\t\t\tlane.high ^= tMsw;\n\t\t\t\t\t\t\t\t\t\tlane.low ^= tLsw;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Rho Pi\n\t\t\t\t\t\t\t\tfor (var laneIndex = 1; laneIndex < 25; laneIndex++) {\n\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\tvar lane = state[laneIndex];\n\t\t\t\t\t\t\t\t\tvar laneMsw = lane.high;\n\t\t\t\t\t\t\t\t\tvar laneLsw = lane.low;\n\t\t\t\t\t\t\t\t\tvar rhoOffset = RHO_OFFSETS[laneIndex];\n\n\t\t\t\t\t\t\t\t\t// Rotate lanes\n\t\t\t\t\t\t\t\t\tif (rhoOffset < 32) {\n\t\t\t\t\t\t\t\t\t\tvar tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\tvar tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;\n\t\t\t\t\t\t\t\t\t} else /* if (rhoOffset >= 32) */{\n\t\t\t\t\t\t\t\t\t\t\tvar tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\t\tvar tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Transpose lanes\n\t\t\t\t\t\t\t\t\tvar TPiLane = T[PI_INDEXES[laneIndex]];\n\t\t\t\t\t\t\t\t\tTPiLane.high = tMsw;\n\t\t\t\t\t\t\t\t\tTPiLane.low = tLsw;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Rho pi at x = y = 0\n\t\t\t\t\t\t\t\tvar T0 = T[0];\n\t\t\t\t\t\t\t\tvar state0 = state[0];\n\t\t\t\t\t\t\t\tT0.high = state0.high;\n\t\t\t\t\t\t\t\tT0.low = state0.low;\n\n\t\t\t\t\t\t\t\t// Chi\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\t\tvar laneIndex = x + 5 * y;\n\t\t\t\t\t\t\t\t\t\tvar lane = state[laneIndex];\n\t\t\t\t\t\t\t\t\t\tvar TLane = T[laneIndex];\n\t\t\t\t\t\t\t\t\t\tvar Tx1Lane = T[(x + 1) % 5 + 5 * y];\n\t\t\t\t\t\t\t\t\t\tvar Tx2Lane = T[(x + 2) % 5 + 5 * y];\n\n\t\t\t\t\t\t\t\t\t\t// Mix rows\n\t\t\t\t\t\t\t\t\t\tlane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;\n\t\t\t\t\t\t\t\t\t\tlane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Iota\n\t\t\t\t\t\t\t\tvar lane = state[0];\n\t\t\t\t\t\t\t\tvar roundConstant = ROUND_CONSTANTS[round];\n\t\t\t\t\t\t\t\tlane.high ^= roundConstant.high;\n\t\t\t\t\t\t\t\tlane.low ^= roundConstant.low;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\t\t\t\t\t\t\tvar blockSizeBits = this.blockSize * 32;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x1 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 0x80;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar state = this._state;\n\t\t\t\t\t\t\tvar outputLengthBytes = this.cfg.outputLength / 8;\n\t\t\t\t\t\t\tvar outputLengthLanes = outputLengthBytes / 8;\n\n\t\t\t\t\t\t\t// Squeeze\n\t\t\t\t\t\t\tvar hashWords = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < outputLengthLanes; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar lane = state[i];\n\t\t\t\t\t\t\t\tvar laneMsw = lane.high;\n\t\t\t\t\t\t\t\tvar laneLsw = lane.low;\n\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tlaneMsw = (laneMsw << 8 | laneMsw >>> 24) & 0x00ff00ff | (laneMsw << 24 | laneMsw >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tlaneLsw = (laneLsw << 8 | laneLsw >>> 24) & 0x00ff00ff | (laneLsw << 24 | laneLsw >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Squeeze state to retrieve hash\n\t\t\t\t\t\t\t\thashWords.push(laneLsw);\n\t\t\t\t\t\t\t\thashWords.push(laneMsw);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn new WordArray.init(hashWords, outputLengthBytes);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\n\t\t\t\t\t\t\tvar state = clone._state = this._state.slice(0);\n\t\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\t\tstate[i] = state[i].clone();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA3('message');\n * var hash = CryptoJS.SHA3(wordArray);\n */\n\t\t\t\t\tC.SHA3 = Hasher._createHelper(SHA3);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA3(message, key);\n */\n\t\t\t\t\tC.HmacSHA3 = Hasher._createHmacHelper(SHA3);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.SHA3;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 18 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/** @preserve\n (c) 2012 by Cédric Mesnil. All rights reserved.\n \tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n \t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n \tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants table\n\t\t\t\t\tvar _zl = WordArray.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]);\n\t\t\t\t\tvar _zr = WordArray.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]);\n\t\t\t\t\tvar _sl = WordArray.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]);\n\t\t\t\t\tvar _sr = WordArray.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]);\n\n\t\t\t\t\tvar _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\n\t\t\t\t\tvar _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\n\t\t\t\t\t/**\n * RIPEMD160 hash algorithm.\n */\n\t\t\t\t\tvar RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar offset_i = offset + i;\n\t\t\t\t\t\t\t\tvar M_offset_i = M[offset_i];\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tM[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\t\t\t\t\t\t\tvar hl = _hl.words;\n\t\t\t\t\t\t\tvar hr = _hr.words;\n\t\t\t\t\t\t\tvar zl = _zl.words;\n\t\t\t\t\t\t\tvar zr = _zr.words;\n\t\t\t\t\t\t\tvar sl = _sl.words;\n\t\t\t\t\t\t\tvar sr = _sr.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar al, bl, cl, dl, el;\n\t\t\t\t\t\t\tvar ar, br, cr, dr, er;\n\n\t\t\t\t\t\t\tar = al = H[0];\n\t\t\t\t\t\t\tbr = bl = H[1];\n\t\t\t\t\t\t\tcr = cl = H[2];\n\t\t\t\t\t\t\tdr = dl = H[3];\n\t\t\t\t\t\t\ter = el = H[4];\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tvar t;\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i += 1) {\n\t\t\t\t\t\t\t\tt = al + M[offset + zl[i]] | 0;\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tt += f1(bl, cl, dl) + hl[0];\n\t\t\t\t\t\t\t\t} else if (i < 32) {\n\t\t\t\t\t\t\t\t\tt += f2(bl, cl, dl) + hl[1];\n\t\t\t\t\t\t\t\t} else if (i < 48) {\n\t\t\t\t\t\t\t\t\tt += f3(bl, cl, dl) + hl[2];\n\t\t\t\t\t\t\t\t} else if (i < 64) {\n\t\t\t\t\t\t\t\t\tt += f4(bl, cl, dl) + hl[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if (i<80) {\n\t\t\t\t\t\t\t\t\tt += f5(bl, cl, dl) + hl[4];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tt = t | 0;\n\t\t\t\t\t\t\t\tt = rotl(t, sl[i]);\n\t\t\t\t\t\t\t\tt = t + el | 0;\n\t\t\t\t\t\t\t\tal = el;\n\t\t\t\t\t\t\t\tel = dl;\n\t\t\t\t\t\t\t\tdl = rotl(cl, 10);\n\t\t\t\t\t\t\t\tcl = bl;\n\t\t\t\t\t\t\t\tbl = t;\n\n\t\t\t\t\t\t\t\tt = ar + M[offset + zr[i]] | 0;\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tt += f5(br, cr, dr) + hr[0];\n\t\t\t\t\t\t\t\t} else if (i < 32) {\n\t\t\t\t\t\t\t\t\tt += f4(br, cr, dr) + hr[1];\n\t\t\t\t\t\t\t\t} else if (i < 48) {\n\t\t\t\t\t\t\t\t\tt += f3(br, cr, dr) + hr[2];\n\t\t\t\t\t\t\t\t} else if (i < 64) {\n\t\t\t\t\t\t\t\t\tt += f2(br, cr, dr) + hr[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if (i<80) {\n\t\t\t\t\t\t\t\t\tt += f1(br, cr, dr) + hr[4];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tt = t | 0;\n\t\t\t\t\t\t\t\tt = rotl(t, sr[i]);\n\t\t\t\t\t\t\t\tt = t + er | 0;\n\t\t\t\t\t\t\t\tar = er;\n\t\t\t\t\t\t\t\ter = dr;\n\t\t\t\t\t\t\t\tdr = rotl(cr, 10);\n\t\t\t\t\t\t\t\tcr = br;\n\t\t\t\t\t\t\t\tbr = t;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tt = H[1] + cl + dr | 0;\n\t\t\t\t\t\t\tH[1] = H[2] + dl + er | 0;\n\t\t\t\t\t\t\tH[2] = H[3] + el + ar | 0;\n\t\t\t\t\t\t\tH[3] = H[4] + al + br | 0;\n\t\t\t\t\t\t\tH[4] = H[0] + bl + cr | 0;\n\t\t\t\t\t\t\tH[0] = t;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 0x00ff00ff | (nBitsTotal << 24 | nBitsTotal >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\tdata.sigBytes = (dataWords.length + 1) * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hash = this._hash;\n\t\t\t\t\t\t\tvar H = hash.words;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar H_i = H[i];\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tH[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction f1(x, y, z) {\n\t\t\t\t\t\treturn x ^ y ^ z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f2(x, y, z) {\n\t\t\t\t\t\treturn x & y | ~x & z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f3(x, y, z) {\n\t\t\t\t\t\treturn (x | ~y) ^ z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f4(x, y, z) {\n\t\t\t\t\t\treturn x & z | y & ~z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f5(x, y, z) {\n\t\t\t\t\t\treturn x ^ (y | ~z);\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction rotl(x, n) {\n\t\t\t\t\t\treturn x << n | x >>> 32 - n;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.RIPEMD160('message');\n * var hash = CryptoJS.RIPEMD160(wordArray);\n */\n\t\t\t\t\tC.RIPEMD160 = Hasher._createHelper(RIPEMD160);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n */\n\t\t\t\t\tC.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.RIPEMD160;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 19 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Utf8 = C_enc.Utf8;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t/**\n * HMAC algorithm.\n */\n\t\t\t\t\tvar HMAC = C_algo.HMAC = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created HMAC.\n *\n * @param {Hasher} hasher The hash algorithm to use.\n * @param {WordArray|string} key The secret key.\n *\n * @example\n *\n * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n */\n\t\t\t\t\t\tinit: function init(hasher, key) {\n\t\t\t\t\t\t\t// Init hasher\n\t\t\t\t\t\t\thasher = this._hasher = new hasher.init();\n\n\t\t\t\t\t\t\t// Convert string to WordArray, else assume WordArray already\n\t\t\t\t\t\t\tif (typeof key == 'string') {\n\t\t\t\t\t\t\t\tkey = Utf8.parse(key);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hasherBlockSize = hasher.blockSize;\n\t\t\t\t\t\t\tvar hasherBlockSizeBytes = hasherBlockSize * 4;\n\n\t\t\t\t\t\t\t// Allow arbitrary length keys\n\t\t\t\t\t\t\tif (key.sigBytes > hasherBlockSizeBytes) {\n\t\t\t\t\t\t\t\tkey = hasher.finalize(key);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\tkey.clamp();\n\n\t\t\t\t\t\t\t// Clone key for inner and outer pads\n\t\t\t\t\t\t\tvar oKey = this._oKey = key.clone();\n\t\t\t\t\t\t\tvar iKey = this._iKey = key.clone();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar oKeyWords = oKey.words;\n\t\t\t\t\t\t\tvar iKeyWords = iKey.words;\n\n\t\t\t\t\t\t\t// XOR keys with pad constants\n\t\t\t\t\t\t\tfor (var i = 0; i < hasherBlockSize; i++) {\n\t\t\t\t\t\t\t\toKeyWords[i] ^= 0x5c5c5c5c;\n\t\t\t\t\t\t\t\tiKeyWords[i] ^= 0x36363636;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this HMAC to its initial state.\n *\n * @example\n *\n * hmacHasher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hasher = this._hasher;\n\n\t\t\t\t\t\t\t// Reset\n\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\thasher.update(this._iKey);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Updates this HMAC with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {HMAC} This HMAC instance.\n *\n * @example\n *\n * hmacHasher.update('message');\n * hmacHasher.update(wordArray);\n */\n\t\t\t\t\t\tupdate: function update(messageUpdate) {\n\t\t\t\t\t\t\tthis._hasher.update(messageUpdate);\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the HMAC computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The HMAC.\n *\n * @example\n *\n * var hmac = hmacHasher.finalize();\n * var hmac = hmacHasher.finalize('message');\n * var hmac = hmacHasher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(messageUpdate) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hasher = this._hasher;\n\n\t\t\t\t\t\t\t// Compute HMAC\n\t\t\t\t\t\t\tvar innerHash = hasher.finalize(messageUpdate);\n\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\tvar hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n\t\t\t\t\t\t\treturn hmac;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 20 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA1 = C_algo.SHA1;\n\t\t\t\t\tvar HMAC = C_algo.HMAC;\n\n\t\t\t\t\t/**\n * Password-Based Key Derivation Function 2 algorithm.\n */\n\t\t\t\t\tvar PBKDF2 = C_algo.PBKDF2 = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hasher to use. Default: SHA1\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tkeySize: 128 / 32,\n\t\t\t\t\t\t\thasher: SHA1,\n\t\t\t\t\t\t\titerations: 1\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * var kdf = CryptoJS.algo.PBKDF2.create();\n * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });\n * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * var key = kdf.compute(password, salt);\n */\n\t\t\t\t\t\tcompute: function compute(password, salt) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\n\t\t\t\t\t\t\t// Init HMAC\n\t\t\t\t\t\t\tvar hmac = HMAC.create(cfg.hasher, password);\n\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tvar derivedKey = WordArray.create();\n\t\t\t\t\t\t\tvar blockIndex = WordArray.create([0x00000001]);\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar derivedKeyWords = derivedKey.words;\n\t\t\t\t\t\t\tvar blockIndexWords = blockIndex.words;\n\t\t\t\t\t\t\tvar keySize = cfg.keySize;\n\t\t\t\t\t\t\tvar iterations = cfg.iterations;\n\n\t\t\t\t\t\t\t// Generate key\n\t\t\t\t\t\t\twhile (derivedKeyWords.length < keySize) {\n\t\t\t\t\t\t\t\tvar block = hmac.update(salt).finalize(blockIndex);\n\t\t\t\t\t\t\t\thmac.reset();\n\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar blockWords = block.words;\n\t\t\t\t\t\t\t\tvar blockWordsLength = blockWords.length;\n\n\t\t\t\t\t\t\t\t// Iterations\n\t\t\t\t\t\t\t\tvar intermediate = block;\n\t\t\t\t\t\t\t\tfor (var i = 1; i < iterations; i++) {\n\t\t\t\t\t\t\t\t\tintermediate = hmac.finalize(intermediate);\n\t\t\t\t\t\t\t\t\thmac.reset();\n\n\t\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\t\tvar intermediateWords = intermediate.words;\n\n\t\t\t\t\t\t\t\t\t// XOR intermediate with block\n\t\t\t\t\t\t\t\t\tfor (var j = 0; j < blockWordsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tblockWords[j] ^= intermediateWords[j];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tderivedKey.concat(block);\n\t\t\t\t\t\t\t\tblockIndexWords[0]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tderivedKey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\treturn derivedKey;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.PBKDF2(password, salt);\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\tC.PBKDF2 = function (password, salt, cfg) {\n\t\t\t\t\t\treturn PBKDF2.create(cfg).compute(password, salt);\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.PBKDF2;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 21 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar MD5 = C_algo.MD5;\n\n\t\t\t\t\t/**\n * This key derivation function is meant to conform with EVP_BytesToKey.\n * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n */\n\t\t\t\t\tvar EvpKDF = C_algo.EvpKDF = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tkeySize: 128 / 32,\n\t\t\t\t\t\t\thasher: MD5,\n\t\t\t\t\t\t\titerations: 1\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * var kdf = CryptoJS.algo.EvpKDF.create();\n * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * var key = kdf.compute(password, salt);\n */\n\t\t\t\t\t\tcompute: function compute(password, salt) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\n\t\t\t\t\t\t\t// Init hasher\n\t\t\t\t\t\t\tvar hasher = cfg.hasher.create();\n\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tvar derivedKey = WordArray.create();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar derivedKeyWords = derivedKey.words;\n\t\t\t\t\t\t\tvar keySize = cfg.keySize;\n\t\t\t\t\t\t\tvar iterations = cfg.iterations;\n\n\t\t\t\t\t\t\t// Generate key\n\t\t\t\t\t\t\twhile (derivedKeyWords.length < keySize) {\n\t\t\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\t\t\thasher.update(block);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar block = hasher.update(password).finalize(salt);\n\t\t\t\t\t\t\t\thasher.reset();\n\n\t\t\t\t\t\t\t\t// Iterations\n\t\t\t\t\t\t\t\tfor (var i = 1; i < iterations; i++) {\n\t\t\t\t\t\t\t\t\tblock = hasher.finalize(block);\n\t\t\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tderivedKey.concat(block);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tderivedKey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\treturn derivedKey;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.EvpKDF(password, salt);\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\tC.EvpKDF = function (password, salt, cfg) {\n\t\t\t\t\t\treturn EvpKDF.create(cfg).compute(password, salt);\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.EvpKDF;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 22 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(21));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./evpkdf\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Cipher core components.\n */\n\t\t\t\tCryptoJS.lib.Cipher || function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Utf8 = C_enc.Utf8;\n\t\t\t\t\tvar Base64 = C_enc.Base64;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar EvpKDF = C_algo.EvpKDF;\n\n\t\t\t\t\t/**\n * Abstract base cipher template.\n *\n * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n */\n\t\t\t\t\tvar Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {WordArray} iv The IV to use for this operation.\n */\n\t\t\t\t\t\tcfg: Base.extend(),\n\n\t\t\t\t\t\t/**\n * Creates this cipher in encryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tcreateEncryptor: function createEncryptor(key, cfg) {\n\t\t\t\t\t\t\treturn this.create(this._ENC_XFORM_MODE, key, cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates this cipher in decryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tcreateDecryptor: function createDecryptor(key, cfg) {\n\t\t\t\t\t\t\treturn this.create(this._DEC_XFORM_MODE, key, cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Initializes a newly created cipher.\n *\n * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tinit: function init(xformMode, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Store transform mode and key\n\t\t\t\t\t\t\tthis._xformMode = xformMode;\n\t\t\t\t\t\t\tthis._key = key;\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this cipher to its initial state.\n *\n * @example\n *\n * cipher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset data buffer\n\t\t\t\t\t\t\tBufferedBlockAlgorithm.reset.call(this);\n\n\t\t\t\t\t\t\t// Perform concrete-cipher logic\n\t\t\t\t\t\t\tthis._doReset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Adds data to be encrypted or decrypted.\n *\n * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n *\n * @return {WordArray} The data after processing.\n *\n * @example\n *\n * var encrypted = cipher.process('data');\n * var encrypted = cipher.process(wordArray);\n */\n\t\t\t\t\t\tprocess: function process(dataUpdate) {\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._append(dataUpdate);\n\n\t\t\t\t\t\t\t// Process available blocks\n\t\t\t\t\t\t\treturn this._process();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the encryption or decryption process.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n *\n * @return {WordArray} The data after final processing.\n *\n * @example\n *\n * var encrypted = cipher.finalize();\n * var encrypted = cipher.finalize('data');\n * var encrypted = cipher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(dataUpdate) {\n\t\t\t\t\t\t\t// Final data update\n\t\t\t\t\t\t\tif (dataUpdate) {\n\t\t\t\t\t\t\t\tthis._append(dataUpdate);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Perform concrete-cipher logic\n\t\t\t\t\t\t\tvar finalProcessedData = this._doFinalize();\n\n\t\t\t\t\t\t\treturn finalProcessedData;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 128 / 32,\n\n\t\t\t\t\t\t_ENC_XFORM_MODE: 1,\n\n\t\t\t\t\t\t_DEC_XFORM_MODE: 2,\n\n\t\t\t\t\t\t/**\n * Creates shortcut functions to a cipher's object interface.\n *\n * @param {Cipher} cipher The cipher to create a helper for.\n *\n * @return {Object} An object with encrypt and decrypt shortcut functions.\n *\n * @static\n *\n * @example\n *\n * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n */\n\t\t\t\t\t\t_createHelper: function () {\n\t\t\t\t\t\t\tfunction selectCipherStrategy(key) {\n\t\t\t\t\t\t\t\tif (typeof key == 'string') {\n\t\t\t\t\t\t\t\t\treturn PasswordBasedCipher;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn SerializableCipher;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn function (cipher) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tencrypt: function encrypt(message, key, cfg) {\n\t\t\t\t\t\t\t\t\t\treturn selectCipherStrategy(key).encrypt(cipher, message, key, cfg);\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\tdecrypt: function decrypt(ciphertext, key, cfg) {\n\t\t\t\t\t\t\t\t\t\treturn selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}()\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Abstract base stream cipher template.\n *\n * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n */\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher = Cipher.extend({\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Process partial blocks\n\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\n\t\t\t\t\t\t\treturn finalProcessedBlocks;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 1\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Mode namespace.\n */\n\t\t\t\t\tvar C_mode = C.mode = {};\n\n\t\t\t\t\t/**\n * Abstract base block cipher mode template.\n */\n\t\t\t\t\tvar BlockCipherMode = C_lib.BlockCipherMode = Base.extend({\n\t\t\t\t\t\t/**\n * Creates this mode for encryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n */\n\t\t\t\t\t\tcreateEncryptor: function createEncryptor(cipher, iv) {\n\t\t\t\t\t\t\treturn this.Encryptor.create(cipher, iv);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates this mode for decryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n */\n\t\t\t\t\t\tcreateDecryptor: function createDecryptor(cipher, iv) {\n\t\t\t\t\t\t\treturn this.Decryptor.create(cipher, iv);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Initializes a newly created mode.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n */\n\t\t\t\t\t\tinit: function init(cipher, iv) {\n\t\t\t\t\t\t\tthis._cipher = cipher;\n\t\t\t\t\t\t\tthis._iv = iv;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Cipher Block Chaining mode.\n */\n\t\t\t\t\tvar CBC = C_mode.CBC = function () {\n\t\t\t\t\t\t/**\n * Abstract base CBC mode.\n */\n\t\t\t\t\t\tvar CBC = BlockCipherMode.extend();\n\n\t\t\t\t\t\t/**\n * CBC encryptor.\n */\n\t\t\t\t\t\tCBC.Encryptor = CBC.extend({\n\t\t\t\t\t\t\t/**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n\t\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t\t// XOR and encrypt\n\t\t\t\t\t\t\t\txorBlock.call(this, words, offset, blockSize);\n\t\t\t\t\t\t\t\tcipher.encryptBlock(words, offset);\n\n\t\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\t\tthis._prevBlock = words.slice(offset, offset + blockSize);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t/**\n * CBC decryptor.\n */\n\t\t\t\t\t\tCBC.Decryptor = CBC.extend({\n\t\t\t\t\t\t\t/**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n\t\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\t\tvar thisBlock = words.slice(offset, offset + blockSize);\n\n\t\t\t\t\t\t\t\t// Decrypt and XOR\n\t\t\t\t\t\t\t\tcipher.decryptBlock(words, offset);\n\t\t\t\t\t\t\t\txorBlock.call(this, words, offset, blockSize);\n\n\t\t\t\t\t\t\t\t// This block becomes the previous block\n\t\t\t\t\t\t\t\tthis._prevBlock = thisBlock;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tfunction xorBlock(words, offset, blockSize) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar iv = this._iv;\n\n\t\t\t\t\t\t\t// Choose mixing block\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tvar block = iv;\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar block = this._prevBlock;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// XOR blocks\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= block[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn CBC;\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * Padding namespace.\n */\n\t\t\t\t\tvar C_pad = C.pad = {};\n\n\t\t\t\t\t/**\n * PKCS #5/7 padding strategy.\n */\n\t\t\t\t\tvar Pkcs7 = C_pad.Pkcs7 = {\n\t\t\t\t\t\t/**\n * Pads data using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to pad.\n * @param {number} blockSize The multiple that the data should be padded to.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n */\n\t\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t\t// Create padding word\n\t\t\t\t\t\t\tvar paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes;\n\n\t\t\t\t\t\t\t// Create padding\n\t\t\t\t\t\t\tvar paddingWords = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < nPaddingBytes; i += 4) {\n\t\t\t\t\t\t\t\tpaddingWords.push(paddingWord);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar padding = WordArray.create(paddingWords, nPaddingBytes);\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdata.concat(padding);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to unpad.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.unpad(wordArray);\n */\n\t\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Abstract base block cipher template.\n *\n * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n */\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher = Cipher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {Mode} mode The block mode to use. Default: CBC\n * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n */\n\t\t\t\t\t\tcfg: Cipher.cfg.extend({\n\t\t\t\t\t\t\tmode: CBC,\n\t\t\t\t\t\t\tpadding: Pkcs7\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset cipher\n\t\t\t\t\t\t\tCipher.reset.call(this);\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\t\t\t\t\t\t\tvar iv = cfg.iv;\n\t\t\t\t\t\t\tvar mode = cfg.mode;\n\n\t\t\t\t\t\t\t// Reset block mode\n\t\t\t\t\t\t\tif (this._xformMode == this._ENC_XFORM_MODE) {\n\t\t\t\t\t\t\t\tvar modeCreator = mode.createEncryptor;\n\t\t\t\t\t\t\t} else /* if (this._xformMode == this._DEC_XFORM_MODE) */{\n\t\t\t\t\t\t\t\t\tvar modeCreator = mode.createDecryptor;\n\t\t\t\t\t\t\t\t\t// Keep at least one block in the buffer for unpadding\n\t\t\t\t\t\t\t\t\tthis._minBufferSize = 1;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (this._mode && this._mode.__creator == modeCreator) {\n\t\t\t\t\t\t\t\tthis._mode.init(this, iv && iv.words);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._mode = modeCreator.call(mode, this, iv && iv.words);\n\t\t\t\t\t\t\t\tthis._mode.__creator = modeCreator;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(words, offset) {\n\t\t\t\t\t\t\tthis._mode.processBlock(words, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar padding = this.cfg.padding;\n\n\t\t\t\t\t\t\t// Finalize\n\t\t\t\t\t\t\tif (this._xformMode == this._ENC_XFORM_MODE) {\n\t\t\t\t\t\t\t\t// Pad data\n\t\t\t\t\t\t\t\tpadding.pad(this._data, this.blockSize);\n\n\t\t\t\t\t\t\t\t// Process final blocks\n\t\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\t\t\t\t\t\t\t} else /* if (this._xformMode == this._DEC_XFORM_MODE) */{\n\t\t\t\t\t\t\t\t\t// Process final blocks\n\t\t\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\n\t\t\t\t\t\t\t\t\t// Unpad data\n\t\t\t\t\t\t\t\t\tpadding.unpad(finalProcessedBlocks);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn finalProcessedBlocks;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * A collection of cipher parameters.\n *\n * @property {WordArray} ciphertext The raw ciphertext.\n * @property {WordArray} key The key to this ciphertext.\n * @property {WordArray} iv The IV used in the ciphering operation.\n * @property {WordArray} salt The salt used with a key derivation function.\n * @property {Cipher} algorithm The cipher algorithm.\n * @property {Mode} mode The block mode used in the ciphering operation.\n * @property {Padding} padding The padding scheme used in the ciphering operation.\n * @property {number} blockSize The block size of the cipher.\n * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.\n */\n\t\t\t\t\tvar CipherParams = C_lib.CipherParams = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created cipher params object.\n *\n * @param {Object} cipherParams An object with any of the possible cipher parameters.\n *\n * @example\n *\n * var cipherParams = CryptoJS.lib.CipherParams.create({\n * ciphertext: ciphertextWordArray,\n * key: keyWordArray,\n * iv: ivWordArray,\n * salt: saltWordArray,\n * algorithm: CryptoJS.algo.AES,\n * mode: CryptoJS.mode.CBC,\n * padding: CryptoJS.pad.PKCS7,\n * blockSize: 4,\n * formatter: CryptoJS.format.OpenSSL\n * });\n */\n\t\t\t\t\t\tinit: function init(cipherParams) {\n\t\t\t\t\t\t\tthis.mixIn(cipherParams);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this cipher params object to a string.\n *\n * @param {Format} formatter (Optional) The formatting strategy to use.\n *\n * @return {string} The stringified cipher params.\n *\n * @throws Error If neither the formatter nor the default formatter is set.\n *\n * @example\n *\n * var string = cipherParams + '';\n * var string = cipherParams.toString();\n * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n */\n\t\t\t\t\t\ttoString: function toString(formatter) {\n\t\t\t\t\t\t\treturn (formatter || this.formatter).stringify(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Format namespace.\n */\n\t\t\t\t\tvar C_format = C.format = {};\n\n\t\t\t\t\t/**\n * OpenSSL formatting strategy.\n */\n\t\t\t\t\tvar OpenSSLFormatter = C_format.OpenSSL = {\n\t\t\t\t\t\t/**\n * Converts a cipher params object to an OpenSSL-compatible string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The OpenSSL-compatible string.\n *\n * @static\n *\n * @example\n *\n * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n */\n\t\t\t\t\t\tstringify: function stringify(cipherParams) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar ciphertext = cipherParams.ciphertext;\n\t\t\t\t\t\t\tvar salt = cipherParams.salt;\n\n\t\t\t\t\t\t\t// Format\n\t\t\t\t\t\t\tif (salt) {\n\t\t\t\t\t\t\t\tvar wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar wordArray = ciphertext;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn wordArray.toString(Base64);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts an OpenSSL-compatible string to a cipher params object.\n *\n * @param {string} openSSLStr The OpenSSL-compatible string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n */\n\t\t\t\t\t\tparse: function parse(openSSLStr) {\n\t\t\t\t\t\t\t// Parse base64\n\t\t\t\t\t\t\tvar ciphertext = Base64.parse(openSSLStr);\n\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar ciphertextWords = ciphertext.words;\n\n\t\t\t\t\t\t\t// Test for salt\n\t\t\t\t\t\t\tif (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {\n\t\t\t\t\t\t\t\t// Extract salt\n\t\t\t\t\t\t\t\tvar salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n\t\t\t\t\t\t\t\t// Remove salt from ciphertext\n\t\t\t\t\t\t\t\tciphertextWords.splice(0, 4);\n\t\t\t\t\t\t\t\tciphertext.sigBytes -= 16;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn CipherParams.create({ ciphertext: ciphertext, salt: salt });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n */\n\t\t\t\t\tvar SerializableCipher = C_lib.SerializableCipher = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tformat: OpenSSLFormatter\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Encrypts a message.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tencrypt: function encrypt(cipher, message, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tvar encryptor = cipher.createEncryptor(key, cfg);\n\t\t\t\t\t\t\tvar ciphertext = encryptor.finalize(message);\n\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cipherCfg = encryptor.cfg;\n\n\t\t\t\t\t\t\t// Create and return serializable cipher params\n\t\t\t\t\t\t\treturn CipherParams.create({\n\t\t\t\t\t\t\t\tciphertext: ciphertext,\n\t\t\t\t\t\t\t\tkey: key,\n\t\t\t\t\t\t\t\tiv: cipherCfg.iv,\n\t\t\t\t\t\t\t\talgorithm: cipher,\n\t\t\t\t\t\t\t\tmode: cipherCfg.mode,\n\t\t\t\t\t\t\t\tpadding: cipherCfg.padding,\n\t\t\t\t\t\t\t\tblockSize: cipher.blockSize,\n\t\t\t\t\t\t\t\tformatter: cfg.format\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Decrypts serialized ciphertext.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tdecrypt: function decrypt(cipher, ciphertext, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Convert string to CipherParams\n\t\t\t\t\t\t\tciphertext = this._parse(ciphertext, cfg.format);\n\n\t\t\t\t\t\t\t// Decrypt\n\t\t\t\t\t\t\tvar plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);\n\n\t\t\t\t\t\t\treturn plaintext;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts serialized ciphertext to CipherParams,\n * else assumed CipherParams already and returns ciphertext unchanged.\n *\n * @param {CipherParams|string} ciphertext The ciphertext.\n * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n *\n * @return {CipherParams} The unserialized ciphertext.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);\n */\n\t\t\t\t\t\t_parse: function _parse(ciphertext, format) {\n\t\t\t\t\t\t\tif (typeof ciphertext == 'string') {\n\t\t\t\t\t\t\t\treturn format.parse(ciphertext, this);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn ciphertext;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Key derivation function namespace.\n */\n\t\t\t\t\tvar C_kdf = C.kdf = {};\n\n\t\t\t\t\t/**\n * OpenSSL key derivation function.\n */\n\t\t\t\t\tvar OpenSSLKdf = C_kdf.OpenSSL = {\n\t\t\t\t\t\t/**\n * Derives a key and IV from a password.\n *\n * @param {string} password The password to derive from.\n * @param {number} keySize The size in words of the key to generate.\n * @param {number} ivSize The size in words of the IV to generate.\n * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n *\n * @return {CipherParams} A cipher params object with the key, IV, and salt.\n *\n * @static\n *\n * @example\n *\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n */\n\t\t\t\t\t\texecute: function execute(password, keySize, ivSize, salt) {\n\t\t\t\t\t\t\t// Generate random salt\n\t\t\t\t\t\t\tif (!salt) {\n\t\t\t\t\t\t\t\tsalt = WordArray.random(64 / 8);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Derive key and IV\n\t\t\t\t\t\t\tvar key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);\n\n\t\t\t\t\t\t\t// Separate key and IV\n\t\t\t\t\t\t\tvar iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n\t\t\t\t\t\t\tkey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\t// Return params\n\t\t\t\t\t\t\treturn CipherParams.create({ key: key, iv: iv, salt: salt });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * A serializable cipher wrapper that derives the key from a password,\n * and returns ciphertext as a serializable cipher params object.\n */\n\t\t\t\t\tvar PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL\n */\n\t\t\t\t\t\tcfg: SerializableCipher.cfg.extend({\n\t\t\t\t\t\t\tkdf: OpenSSLKdf\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Encrypts a message using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tencrypt: function encrypt(cipher, message, password, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Derive key and other params\n\t\t\t\t\t\t\tvar derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);\n\n\t\t\t\t\t\t\t// Add IV to config\n\t\t\t\t\t\t\tcfg.iv = derivedParams.iv;\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tvar ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);\n\n\t\t\t\t\t\t\t// Mix in derived params\n\t\t\t\t\t\t\tciphertext.mixIn(derivedParams);\n\n\t\t\t\t\t\t\treturn ciphertext;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Decrypts serialized ciphertext using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tdecrypt: function decrypt(cipher, ciphertext, password, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Convert string to CipherParams\n\t\t\t\t\t\t\tciphertext = this._parse(ciphertext, cfg.format);\n\n\t\t\t\t\t\t\t// Derive key and other params\n\t\t\t\t\t\t\tvar derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);\n\n\t\t\t\t\t\t\t// Add IV to config\n\t\t\t\t\t\t\tcfg.iv = derivedParams.iv;\n\n\t\t\t\t\t\t\t// Decrypt\n\t\t\t\t\t\t\tvar plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);\n\n\t\t\t\t\t\t\treturn plaintext;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}();\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 23 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Cipher Feedback block mode.\n */\n\t\t\t\tCryptoJS.mode.CFB = function () {\n\t\t\t\t\tvar CFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tCFB.Encryptor = CFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\tgenerateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\tthis._prevBlock = words.slice(offset, offset + blockSize);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCFB.Decryptor = CFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\tvar thisBlock = words.slice(offset, offset + blockSize);\n\n\t\t\t\t\t\t\tgenerateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t\t\t\t\t\t\t// This block becomes the previous block\n\t\t\t\t\t\t\tthis._prevBlock = thisBlock;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar iv = this._iv;\n\n\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\tvar keystream = iv.slice(0);\n\n\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar keystream = this._prevBlock;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn CFB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CFB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 24 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Counter block mode.\n */\n\t\t\t\tCryptoJS.mode.CTR = function () {\n\t\t\t\t\tvar CTR = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tvar Encryptor = CTR.Encryptor = CTR.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar counter = this._counter;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tcounter = this._counter = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar keystream = counter.slice(0);\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Increment counter\n\t\t\t\t\t\t\tcounter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCTR.Decryptor = Encryptor;\n\n\t\t\t\t\treturn CTR;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CTR;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 25 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/** @preserve\n * Counter block mode compatible with Dr Brian Gladman fileenc.c\n * derived from CryptoJS.mode.CTR\n * Jan Hruby jhruby.web@gmail.com\n */\n\t\t\t\tCryptoJS.mode.CTRGladman = function () {\n\t\t\t\t\tvar CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tfunction incWord(word) {\n\t\t\t\t\t\tif ((word >> 24 & 0xff) === 0xff) {\n\t\t\t\t\t\t\t//overflow\n\t\t\t\t\t\t\tvar b1 = word >> 16 & 0xff;\n\t\t\t\t\t\t\tvar b2 = word >> 8 & 0xff;\n\t\t\t\t\t\t\tvar b3 = word & 0xff;\n\n\t\t\t\t\t\t\tif (b1 === 0xff) // overflow b1\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tb1 = 0;\n\t\t\t\t\t\t\t\t\tif (b2 === 0xff) {\n\t\t\t\t\t\t\t\t\t\tb2 = 0;\n\t\t\t\t\t\t\t\t\t\tif (b3 === 0xff) {\n\t\t\t\t\t\t\t\t\t\t\tb3 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t++b3;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t++b2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t++b1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tword = 0;\n\t\t\t\t\t\t\tword += b1 << 16;\n\t\t\t\t\t\t\tword += b2 << 8;\n\t\t\t\t\t\t\tword += b3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tword += 0x01 << 24;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn word;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction incCounter(counter) {\n\t\t\t\t\t\tif ((counter[0] = incWord(counter[0])) === 0) {\n\t\t\t\t\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\t\t\t\t\tcounter[1] = incWord(counter[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn counter;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar Encryptor = CTRGladman.Encryptor = CTRGladman.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar counter = this._counter;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tcounter = this._counter = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tincCounter(counter);\n\n\t\t\t\t\t\t\tvar keystream = counter.slice(0);\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCTRGladman.Decryptor = Encryptor;\n\n\t\t\t\t\treturn CTRGladman;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CTRGladman;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 26 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Output Feedback block mode.\n */\n\t\t\t\tCryptoJS.mode.OFB = function () {\n\t\t\t\t\tvar OFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tvar Encryptor = OFB.Encryptor = OFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar keystream = this._keystream;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tkeystream = this._keystream = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tOFB.Decryptor = Encryptor;\n\n\t\t\t\t\treturn OFB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.OFB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 27 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Electronic Codebook block mode.\n */\n\t\t\t\tCryptoJS.mode.ECB = function () {\n\t\t\t\t\tvar ECB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tECB.Encryptor = ECB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\tthis._cipher.encryptBlock(words, offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tECB.Decryptor = ECB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\tthis._cipher.decryptBlock(words, offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn ECB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.ECB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 28 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ANSI X.923 padding strategy.\n */\n\t\t\t\tCryptoJS.pad.AnsiX923 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar dataSigBytes = data.sigBytes;\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t// Compute last byte position\n\t\t\t\t\t\tvar lastBytePos = dataSigBytes + nPaddingBytes - 1;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.clamp();\n\t\t\t\t\t\tdata.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;\n\t\t\t\t\t\tdata.sigBytes += nPaddingBytes;\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Ansix923;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 29 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ISO 10126 padding strategy.\n */\n\t\t\t\tCryptoJS.pad.Iso10126 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Iso10126;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 30 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ISO/IEC 9797-1 Padding Method 2.\n */\n\t\t\t\tCryptoJS.pad.Iso97971 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Add 0x80 byte\n\t\t\t\t\t\tdata.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));\n\n\t\t\t\t\t\t// Zero pad the rest\n\t\t\t\t\t\tCryptoJS.pad.ZeroPadding.pad(data, blockSize);\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Remove zero padding\n\t\t\t\t\t\tCryptoJS.pad.ZeroPadding.unpad(data);\n\n\t\t\t\t\t\t// Remove one more byte -- the 0x80 byte\n\t\t\t\t\t\tdata.sigBytes--;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Iso97971;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 31 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Zero padding strategy.\n */\n\t\t\t\tCryptoJS.pad.ZeroPadding = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.clamp();\n\t\t\t\t\t\tdata.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes);\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t// Unpad\n\t\t\t\t\t\tvar i = data.sigBytes - 1;\n\t\t\t\t\t\twhile (!(dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff)) {\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdata.sigBytes = i + 1;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.ZeroPadding;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 32 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * A noop padding strategy.\n */\n\t\t\t\tCryptoJS.pad.NoPadding = {\n\t\t\t\t\tpad: function pad() {},\n\n\t\t\t\t\tunpad: function unpad() {}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.NoPadding;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 33 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar CipherParams = C_lib.CipherParams;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Hex = C_enc.Hex;\n\t\t\t\t\tvar C_format = C.format;\n\n\t\t\t\t\tvar HexFormatter = C_format.Hex = {\n\t\t\t\t\t\t/**\n * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The hexadecimally encoded string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.format.Hex.stringify(cipherParams);\n */\n\t\t\t\t\t\tstringify: function stringify(cipherParams) {\n\t\t\t\t\t\t\treturn cipherParams.ciphertext.toString(Hex);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a hexadecimally encoded ciphertext string to a cipher params object.\n *\n * @param {string} input The hexadecimally encoded string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.Hex.parse(hexString);\n */\n\t\t\t\t\t\tparse: function parse(input) {\n\t\t\t\t\t\t\tvar ciphertext = Hex.parse(input);\n\t\t\t\t\t\t\treturn CipherParams.create({ ciphertext: ciphertext });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.format.Hex;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 34 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Lookup tables\n\t\t\t\t\tvar SBOX = [];\n\t\t\t\t\tvar INV_SBOX = [];\n\t\t\t\t\tvar SUB_MIX_0 = [];\n\t\t\t\t\tvar SUB_MIX_1 = [];\n\t\t\t\t\tvar SUB_MIX_2 = [];\n\t\t\t\t\tvar SUB_MIX_3 = [];\n\t\t\t\t\tvar INV_SUB_MIX_0 = [];\n\t\t\t\t\tvar INV_SUB_MIX_1 = [];\n\t\t\t\t\tvar INV_SUB_MIX_2 = [];\n\t\t\t\t\tvar INV_SUB_MIX_3 = [];\n\n\t\t\t\t\t// Compute lookup tables\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t// Compute double table\n\t\t\t\t\t\tvar d = [];\n\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\tif (i < 128) {\n\t\t\t\t\t\t\t\td[i] = i << 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\td[i] = i << 1 ^ 0x11b;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Walk GF(2^8)\n\t\t\t\t\t\tvar x = 0;\n\t\t\t\t\t\tvar xi = 0;\n\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\t// Compute sbox\n\t\t\t\t\t\t\tvar sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n\t\t\t\t\t\t\tsx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n\t\t\t\t\t\t\tSBOX[x] = sx;\n\t\t\t\t\t\t\tINV_SBOX[sx] = x;\n\n\t\t\t\t\t\t\t// Compute multiplication\n\t\t\t\t\t\t\tvar x2 = d[x];\n\t\t\t\t\t\t\tvar x4 = d[x2];\n\t\t\t\t\t\t\tvar x8 = d[x4];\n\n\t\t\t\t\t\t\t// Compute sub bytes, mix columns tables\n\t\t\t\t\t\t\tvar t = d[sx] * 0x101 ^ sx * 0x1010100;\n\t\t\t\t\t\t\tSUB_MIX_0[x] = t << 24 | t >>> 8;\n\t\t\t\t\t\t\tSUB_MIX_1[x] = t << 16 | t >>> 16;\n\t\t\t\t\t\t\tSUB_MIX_2[x] = t << 8 | t >>> 24;\n\t\t\t\t\t\t\tSUB_MIX_3[x] = t;\n\n\t\t\t\t\t\t\t// Compute inv sub bytes, inv mix columns tables\n\t\t\t\t\t\t\tvar t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t\t\t\t\t\t\tINV_SUB_MIX_0[sx] = t << 24 | t >>> 8;\n\t\t\t\t\t\t\tINV_SUB_MIX_1[sx] = t << 16 | t >>> 16;\n\t\t\t\t\t\t\tINV_SUB_MIX_2[sx] = t << 8 | t >>> 24;\n\t\t\t\t\t\t\tINV_SUB_MIX_3[sx] = t;\n\n\t\t\t\t\t\t\t// Compute next counter\n\t\t\t\t\t\t\tif (!x) {\n\t\t\t\t\t\t\t\tx = xi = 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tx = x2 ^ d[d[d[x8 ^ x2]]];\n\t\t\t\t\t\t\t\txi ^= d[d[xi]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Precomputed Rcon lookup\n\t\t\t\t\tvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n\t\t\t\t\t/**\n * AES block cipher algorithm.\n */\n\t\t\t\t\tvar AES = C_algo.AES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Skip reset of nRounds has been set before and key did not change\n\t\t\t\t\t\t\tif (this._nRounds && this._keyPriorReset === this._key) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._keyPriorReset = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\t\t\t\t\t\t\tvar keySize = key.sigBytes / 4;\n\n\t\t\t\t\t\t\t// Compute number of rounds\n\t\t\t\t\t\t\tvar nRounds = this._nRounds = keySize + 6;\n\n\t\t\t\t\t\t\t// Compute number of key schedule rows\n\t\t\t\t\t\t\tvar ksRows = (nRounds + 1) * 4;\n\n\t\t\t\t\t\t\t// Compute key schedule\n\t\t\t\t\t\t\tvar keySchedule = this._keySchedule = [];\n\t\t\t\t\t\t\tfor (var ksRow = 0; ksRow < ksRows; ksRow++) {\n\t\t\t\t\t\t\t\tif (ksRow < keySize) {\n\t\t\t\t\t\t\t\t\tkeySchedule[ksRow] = keyWords[ksRow];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow - 1];\n\n\t\t\t\t\t\t\t\t\tif (!(ksRow % keySize)) {\n\t\t\t\t\t\t\t\t\t\t// Rot word\n\t\t\t\t\t\t\t\t\t\tt = t << 8 | t >>> 24;\n\n\t\t\t\t\t\t\t\t\t\t// Sub word\n\t\t\t\t\t\t\t\t\t\tt = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];\n\n\t\t\t\t\t\t\t\t\t\t// Mix Rcon\n\t\t\t\t\t\t\t\t\t\tt ^= RCON[ksRow / keySize | 0] << 24;\n\t\t\t\t\t\t\t\t\t} else if (keySize > 6 && ksRow % keySize == 4) {\n\t\t\t\t\t\t\t\t\t\t// Sub word\n\t\t\t\t\t\t\t\t\t\tt = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tkeySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Compute inv key schedule\n\t\t\t\t\t\t\tvar invKeySchedule = this._invKeySchedule = [];\n\t\t\t\t\t\t\tfor (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n\t\t\t\t\t\t\t\tvar ksRow = ksRows - invKsRow;\n\n\t\t\t\t\t\t\t\tif (invKsRow % 4) {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow - 4];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (invKsRow < 4 || ksRow <= 4) {\n\t\t\t\t\t\t\t\t\tinvKeySchedule[invKsRow] = t;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tinvKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 0xff]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\t// Swap 2nd and 4th rows\n\t\t\t\t\t\t\tvar t = M[offset + 1];\n\t\t\t\t\t\t\tM[offset + 1] = M[offset + 3];\n\t\t\t\t\t\t\tM[offset + 3] = t;\n\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);\n\n\t\t\t\t\t\t\t// Inv swap 2nd and 4th rows\n\t\t\t\t\t\t\tvar t = M[offset + 1];\n\t\t\t\t\t\t\tM[offset + 1] = M[offset + 3];\n\t\t\t\t\t\t\tM[offset + 3] = t;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doCryptBlock: function _doCryptBlock(M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar nRounds = this._nRounds;\n\n\t\t\t\t\t\t\t// Get input, add round key\n\t\t\t\t\t\t\tvar s0 = M[offset] ^ keySchedule[0];\n\t\t\t\t\t\t\tvar s1 = M[offset + 1] ^ keySchedule[1];\n\t\t\t\t\t\t\tvar s2 = M[offset + 2] ^ keySchedule[2];\n\t\t\t\t\t\t\tvar s3 = M[offset + 3] ^ keySchedule[3];\n\n\t\t\t\t\t\t\t// Key schedule row counter\n\t\t\t\t\t\t\tvar ksRow = 4;\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 1; round < nRounds; round++) {\n\t\t\t\t\t\t\t\t// Shift rows, sub bytes, mix columns, add round key\n\t\t\t\t\t\t\t\tvar t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[s1 >>> 16 & 0xff] ^ SUB_MIX_2[s2 >>> 8 & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[s2 >>> 16 & 0xff] ^ SUB_MIX_2[s3 >>> 8 & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[s3 >>> 16 & 0xff] ^ SUB_MIX_2[s0 >>> 8 & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[s0 >>> 16 & 0xff] ^ SUB_MIX_2[s1 >>> 8 & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];\n\n\t\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\t\ts0 = t0;\n\t\t\t\t\t\t\t\ts1 = t1;\n\t\t\t\t\t\t\t\ts2 = t2;\n\t\t\t\t\t\t\t\ts3 = t3;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shift rows, sub bytes, add round key\n\t\t\t\t\t\t\tvar t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n\n\t\t\t\t\t\t\t// Set output\n\t\t\t\t\t\t\tM[offset] = t0;\n\t\t\t\t\t\t\tM[offset + 1] = t1;\n\t\t\t\t\t\t\tM[offset + 2] = t2;\n\t\t\t\t\t\t\tM[offset + 3] = t3;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 256 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.AES = BlockCipher._createHelper(AES);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.AES;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 35 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Permuted Choice 1 constants\n\t\t\t\t\tvar PC1 = [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];\n\n\t\t\t\t\t// Permuted Choice 2 constants\n\t\t\t\t\tvar PC2 = [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];\n\n\t\t\t\t\t// Cumulative bit shift constants\n\t\t\t\t\tvar BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];\n\n\t\t\t\t\t// SBOXes and round permutation constants\n\t\t\t\t\tvar SBOX_P = [{\n\t\t\t\t\t\t0x0: 0x808200,\n\t\t\t\t\t\t0x10000000: 0x8000,\n\t\t\t\t\t\t0x20000000: 0x808002,\n\t\t\t\t\t\t0x30000000: 0x2,\n\t\t\t\t\t\t0x40000000: 0x200,\n\t\t\t\t\t\t0x50000000: 0x808202,\n\t\t\t\t\t\t0x60000000: 0x800202,\n\t\t\t\t\t\t0x70000000: 0x800000,\n\t\t\t\t\t\t0x80000000: 0x202,\n\t\t\t\t\t\t0x90000000: 0x800200,\n\t\t\t\t\t\t0xa0000000: 0x8200,\n\t\t\t\t\t\t0xb0000000: 0x808000,\n\t\t\t\t\t\t0xc0000000: 0x8002,\n\t\t\t\t\t\t0xd0000000: 0x800002,\n\t\t\t\t\t\t0xe0000000: 0x0,\n\t\t\t\t\t\t0xf0000000: 0x8202,\n\t\t\t\t\t\t0x8000000: 0x0,\n\t\t\t\t\t\t0x18000000: 0x808202,\n\t\t\t\t\t\t0x28000000: 0x8202,\n\t\t\t\t\t\t0x38000000: 0x8000,\n\t\t\t\t\t\t0x48000000: 0x808200,\n\t\t\t\t\t\t0x58000000: 0x200,\n\t\t\t\t\t\t0x68000000: 0x808002,\n\t\t\t\t\t\t0x78000000: 0x2,\n\t\t\t\t\t\t0x88000000: 0x800200,\n\t\t\t\t\t\t0x98000000: 0x8200,\n\t\t\t\t\t\t0xa8000000: 0x808000,\n\t\t\t\t\t\t0xb8000000: 0x800202,\n\t\t\t\t\t\t0xc8000000: 0x800002,\n\t\t\t\t\t\t0xd8000000: 0x8002,\n\t\t\t\t\t\t0xe8000000: 0x202,\n\t\t\t\t\t\t0xf8000000: 0x800000,\n\t\t\t\t\t\t0x1: 0x8000,\n\t\t\t\t\t\t0x10000001: 0x2,\n\t\t\t\t\t\t0x20000001: 0x808200,\n\t\t\t\t\t\t0x30000001: 0x800000,\n\t\t\t\t\t\t0x40000001: 0x808002,\n\t\t\t\t\t\t0x50000001: 0x8200,\n\t\t\t\t\t\t0x60000001: 0x200,\n\t\t\t\t\t\t0x70000001: 0x800202,\n\t\t\t\t\t\t0x80000001: 0x808202,\n\t\t\t\t\t\t0x90000001: 0x808000,\n\t\t\t\t\t\t0xa0000001: 0x800002,\n\t\t\t\t\t\t0xb0000001: 0x8202,\n\t\t\t\t\t\t0xc0000001: 0x202,\n\t\t\t\t\t\t0xd0000001: 0x800200,\n\t\t\t\t\t\t0xe0000001: 0x8002,\n\t\t\t\t\t\t0xf0000001: 0x0,\n\t\t\t\t\t\t0x8000001: 0x808202,\n\t\t\t\t\t\t0x18000001: 0x808000,\n\t\t\t\t\t\t0x28000001: 0x800000,\n\t\t\t\t\t\t0x38000001: 0x200,\n\t\t\t\t\t\t0x48000001: 0x8000,\n\t\t\t\t\t\t0x58000001: 0x800002,\n\t\t\t\t\t\t0x68000001: 0x2,\n\t\t\t\t\t\t0x78000001: 0x8202,\n\t\t\t\t\t\t0x88000001: 0x8002,\n\t\t\t\t\t\t0x98000001: 0x800202,\n\t\t\t\t\t\t0xa8000001: 0x202,\n\t\t\t\t\t\t0xb8000001: 0x808200,\n\t\t\t\t\t\t0xc8000001: 0x800200,\n\t\t\t\t\t\t0xd8000001: 0x0,\n\t\t\t\t\t\t0xe8000001: 0x8200,\n\t\t\t\t\t\t0xf8000001: 0x808002\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x40084010,\n\t\t\t\t\t\t0x1000000: 0x4000,\n\t\t\t\t\t\t0x2000000: 0x80000,\n\t\t\t\t\t\t0x3000000: 0x40080010,\n\t\t\t\t\t\t0x4000000: 0x40000010,\n\t\t\t\t\t\t0x5000000: 0x40084000,\n\t\t\t\t\t\t0x6000000: 0x40004000,\n\t\t\t\t\t\t0x7000000: 0x10,\n\t\t\t\t\t\t0x8000000: 0x84000,\n\t\t\t\t\t\t0x9000000: 0x40004010,\n\t\t\t\t\t\t0xa000000: 0x40000000,\n\t\t\t\t\t\t0xb000000: 0x84010,\n\t\t\t\t\t\t0xc000000: 0x80010,\n\t\t\t\t\t\t0xd000000: 0x0,\n\t\t\t\t\t\t0xe000000: 0x4010,\n\t\t\t\t\t\t0xf000000: 0x40080000,\n\t\t\t\t\t\t0x800000: 0x40004000,\n\t\t\t\t\t\t0x1800000: 0x84010,\n\t\t\t\t\t\t0x2800000: 0x10,\n\t\t\t\t\t\t0x3800000: 0x40004010,\n\t\t\t\t\t\t0x4800000: 0x40084010,\n\t\t\t\t\t\t0x5800000: 0x40000000,\n\t\t\t\t\t\t0x6800000: 0x80000,\n\t\t\t\t\t\t0x7800000: 0x40080010,\n\t\t\t\t\t\t0x8800000: 0x80010,\n\t\t\t\t\t\t0x9800000: 0x0,\n\t\t\t\t\t\t0xa800000: 0x4000,\n\t\t\t\t\t\t0xb800000: 0x40080000,\n\t\t\t\t\t\t0xc800000: 0x40000010,\n\t\t\t\t\t\t0xd800000: 0x84000,\n\t\t\t\t\t\t0xe800000: 0x40084000,\n\t\t\t\t\t\t0xf800000: 0x4010,\n\t\t\t\t\t\t0x10000000: 0x0,\n\t\t\t\t\t\t0x11000000: 0x40080010,\n\t\t\t\t\t\t0x12000000: 0x40004010,\n\t\t\t\t\t\t0x13000000: 0x40084000,\n\t\t\t\t\t\t0x14000000: 0x40080000,\n\t\t\t\t\t\t0x15000000: 0x10,\n\t\t\t\t\t\t0x16000000: 0x84010,\n\t\t\t\t\t\t0x17000000: 0x4000,\n\t\t\t\t\t\t0x18000000: 0x4010,\n\t\t\t\t\t\t0x19000000: 0x80000,\n\t\t\t\t\t\t0x1a000000: 0x80010,\n\t\t\t\t\t\t0x1b000000: 0x40000010,\n\t\t\t\t\t\t0x1c000000: 0x84000,\n\t\t\t\t\t\t0x1d000000: 0x40004000,\n\t\t\t\t\t\t0x1e000000: 0x40000000,\n\t\t\t\t\t\t0x1f000000: 0x40084010,\n\t\t\t\t\t\t0x10800000: 0x84010,\n\t\t\t\t\t\t0x11800000: 0x80000,\n\t\t\t\t\t\t0x12800000: 0x40080000,\n\t\t\t\t\t\t0x13800000: 0x4000,\n\t\t\t\t\t\t0x14800000: 0x40004000,\n\t\t\t\t\t\t0x15800000: 0x40084010,\n\t\t\t\t\t\t0x16800000: 0x10,\n\t\t\t\t\t\t0x17800000: 0x40000000,\n\t\t\t\t\t\t0x18800000: 0x40084000,\n\t\t\t\t\t\t0x19800000: 0x40000010,\n\t\t\t\t\t\t0x1a800000: 0x40004010,\n\t\t\t\t\t\t0x1b800000: 0x80010,\n\t\t\t\t\t\t0x1c800000: 0x0,\n\t\t\t\t\t\t0x1d800000: 0x4010,\n\t\t\t\t\t\t0x1e800000: 0x40080010,\n\t\t\t\t\t\t0x1f800000: 0x84000\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x104,\n\t\t\t\t\t\t0x100000: 0x0,\n\t\t\t\t\t\t0x200000: 0x4000100,\n\t\t\t\t\t\t0x300000: 0x10104,\n\t\t\t\t\t\t0x400000: 0x10004,\n\t\t\t\t\t\t0x500000: 0x4000004,\n\t\t\t\t\t\t0x600000: 0x4010104,\n\t\t\t\t\t\t0x700000: 0x4010000,\n\t\t\t\t\t\t0x800000: 0x4000000,\n\t\t\t\t\t\t0x900000: 0x4010100,\n\t\t\t\t\t\t0xa00000: 0x10100,\n\t\t\t\t\t\t0xb00000: 0x4010004,\n\t\t\t\t\t\t0xc00000: 0x4000104,\n\t\t\t\t\t\t0xd00000: 0x10000,\n\t\t\t\t\t\t0xe00000: 0x4,\n\t\t\t\t\t\t0xf00000: 0x100,\n\t\t\t\t\t\t0x80000: 0x4010100,\n\t\t\t\t\t\t0x180000: 0x4010004,\n\t\t\t\t\t\t0x280000: 0x0,\n\t\t\t\t\t\t0x380000: 0x4000100,\n\t\t\t\t\t\t0x480000: 0x4000004,\n\t\t\t\t\t\t0x580000: 0x10000,\n\t\t\t\t\t\t0x680000: 0x10004,\n\t\t\t\t\t\t0x780000: 0x104,\n\t\t\t\t\t\t0x880000: 0x4,\n\t\t\t\t\t\t0x980000: 0x100,\n\t\t\t\t\t\t0xa80000: 0x4010000,\n\t\t\t\t\t\t0xb80000: 0x10104,\n\t\t\t\t\t\t0xc80000: 0x10100,\n\t\t\t\t\t\t0xd80000: 0x4000104,\n\t\t\t\t\t\t0xe80000: 0x4010104,\n\t\t\t\t\t\t0xf80000: 0x4000000,\n\t\t\t\t\t\t0x1000000: 0x4010100,\n\t\t\t\t\t\t0x1100000: 0x10004,\n\t\t\t\t\t\t0x1200000: 0x10000,\n\t\t\t\t\t\t0x1300000: 0x4000100,\n\t\t\t\t\t\t0x1400000: 0x100,\n\t\t\t\t\t\t0x1500000: 0x4010104,\n\t\t\t\t\t\t0x1600000: 0x4000004,\n\t\t\t\t\t\t0x1700000: 0x0,\n\t\t\t\t\t\t0x1800000: 0x4000104,\n\t\t\t\t\t\t0x1900000: 0x4000000,\n\t\t\t\t\t\t0x1a00000: 0x4,\n\t\t\t\t\t\t0x1b00000: 0x10100,\n\t\t\t\t\t\t0x1c00000: 0x4010000,\n\t\t\t\t\t\t0x1d00000: 0x104,\n\t\t\t\t\t\t0x1e00000: 0x10104,\n\t\t\t\t\t\t0x1f00000: 0x4010004,\n\t\t\t\t\t\t0x1080000: 0x4000000,\n\t\t\t\t\t\t0x1180000: 0x104,\n\t\t\t\t\t\t0x1280000: 0x4010100,\n\t\t\t\t\t\t0x1380000: 0x0,\n\t\t\t\t\t\t0x1480000: 0x10004,\n\t\t\t\t\t\t0x1580000: 0x4000100,\n\t\t\t\t\t\t0x1680000: 0x100,\n\t\t\t\t\t\t0x1780000: 0x4010004,\n\t\t\t\t\t\t0x1880000: 0x10000,\n\t\t\t\t\t\t0x1980000: 0x4010104,\n\t\t\t\t\t\t0x1a80000: 0x10104,\n\t\t\t\t\t\t0x1b80000: 0x4000004,\n\t\t\t\t\t\t0x1c80000: 0x4000104,\n\t\t\t\t\t\t0x1d80000: 0x4010000,\n\t\t\t\t\t\t0x1e80000: 0x4,\n\t\t\t\t\t\t0x1f80000: 0x10100\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x80401000,\n\t\t\t\t\t\t0x10000: 0x80001040,\n\t\t\t\t\t\t0x20000: 0x401040,\n\t\t\t\t\t\t0x30000: 0x80400000,\n\t\t\t\t\t\t0x40000: 0x0,\n\t\t\t\t\t\t0x50000: 0x401000,\n\t\t\t\t\t\t0x60000: 0x80000040,\n\t\t\t\t\t\t0x70000: 0x400040,\n\t\t\t\t\t\t0x80000: 0x80000000,\n\t\t\t\t\t\t0x90000: 0x400000,\n\t\t\t\t\t\t0xa0000: 0x40,\n\t\t\t\t\t\t0xb0000: 0x80001000,\n\t\t\t\t\t\t0xc0000: 0x80400040,\n\t\t\t\t\t\t0xd0000: 0x1040,\n\t\t\t\t\t\t0xe0000: 0x1000,\n\t\t\t\t\t\t0xf0000: 0x80401040,\n\t\t\t\t\t\t0x8000: 0x80001040,\n\t\t\t\t\t\t0x18000: 0x40,\n\t\t\t\t\t\t0x28000: 0x80400040,\n\t\t\t\t\t\t0x38000: 0x80001000,\n\t\t\t\t\t\t0x48000: 0x401000,\n\t\t\t\t\t\t0x58000: 0x80401040,\n\t\t\t\t\t\t0x68000: 0x0,\n\t\t\t\t\t\t0x78000: 0x80400000,\n\t\t\t\t\t\t0x88000: 0x1000,\n\t\t\t\t\t\t0x98000: 0x80401000,\n\t\t\t\t\t\t0xa8000: 0x400000,\n\t\t\t\t\t\t0xb8000: 0x1040,\n\t\t\t\t\t\t0xc8000: 0x80000000,\n\t\t\t\t\t\t0xd8000: 0x400040,\n\t\t\t\t\t\t0xe8000: 0x401040,\n\t\t\t\t\t\t0xf8000: 0x80000040,\n\t\t\t\t\t\t0x100000: 0x400040,\n\t\t\t\t\t\t0x110000: 0x401000,\n\t\t\t\t\t\t0x120000: 0x80000040,\n\t\t\t\t\t\t0x130000: 0x0,\n\t\t\t\t\t\t0x140000: 0x1040,\n\t\t\t\t\t\t0x150000: 0x80400040,\n\t\t\t\t\t\t0x160000: 0x80401000,\n\t\t\t\t\t\t0x170000: 0x80001040,\n\t\t\t\t\t\t0x180000: 0x80401040,\n\t\t\t\t\t\t0x190000: 0x80000000,\n\t\t\t\t\t\t0x1a0000: 0x80400000,\n\t\t\t\t\t\t0x1b0000: 0x401040,\n\t\t\t\t\t\t0x1c0000: 0x80001000,\n\t\t\t\t\t\t0x1d0000: 0x400000,\n\t\t\t\t\t\t0x1e0000: 0x40,\n\t\t\t\t\t\t0x1f0000: 0x1000,\n\t\t\t\t\t\t0x108000: 0x80400000,\n\t\t\t\t\t\t0x118000: 0x80401040,\n\t\t\t\t\t\t0x128000: 0x0,\n\t\t\t\t\t\t0x138000: 0x401000,\n\t\t\t\t\t\t0x148000: 0x400040,\n\t\t\t\t\t\t0x158000: 0x80000000,\n\t\t\t\t\t\t0x168000: 0x80001040,\n\t\t\t\t\t\t0x178000: 0x40,\n\t\t\t\t\t\t0x188000: 0x80000040,\n\t\t\t\t\t\t0x198000: 0x1000,\n\t\t\t\t\t\t0x1a8000: 0x80001000,\n\t\t\t\t\t\t0x1b8000: 0x80400040,\n\t\t\t\t\t\t0x1c8000: 0x1040,\n\t\t\t\t\t\t0x1d8000: 0x80401000,\n\t\t\t\t\t\t0x1e8000: 0x400000,\n\t\t\t\t\t\t0x1f8000: 0x401040\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x80,\n\t\t\t\t\t\t0x1000: 0x1040000,\n\t\t\t\t\t\t0x2000: 0x40000,\n\t\t\t\t\t\t0x3000: 0x20000000,\n\t\t\t\t\t\t0x4000: 0x20040080,\n\t\t\t\t\t\t0x5000: 0x1000080,\n\t\t\t\t\t\t0x6000: 0x21000080,\n\t\t\t\t\t\t0x7000: 0x40080,\n\t\t\t\t\t\t0x8000: 0x1000000,\n\t\t\t\t\t\t0x9000: 0x20040000,\n\t\t\t\t\t\t0xa000: 0x20000080,\n\t\t\t\t\t\t0xb000: 0x21040080,\n\t\t\t\t\t\t0xc000: 0x21040000,\n\t\t\t\t\t\t0xd000: 0x0,\n\t\t\t\t\t\t0xe000: 0x1040080,\n\t\t\t\t\t\t0xf000: 0x21000000,\n\t\t\t\t\t\t0x800: 0x1040080,\n\t\t\t\t\t\t0x1800: 0x21000080,\n\t\t\t\t\t\t0x2800: 0x80,\n\t\t\t\t\t\t0x3800: 0x1040000,\n\t\t\t\t\t\t0x4800: 0x40000,\n\t\t\t\t\t\t0x5800: 0x20040080,\n\t\t\t\t\t\t0x6800: 0x21040000,\n\t\t\t\t\t\t0x7800: 0x20000000,\n\t\t\t\t\t\t0x8800: 0x20040000,\n\t\t\t\t\t\t0x9800: 0x0,\n\t\t\t\t\t\t0xa800: 0x21040080,\n\t\t\t\t\t\t0xb800: 0x1000080,\n\t\t\t\t\t\t0xc800: 0x20000080,\n\t\t\t\t\t\t0xd800: 0x21000000,\n\t\t\t\t\t\t0xe800: 0x1000000,\n\t\t\t\t\t\t0xf800: 0x40080,\n\t\t\t\t\t\t0x10000: 0x40000,\n\t\t\t\t\t\t0x11000: 0x80,\n\t\t\t\t\t\t0x12000: 0x20000000,\n\t\t\t\t\t\t0x13000: 0x21000080,\n\t\t\t\t\t\t0x14000: 0x1000080,\n\t\t\t\t\t\t0x15000: 0x21040000,\n\t\t\t\t\t\t0x16000: 0x20040080,\n\t\t\t\t\t\t0x17000: 0x1000000,\n\t\t\t\t\t\t0x18000: 0x21040080,\n\t\t\t\t\t\t0x19000: 0x21000000,\n\t\t\t\t\t\t0x1a000: 0x1040000,\n\t\t\t\t\t\t0x1b000: 0x20040000,\n\t\t\t\t\t\t0x1c000: 0x40080,\n\t\t\t\t\t\t0x1d000: 0x20000080,\n\t\t\t\t\t\t0x1e000: 0x0,\n\t\t\t\t\t\t0x1f000: 0x1040080,\n\t\t\t\t\t\t0x10800: 0x21000080,\n\t\t\t\t\t\t0x11800: 0x1000000,\n\t\t\t\t\t\t0x12800: 0x1040000,\n\t\t\t\t\t\t0x13800: 0x20040080,\n\t\t\t\t\t\t0x14800: 0x20000000,\n\t\t\t\t\t\t0x15800: 0x1040080,\n\t\t\t\t\t\t0x16800: 0x80,\n\t\t\t\t\t\t0x17800: 0x21040000,\n\t\t\t\t\t\t0x18800: 0x40080,\n\t\t\t\t\t\t0x19800: 0x21040080,\n\t\t\t\t\t\t0x1a800: 0x0,\n\t\t\t\t\t\t0x1b800: 0x21000000,\n\t\t\t\t\t\t0x1c800: 0x1000080,\n\t\t\t\t\t\t0x1d800: 0x40000,\n\t\t\t\t\t\t0x1e800: 0x20040000,\n\t\t\t\t\t\t0x1f800: 0x20000080\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x10000008,\n\t\t\t\t\t\t0x100: 0x2000,\n\t\t\t\t\t\t0x200: 0x10200000,\n\t\t\t\t\t\t0x300: 0x10202008,\n\t\t\t\t\t\t0x400: 0x10002000,\n\t\t\t\t\t\t0x500: 0x200000,\n\t\t\t\t\t\t0x600: 0x200008,\n\t\t\t\t\t\t0x700: 0x10000000,\n\t\t\t\t\t\t0x800: 0x0,\n\t\t\t\t\t\t0x900: 0x10002008,\n\t\t\t\t\t\t0xa00: 0x202000,\n\t\t\t\t\t\t0xb00: 0x8,\n\t\t\t\t\t\t0xc00: 0x10200008,\n\t\t\t\t\t\t0xd00: 0x202008,\n\t\t\t\t\t\t0xe00: 0x2008,\n\t\t\t\t\t\t0xf00: 0x10202000,\n\t\t\t\t\t\t0x80: 0x10200000,\n\t\t\t\t\t\t0x180: 0x10202008,\n\t\t\t\t\t\t0x280: 0x8,\n\t\t\t\t\t\t0x380: 0x200000,\n\t\t\t\t\t\t0x480: 0x202008,\n\t\t\t\t\t\t0x580: 0x10000008,\n\t\t\t\t\t\t0x680: 0x10002000,\n\t\t\t\t\t\t0x780: 0x2008,\n\t\t\t\t\t\t0x880: 0x200008,\n\t\t\t\t\t\t0x980: 0x2000,\n\t\t\t\t\t\t0xa80: 0x10002008,\n\t\t\t\t\t\t0xb80: 0x10200008,\n\t\t\t\t\t\t0xc80: 0x0,\n\t\t\t\t\t\t0xd80: 0x10202000,\n\t\t\t\t\t\t0xe80: 0x202000,\n\t\t\t\t\t\t0xf80: 0x10000000,\n\t\t\t\t\t\t0x1000: 0x10002000,\n\t\t\t\t\t\t0x1100: 0x10200008,\n\t\t\t\t\t\t0x1200: 0x10202008,\n\t\t\t\t\t\t0x1300: 0x2008,\n\t\t\t\t\t\t0x1400: 0x200000,\n\t\t\t\t\t\t0x1500: 0x10000000,\n\t\t\t\t\t\t0x1600: 0x10000008,\n\t\t\t\t\t\t0x1700: 0x202000,\n\t\t\t\t\t\t0x1800: 0x202008,\n\t\t\t\t\t\t0x1900: 0x0,\n\t\t\t\t\t\t0x1a00: 0x8,\n\t\t\t\t\t\t0x1b00: 0x10200000,\n\t\t\t\t\t\t0x1c00: 0x2000,\n\t\t\t\t\t\t0x1d00: 0x10002008,\n\t\t\t\t\t\t0x1e00: 0x10202000,\n\t\t\t\t\t\t0x1f00: 0x200008,\n\t\t\t\t\t\t0x1080: 0x8,\n\t\t\t\t\t\t0x1180: 0x202000,\n\t\t\t\t\t\t0x1280: 0x200000,\n\t\t\t\t\t\t0x1380: 0x10000008,\n\t\t\t\t\t\t0x1480: 0x10002000,\n\t\t\t\t\t\t0x1580: 0x2008,\n\t\t\t\t\t\t0x1680: 0x10202008,\n\t\t\t\t\t\t0x1780: 0x10200000,\n\t\t\t\t\t\t0x1880: 0x10202000,\n\t\t\t\t\t\t0x1980: 0x10200008,\n\t\t\t\t\t\t0x1a80: 0x2000,\n\t\t\t\t\t\t0x1b80: 0x202008,\n\t\t\t\t\t\t0x1c80: 0x200008,\n\t\t\t\t\t\t0x1d80: 0x0,\n\t\t\t\t\t\t0x1e80: 0x10000000,\n\t\t\t\t\t\t0x1f80: 0x10002008\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x100000,\n\t\t\t\t\t\t0x10: 0x2000401,\n\t\t\t\t\t\t0x20: 0x400,\n\t\t\t\t\t\t0x30: 0x100401,\n\t\t\t\t\t\t0x40: 0x2100401,\n\t\t\t\t\t\t0x50: 0x0,\n\t\t\t\t\t\t0x60: 0x1,\n\t\t\t\t\t\t0x70: 0x2100001,\n\t\t\t\t\t\t0x80: 0x2000400,\n\t\t\t\t\t\t0x90: 0x100001,\n\t\t\t\t\t\t0xa0: 0x2000001,\n\t\t\t\t\t\t0xb0: 0x2100400,\n\t\t\t\t\t\t0xc0: 0x2100000,\n\t\t\t\t\t\t0xd0: 0x401,\n\t\t\t\t\t\t0xe0: 0x100400,\n\t\t\t\t\t\t0xf0: 0x2000000,\n\t\t\t\t\t\t0x8: 0x2100001,\n\t\t\t\t\t\t0x18: 0x0,\n\t\t\t\t\t\t0x28: 0x2000401,\n\t\t\t\t\t\t0x38: 0x2100400,\n\t\t\t\t\t\t0x48: 0x100000,\n\t\t\t\t\t\t0x58: 0x2000001,\n\t\t\t\t\t\t0x68: 0x2000000,\n\t\t\t\t\t\t0x78: 0x401,\n\t\t\t\t\t\t0x88: 0x100401,\n\t\t\t\t\t\t0x98: 0x2000400,\n\t\t\t\t\t\t0xa8: 0x2100000,\n\t\t\t\t\t\t0xb8: 0x100001,\n\t\t\t\t\t\t0xc8: 0x400,\n\t\t\t\t\t\t0xd8: 0x2100401,\n\t\t\t\t\t\t0xe8: 0x1,\n\t\t\t\t\t\t0xf8: 0x100400,\n\t\t\t\t\t\t0x100: 0x2000000,\n\t\t\t\t\t\t0x110: 0x100000,\n\t\t\t\t\t\t0x120: 0x2000401,\n\t\t\t\t\t\t0x130: 0x2100001,\n\t\t\t\t\t\t0x140: 0x100001,\n\t\t\t\t\t\t0x150: 0x2000400,\n\t\t\t\t\t\t0x160: 0x2100400,\n\t\t\t\t\t\t0x170: 0x100401,\n\t\t\t\t\t\t0x180: 0x401,\n\t\t\t\t\t\t0x190: 0x2100401,\n\t\t\t\t\t\t0x1a0: 0x100400,\n\t\t\t\t\t\t0x1b0: 0x1,\n\t\t\t\t\t\t0x1c0: 0x0,\n\t\t\t\t\t\t0x1d0: 0x2100000,\n\t\t\t\t\t\t0x1e0: 0x2000001,\n\t\t\t\t\t\t0x1f0: 0x400,\n\t\t\t\t\t\t0x108: 0x100400,\n\t\t\t\t\t\t0x118: 0x2000401,\n\t\t\t\t\t\t0x128: 0x2100001,\n\t\t\t\t\t\t0x138: 0x1,\n\t\t\t\t\t\t0x148: 0x2000000,\n\t\t\t\t\t\t0x158: 0x100000,\n\t\t\t\t\t\t0x168: 0x401,\n\t\t\t\t\t\t0x178: 0x2100400,\n\t\t\t\t\t\t0x188: 0x2000001,\n\t\t\t\t\t\t0x198: 0x2100000,\n\t\t\t\t\t\t0x1a8: 0x0,\n\t\t\t\t\t\t0x1b8: 0x2100401,\n\t\t\t\t\t\t0x1c8: 0x100401,\n\t\t\t\t\t\t0x1d8: 0x400,\n\t\t\t\t\t\t0x1e8: 0x2000400,\n\t\t\t\t\t\t0x1f8: 0x100001\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x8000820,\n\t\t\t\t\t\t0x1: 0x20000,\n\t\t\t\t\t\t0x2: 0x8000000,\n\t\t\t\t\t\t0x3: 0x20,\n\t\t\t\t\t\t0x4: 0x20020,\n\t\t\t\t\t\t0x5: 0x8020820,\n\t\t\t\t\t\t0x6: 0x8020800,\n\t\t\t\t\t\t0x7: 0x800,\n\t\t\t\t\t\t0x8: 0x8020000,\n\t\t\t\t\t\t0x9: 0x8000800,\n\t\t\t\t\t\t0xa: 0x20800,\n\t\t\t\t\t\t0xb: 0x8020020,\n\t\t\t\t\t\t0xc: 0x820,\n\t\t\t\t\t\t0xd: 0x0,\n\t\t\t\t\t\t0xe: 0x8000020,\n\t\t\t\t\t\t0xf: 0x20820,\n\t\t\t\t\t\t0x80000000: 0x800,\n\t\t\t\t\t\t0x80000001: 0x8020820,\n\t\t\t\t\t\t0x80000002: 0x8000820,\n\t\t\t\t\t\t0x80000003: 0x8000000,\n\t\t\t\t\t\t0x80000004: 0x8020000,\n\t\t\t\t\t\t0x80000005: 0x20800,\n\t\t\t\t\t\t0x80000006: 0x20820,\n\t\t\t\t\t\t0x80000007: 0x20,\n\t\t\t\t\t\t0x80000008: 0x8000020,\n\t\t\t\t\t\t0x80000009: 0x820,\n\t\t\t\t\t\t0x8000000a: 0x20020,\n\t\t\t\t\t\t0x8000000b: 0x8020800,\n\t\t\t\t\t\t0x8000000c: 0x0,\n\t\t\t\t\t\t0x8000000d: 0x8020020,\n\t\t\t\t\t\t0x8000000e: 0x8000800,\n\t\t\t\t\t\t0x8000000f: 0x20000,\n\t\t\t\t\t\t0x10: 0x20820,\n\t\t\t\t\t\t0x11: 0x8020800,\n\t\t\t\t\t\t0x12: 0x20,\n\t\t\t\t\t\t0x13: 0x800,\n\t\t\t\t\t\t0x14: 0x8000800,\n\t\t\t\t\t\t0x15: 0x8000020,\n\t\t\t\t\t\t0x16: 0x8020020,\n\t\t\t\t\t\t0x17: 0x20000,\n\t\t\t\t\t\t0x18: 0x0,\n\t\t\t\t\t\t0x19: 0x20020,\n\t\t\t\t\t\t0x1a: 0x8020000,\n\t\t\t\t\t\t0x1b: 0x8000820,\n\t\t\t\t\t\t0x1c: 0x8020820,\n\t\t\t\t\t\t0x1d: 0x20800,\n\t\t\t\t\t\t0x1e: 0x820,\n\t\t\t\t\t\t0x1f: 0x8000000,\n\t\t\t\t\t\t0x80000010: 0x20000,\n\t\t\t\t\t\t0x80000011: 0x800,\n\t\t\t\t\t\t0x80000012: 0x8020020,\n\t\t\t\t\t\t0x80000013: 0x20820,\n\t\t\t\t\t\t0x80000014: 0x20,\n\t\t\t\t\t\t0x80000015: 0x8020000,\n\t\t\t\t\t\t0x80000016: 0x8000000,\n\t\t\t\t\t\t0x80000017: 0x8000820,\n\t\t\t\t\t\t0x80000018: 0x8020820,\n\t\t\t\t\t\t0x80000019: 0x8000020,\n\t\t\t\t\t\t0x8000001a: 0x8000800,\n\t\t\t\t\t\t0x8000001b: 0x0,\n\t\t\t\t\t\t0x8000001c: 0x20800,\n\t\t\t\t\t\t0x8000001d: 0x820,\n\t\t\t\t\t\t0x8000001e: 0x20020,\n\t\t\t\t\t\t0x8000001f: 0x8020800\n\t\t\t\t\t}];\n\n\t\t\t\t\t// Masks that select the SBOX input\n\t\t\t\t\tvar SBOX_MASK = [0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f];\n\n\t\t\t\t\t/**\n * DES block cipher algorithm.\n */\n\t\t\t\t\tvar DES = C_algo.DES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\n\t\t\t\t\t\t\t// Select 56 bits according to PC1\n\t\t\t\t\t\t\tvar keyBits = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 56; i++) {\n\t\t\t\t\t\t\t\tvar keyBitPos = PC1[i] - 1;\n\t\t\t\t\t\t\t\tkeyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Assemble 16 subkeys\n\t\t\t\t\t\t\tvar subKeys = this._subKeys = [];\n\t\t\t\t\t\t\tfor (var nSubKey = 0; nSubKey < 16; nSubKey++) {\n\t\t\t\t\t\t\t\t// Create subkey\n\t\t\t\t\t\t\t\tvar subKey = subKeys[nSubKey] = [];\n\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar bitShift = BIT_SHIFTS[nSubKey];\n\n\t\t\t\t\t\t\t\t// Select 48 bits according to PC2\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\t\t\t\t\t\t// Select from the left 28 key bits\n\t\t\t\t\t\t\t\t\tsubKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;\n\n\t\t\t\t\t\t\t\t\t// Select from the right 28 key bits\n\t\t\t\t\t\t\t\t\tsubKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Since each subkey is applied to an expanded 32-bit input,\n\t\t\t\t\t\t\t\t// the subkey can be broken into 8 values scaled to 32-bits,\n\t\t\t\t\t\t\t\t// which allows the key to be used without expansion\n\t\t\t\t\t\t\t\tsubKey[0] = subKey[0] << 1 | subKey[0] >>> 31;\n\t\t\t\t\t\t\t\tfor (var i = 1; i < 7; i++) {\n\t\t\t\t\t\t\t\t\tsubKey[i] = subKey[i] >>> (i - 1) * 4 + 3;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsubKey[7] = subKey[7] << 5 | subKey[7] >>> 27;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Compute inverse subkeys\n\t\t\t\t\t\t\tvar invSubKeys = this._invSubKeys = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\tinvSubKeys[i] = subKeys[15 - i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._subKeys);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._invSubKeys);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doCryptBlock: function _doCryptBlock(M, offset, subKeys) {\n\t\t\t\t\t\t\t// Get input\n\t\t\t\t\t\t\tthis._lBlock = M[offset];\n\t\t\t\t\t\t\tthis._rBlock = M[offset + 1];\n\n\t\t\t\t\t\t\t// Initial permutation\n\t\t\t\t\t\t\texchangeLR.call(this, 4, 0x0f0f0f0f);\n\t\t\t\t\t\t\texchangeLR.call(this, 16, 0x0000ffff);\n\t\t\t\t\t\t\texchangeRL.call(this, 2, 0x33333333);\n\t\t\t\t\t\t\texchangeRL.call(this, 8, 0x00ff00ff);\n\t\t\t\t\t\t\texchangeLR.call(this, 1, 0x55555555);\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 0; round < 16; round++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar subKey = subKeys[round];\n\t\t\t\t\t\t\t\tvar lBlock = this._lBlock;\n\t\t\t\t\t\t\t\tvar rBlock = this._rBlock;\n\n\t\t\t\t\t\t\t\t// Feistel function\n\t\t\t\t\t\t\t\tvar f = 0;\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\t\tf |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._lBlock = rBlock;\n\t\t\t\t\t\t\t\tthis._rBlock = lBlock ^ f;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Undo swap from last round\n\t\t\t\t\t\t\tvar t = this._lBlock;\n\t\t\t\t\t\t\tthis._lBlock = this._rBlock;\n\t\t\t\t\t\t\tthis._rBlock = t;\n\n\t\t\t\t\t\t\t// Final permutation\n\t\t\t\t\t\t\texchangeLR.call(this, 1, 0x55555555);\n\t\t\t\t\t\t\texchangeRL.call(this, 8, 0x00ff00ff);\n\t\t\t\t\t\t\texchangeRL.call(this, 2, 0x33333333);\n\t\t\t\t\t\t\texchangeLR.call(this, 16, 0x0000ffff);\n\t\t\t\t\t\t\texchangeLR.call(this, 4, 0x0f0f0f0f);\n\n\t\t\t\t\t\t\t// Set output\n\t\t\t\t\t\t\tM[offset] = this._lBlock;\n\t\t\t\t\t\t\tM[offset + 1] = this._rBlock;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 64 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32,\n\n\t\t\t\t\t\tblockSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t// Swap bits across the left and right words\n\t\t\t\t\tfunction exchangeLR(offset, mask) {\n\t\t\t\t\t\tvar t = (this._lBlock >>> offset ^ this._rBlock) & mask;\n\t\t\t\t\t\tthis._rBlock ^= t;\n\t\t\t\t\t\tthis._lBlock ^= t << offset;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction exchangeRL(offset, mask) {\n\t\t\t\t\t\tvar t = (this._rBlock >>> offset ^ this._lBlock) & mask;\n\t\t\t\t\t\tthis._lBlock ^= t;\n\t\t\t\t\t\tthis._rBlock ^= t << offset;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.DES = BlockCipher._createHelper(DES);\n\n\t\t\t\t\t/**\n * Triple-DES block cipher algorithm.\n */\n\t\t\t\t\tvar TripleDES = C_algo.TripleDES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\n\t\t\t\t\t\t\t// Create DES instances\n\t\t\t\t\t\t\tthis._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));\n\t\t\t\t\t\t\tthis._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));\n\t\t\t\t\t\t\tthis._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._des1.encryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des2.decryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des3.encryptBlock(M, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._des3.decryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des2.encryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des1.decryptBlock(M, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 192 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32,\n\n\t\t\t\t\t\tblockSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.TripleDES = BlockCipher._createHelper(TripleDES);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.TripleDES;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 36 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t/**\n * RC4 stream cipher algorithm.\n */\n\t\t\t\t\tvar RC4 = C_algo.RC4 = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\t\t\t\t\t\t\tvar keySigBytes = key.sigBytes;\n\n\t\t\t\t\t\t\t// Init sbox\n\t\t\t\t\t\t\tvar S = this._S = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\t\tS[i] = i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Key setup\n\t\t\t\t\t\t\tfor (var i = 0, j = 0; i < 256; i++) {\n\t\t\t\t\t\t\t\tvar keyByteIndex = i % keySigBytes;\n\t\t\t\t\t\t\t\tvar keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 0xff;\n\n\t\t\t\t\t\t\t\tj = (j + S[i] + keyByte) % 256;\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tvar t = S[i];\n\t\t\t\t\t\t\t\tS[i] = S[j];\n\t\t\t\t\t\t\t\tS[j] = t;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Counters\n\t\t\t\t\t\t\tthis._i = this._j = 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\tM[offset] ^= generateKeystreamWord.call(this);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 256 / 32,\n\n\t\t\t\t\t\tivSize: 0\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction generateKeystreamWord() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar S = this._S;\n\t\t\t\t\t\tvar i = this._i;\n\t\t\t\t\t\tvar j = this._j;\n\n\t\t\t\t\t\t// Generate keystream word\n\t\t\t\t\t\tvar keystreamWord = 0;\n\t\t\t\t\t\tfor (var n = 0; n < 4; n++) {\n\t\t\t\t\t\t\ti = (i + 1) % 256;\n\t\t\t\t\t\t\tj = (j + S[i]) % 256;\n\n\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\tvar t = S[i];\n\t\t\t\t\t\t\tS[i] = S[j];\n\t\t\t\t\t\t\tS[j] = t;\n\n\t\t\t\t\t\t\tkeystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Update counters\n\t\t\t\t\t\tthis._i = i;\n\t\t\t\t\t\tthis._j = j;\n\n\t\t\t\t\t\treturn keystreamWord;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RC4 = StreamCipher._createHelper(RC4);\n\n\t\t\t\t\t/**\n * Modified RC4 stream cipher algorithm.\n */\n\t\t\t\t\tvar RC4Drop = C_algo.RC4Drop = RC4.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} drop The number of keystream words to drop. Default 192\n */\n\t\t\t\t\t\tcfg: RC4.cfg.extend({\n\t\t\t\t\t\t\tdrop: 192\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tRC4._doReset.call(this);\n\n\t\t\t\t\t\t\t// Drop\n\t\t\t\t\t\t\tfor (var i = this.cfg.drop; i > 0; i--) {\n\t\t\t\t\t\t\t\tgenerateKeystreamWord.call(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RC4Drop = StreamCipher._createHelper(RC4Drop);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.RC4;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 37 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar S = [];\n\t\t\t\t\tvar C_ = [];\n\t\t\t\t\tvar G = [];\n\n\t\t\t\t\t/**\n * Rabbit stream cipher algorithm\n */\n\t\t\t\t\tvar Rabbit = C_algo.Rabbit = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar K = this._key.words;\n\t\t\t\t\t\t\tvar iv = this.cfg.iv;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tK[i] = (K[i] << 8 | K[i] >>> 24) & 0x00ff00ff | (K[i] << 24 | K[i] >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Generate initial state values\n\t\t\t\t\t\t\tvar X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];\n\n\t\t\t\t\t\t\t// Generate initial counter values\n\t\t\t\t\t\t\tvar C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];\n\n\t\t\t\t\t\t\t// Carry bit\n\t\t\t\t\t\t\tthis._b = 0;\n\n\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Modify the counters\n\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\tC[i] ^= X[i + 4 & 7];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// IV setup\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar IV = iv.words;\n\t\t\t\t\t\t\t\tvar IV_0 = IV[0];\n\t\t\t\t\t\t\t\tvar IV_1 = IV[1];\n\n\t\t\t\t\t\t\t\t// Generate four subvectors\n\t\t\t\t\t\t\t\tvar i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i1 = i0 >>> 16 | i2 & 0xffff0000;\n\t\t\t\t\t\t\t\tvar i3 = i2 << 16 | i0 & 0x0000ffff;\n\n\t\t\t\t\t\t\t\t// Modify counter values\n\t\t\t\t\t\t\t\tC[0] ^= i0;\n\t\t\t\t\t\t\t\tC[1] ^= i1;\n\t\t\t\t\t\t\t\tC[2] ^= i2;\n\t\t\t\t\t\t\t\tC[3] ^= i3;\n\t\t\t\t\t\t\t\tC[4] ^= i0;\n\t\t\t\t\t\t\t\tC[5] ^= i1;\n\t\t\t\t\t\t\t\tC[6] ^= i2;\n\t\t\t\t\t\t\t\tC[7] ^= i3;\n\n\t\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar X = this._X;\n\n\t\t\t\t\t\t\t// Iterate the system\n\t\t\t\t\t\t\tnextState.call(this);\n\n\t\t\t\t\t\t\t// Generate four keystream words\n\t\t\t\t\t\t\tS[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;\n\t\t\t\t\t\t\tS[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;\n\t\t\t\t\t\t\tS[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;\n\t\t\t\t\t\t\tS[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tS[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\t\tM[offset + i] ^= S[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction nextState() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar X = this._X;\n\t\t\t\t\t\tvar C = this._C;\n\n\t\t\t\t\t\t// Save old counter values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tC_[i] = C[i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new counter values\n\t\t\t\t\t\tC[0] = C[0] + 0x4d34d34d + this._b | 0;\n\t\t\t\t\t\tC[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tthis._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;\n\n\t\t\t\t\t\t// Calculate the g-values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tvar gx = X[i] + C[i];\n\n\t\t\t\t\t\t\t// Construct high and low argument for squaring\n\t\t\t\t\t\t\tvar ga = gx & 0xffff;\n\t\t\t\t\t\t\tvar gb = gx >>> 16;\n\n\t\t\t\t\t\t\t// Calculate high and low result of squaring\n\t\t\t\t\t\t\tvar gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;\n\t\t\t\t\t\t\tvar gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);\n\n\t\t\t\t\t\t\t// High XOR low\n\t\t\t\t\t\t\tG[i] = gh ^ gl;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new state values\n\t\t\t\t\t\tX[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;\n\t\t\t\t\t\tX[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;\n\t\t\t\t\t\tX[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;\n\t\t\t\t\t\tX[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;\n\t\t\t\t\t\tX[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;\n\t\t\t\t\t\tX[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;\n\t\t\t\t\t\tX[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;\n\t\t\t\t\t\tX[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.Rabbit = StreamCipher._createHelper(Rabbit);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.Rabbit;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 38 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar S = [];\n\t\t\t\t\tvar C_ = [];\n\t\t\t\t\tvar G = [];\n\n\t\t\t\t\t/**\n * Rabbit stream cipher algorithm.\n *\n * This is a legacy version that neglected to convert the key to little-endian.\n * This error doesn't affect the cipher's security,\n * but it does affect its compatibility with other implementations.\n */\n\t\t\t\t\tvar RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar K = this._key.words;\n\t\t\t\t\t\t\tvar iv = this.cfg.iv;\n\n\t\t\t\t\t\t\t// Generate initial state values\n\t\t\t\t\t\t\tvar X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];\n\n\t\t\t\t\t\t\t// Generate initial counter values\n\t\t\t\t\t\t\tvar C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];\n\n\t\t\t\t\t\t\t// Carry bit\n\t\t\t\t\t\t\tthis._b = 0;\n\n\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Modify the counters\n\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\tC[i] ^= X[i + 4 & 7];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// IV setup\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar IV = iv.words;\n\t\t\t\t\t\t\t\tvar IV_0 = IV[0];\n\t\t\t\t\t\t\t\tvar IV_1 = IV[1];\n\n\t\t\t\t\t\t\t\t// Generate four subvectors\n\t\t\t\t\t\t\t\tvar i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i1 = i0 >>> 16 | i2 & 0xffff0000;\n\t\t\t\t\t\t\t\tvar i3 = i2 << 16 | i0 & 0x0000ffff;\n\n\t\t\t\t\t\t\t\t// Modify counter values\n\t\t\t\t\t\t\t\tC[0] ^= i0;\n\t\t\t\t\t\t\t\tC[1] ^= i1;\n\t\t\t\t\t\t\t\tC[2] ^= i2;\n\t\t\t\t\t\t\t\tC[3] ^= i3;\n\t\t\t\t\t\t\t\tC[4] ^= i0;\n\t\t\t\t\t\t\t\tC[5] ^= i1;\n\t\t\t\t\t\t\t\tC[6] ^= i2;\n\t\t\t\t\t\t\t\tC[7] ^= i3;\n\n\t\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar X = this._X;\n\n\t\t\t\t\t\t\t// Iterate the system\n\t\t\t\t\t\t\tnextState.call(this);\n\n\t\t\t\t\t\t\t// Generate four keystream words\n\t\t\t\t\t\t\tS[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;\n\t\t\t\t\t\t\tS[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;\n\t\t\t\t\t\t\tS[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;\n\t\t\t\t\t\t\tS[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tS[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\t\tM[offset + i] ^= S[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction nextState() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar X = this._X;\n\t\t\t\t\t\tvar C = this._C;\n\n\t\t\t\t\t\t// Save old counter values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tC_[i] = C[i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new counter values\n\t\t\t\t\t\tC[0] = C[0] + 0x4d34d34d + this._b | 0;\n\t\t\t\t\t\tC[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tthis._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;\n\n\t\t\t\t\t\t// Calculate the g-values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tvar gx = X[i] + C[i];\n\n\t\t\t\t\t\t\t// Construct high and low argument for squaring\n\t\t\t\t\t\t\tvar ga = gx & 0xffff;\n\t\t\t\t\t\t\tvar gb = gx >>> 16;\n\n\t\t\t\t\t\t\t// Calculate high and low result of squaring\n\t\t\t\t\t\t\tvar gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;\n\t\t\t\t\t\t\tvar gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);\n\n\t\t\t\t\t\t\t// High XOR low\n\t\t\t\t\t\t\tG[i] = gh ^ gl;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new state values\n\t\t\t\t\t\tX[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;\n\t\t\t\t\t\tX[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;\n\t\t\t\t\t\tX[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;\n\t\t\t\t\t\tX[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;\n\t\t\t\t\t\tX[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;\n\t\t\t\t\t\tX[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;\n\t\t\t\t\t\tX[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;\n\t\t\t\t\t\tX[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.RabbitLegacy;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 39 */\n\t\t/***/function (module, exports) {\n\n\t\t\t;(function () {\n\t\t\t\tfunction Array_h(length) {\n\t\t\t\t\tthis.array = length === undefined ? [] : new Array(length);\n\t\t\t\t}\n\n\t\t\t\tArray_h.prototype = {\n\t\t\t\t\t/**\n * 返回数组长度\n *\n * @return {Number} length [数组长度]\n */\n\t\t\t\t\tlength: function length() {\n\t\t\t\t\t\treturn this.array.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tat: function at(index) {\n\t\t\t\t\t\treturn this.array[index];\n\t\t\t\t\t},\n\n\t\t\t\t\tset: function set(index, obj) {\n\t\t\t\t\t\tthis.array[index] = obj;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 向数组的末尾添加一个或多个元素,并返回新的长度。\n *\n * @param {*} obj [description]\n * @return {Number} length [新数组的长度]\n */\n\t\t\t\t\tpush: function push(obj) {\n\t\t\t\t\t\treturn this.array.push(obj);\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回数组中选定的元素\n *\n * @param {Number} start [开始索引值]\n * @param {Number} end [结束索引值]\n * @return {Array} newArray [新的数组]\n */\n\t\t\t\t\tslice: function slice(start, end) {\n\t\t\t\t\t\treturn this.array = this.array.slice(start, end);\n\t\t\t\t\t},\n\n\t\t\t\t\tconcat: function concat(array) {\n\t\t\t\t\t\tthis.array = this.array.concat(array);\n\t\t\t\t\t},\n\n\t\t\t\t\tremove: function remove(index, count) {\n\t\t\t\t\t\tcount = count === undefined ? 1 : count;\n\t\t\t\t\t\tthis.array.splice(index, count);\n\t\t\t\t\t},\n\n\t\t\t\t\tjoin: function join(separator) {\n\t\t\t\t\t\treturn this.array.join(separator);\n\t\t\t\t\t},\n\n\t\t\t\t\tclear: function clear() {\n\t\t\t\t\t\tthis.array.length = 0;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t/**\n * 先进先出队列 (First Input First Output)\n *\n * 一种先进先出的数据缓存器\n */\n\t\t\t\tvar Queue = function Queue() {\n\t\t\t\t\tthis._array_h = new Array_h();\n\t\t\t\t};\n\n\t\t\t\tQueue.prototype = {\n\t\t\t\t\t_index: 0,\n\n\t\t\t\t\t/**\n * 排队\n *\n * @param {Object} obj [description]\n * @return {[type]} [description]\n */\n\t\t\t\t\tpush: function push(obj) {\n\t\t\t\t\t\tthis._array_h.push(obj);\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 出队\n *\n * @return {Object} [description]\n */\n\t\t\t\t\tpop: function pop() {\n\t\t\t\t\t\tvar ret = null;\n\t\t\t\t\t\tif (this._array_h.length()) {\n\t\t\t\t\t\t\tret = this._array_h.at(this._index);\n\t\t\t\t\t\t\tif (++this._index * 2 >= this._array_h.length()) {\n\t\t\t\t\t\t\t\tthis._array_h.slice(this._index);\n\t\t\t\t\t\t\t\tthis._index = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回队列中头部(即最新添加的)的动态对象\n *\n * @return {Object} [description]\n */\n\t\t\t\t\thead: function head() {\n\t\t\t\t\t\tvar ret = null,\n\t\t\t\t\t\t len = this._array_h.length();\n\t\t\t\t\t\tif (len) {\n\t\t\t\t\t\t\tret = this._array_h.at(len - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回队列中尾部(即最早添加的)的动态对象\n *\n * @return {Object} [description]\n */\n\t\t\t\t\ttail: function tail() {\n\t\t\t\t\t\tvar ret = null,\n\t\t\t\t\t\t len = this._array_h.length();\n\t\t\t\t\t\tif (len) {\n\t\t\t\t\t\t\tret = this._array_h.at(this._index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回数据队列长度\n *\n * @return {Number} [description]\n */\n\t\t\t\t\tlength: function length() {\n\t\t\t\t\t\treturn this._array_h.length() - this._index;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 队列是否为空\n *\n * @return {Boolean} [description]\n */\n\t\t\t\t\tempty: function empty() {\n\t\t\t\t\t\treturn this._array_h.length() === 0;\n\t\t\t\t\t},\n\n\t\t\t\t\tclear: function clear() {\n\t\t\t\t\t\tthis._array_h.clear();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\texports.Queue = Queue;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 40 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; // Underscore.js 1.8.3\n\t\t\t// http://underscorejs.org\n\t\t\t// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t\t\t// Underscore may be freely distributed under the MIT license.\n\n\t\t\t(function () {\n\n\t\t\t\t// Baseline setup\n\t\t\t\t// --------------\n\n\t\t\t\t// Establish the root object, `window` in the browser, or `exports` on the server.\n\t\t\t\tvar root = this;\n\n\t\t\t\t// Save the previous value of the `_` variable.\n\t\t\t\tvar previousUnderscore = root._;\n\n\t\t\t\t// Save bytes in the minified (but not gzipped) version:\n\t\t\t\tvar ArrayProto = Array.prototype,\n\t\t\t\t ObjProto = Object.prototype,\n\t\t\t\t FuncProto = Function.prototype;\n\n\t\t\t\t// Create quick reference variables for speed access to core prototypes.\n\t\t\t\tvar push = ArrayProto.push,\n\t\t\t\t slice = ArrayProto.slice,\n\t\t\t\t toString = ObjProto.toString,\n\t\t\t\t hasOwnProperty = ObjProto.hasOwnProperty;\n\n\t\t\t\t// All **ECMAScript 5** native function implementations that we hope to use\n\t\t\t\t// are declared here.\n\t\t\t\tvar nativeIsArray = Array.isArray,\n\t\t\t\t nativeKeys = Object.keys,\n\t\t\t\t nativeBind = FuncProto.bind,\n\t\t\t\t nativeCreate = Object.create;\n\n\t\t\t\t// Naked function reference for surrogate-prototype-swapping.\n\t\t\t\tvar Ctor = function Ctor() {};\n\n\t\t\t\t// Create a safe reference to the Underscore object for use below.\n\t\t\t\tvar _ = function _(obj) {\n\t\t\t\t\tif (obj instanceof _) return obj;\n\t\t\t\t\tif (!(this instanceof _)) return new _(obj);\n\t\t\t\t\tthis._wrapped = obj;\n\t\t\t\t};\n\n\t\t\t\t// Export the Underscore object for **Node.js**, with\n\t\t\t\t// backwards-compatibility for the old `require()` API. If we're in\n\t\t\t\t// the browser, add `_` as a global object.\n\t\t\t\tif (true) {\n\t\t\t\t\tif (typeof module !== 'undefined' && module.exports) {\n\t\t\t\t\t\texports = module.exports = _;\n\t\t\t\t\t}\n\t\t\t\t\texports._ = _;\n\t\t\t\t} else {\n\t\t\t\t\troot._ = _;\n\t\t\t\t}\n\n\t\t\t\t// Current version.\n\t\t\t\t_.VERSION = '1.8.3';\n\n\t\t\t\t// Internal function that returns an efficient (for current engines) version\n\t\t\t\t// of the passed-in callback, to be repeatedly applied in other Underscore\n\t\t\t\t// functions.\n\t\t\t\tvar optimizeCb = function optimizeCb(func, context, argCount) {\n\t\t\t\t\tif (context === void 0) return func;\n\t\t\t\t\tswitch (argCount == null ? 3 : argCount) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\treturn function (value) {\n\t\t\t\t\t\t\t\treturn func.call(context, value);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\treturn function (value, other) {\n\t\t\t\t\t\t\t\treturn func.call(context, value, other);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\treturn function (value, index, collection) {\n\t\t\t\t\t\t\t\treturn func.call(context, value, index, collection);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\treturn function (accumulator, value, index, collection) {\n\t\t\t\t\t\t\t\treturn func.call(context, accumulator, value, index, collection);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn func.apply(context, arguments);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// A mostly-internal function to generate callbacks that can be applied\n\t\t\t\t// to each element in a collection, returning the desired result — either\n\t\t\t\t// identity, an arbitrary callback, a property matcher, or a property accessor.\n\t\t\t\tvar cb = function cb(value, context, argCount) {\n\t\t\t\t\tif (value == null) return _.identity;\n\t\t\t\t\tif (_.isFunction(value)) return optimizeCb(value, context, argCount);\n\t\t\t\t\tif (_.isObject(value)) return _.matcher(value);\n\t\t\t\t\treturn _.property(value);\n\t\t\t\t};\n\t\t\t\t_.iteratee = function (value, context) {\n\t\t\t\t\treturn cb(value, context, Infinity);\n\t\t\t\t};\n\n\t\t\t\t// An internal function for creating assigner functions.\n\t\t\t\tvar createAssigner = function createAssigner(keysFunc, undefinedOnly) {\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\tvar length = arguments.length;\n\t\t\t\t\t\tif (length < 2 || obj == null) return obj;\n\t\t\t\t\t\tfor (var index = 1; index < length; index++) {\n\t\t\t\t\t\t\tvar source = arguments[index],\n\t\t\t\t\t\t\t keys = keysFunc(source),\n\t\t\t\t\t\t\t l = keys.length;\n\t\t\t\t\t\t\tfor (var i = 0; i < l; i++) {\n\t\t\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\t\t\tif (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// An internal function for creating a new object that inherits from another.\n\t\t\t\tvar baseCreate = function baseCreate(prototype) {\n\t\t\t\t\tif (!_.isObject(prototype)) return {};\n\t\t\t\t\tif (nativeCreate) return nativeCreate(prototype);\n\t\t\t\t\tCtor.prototype = prototype;\n\t\t\t\t\tvar result = new Ctor();\n\t\t\t\t\tCtor.prototype = null;\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tvar property = function property(key) {\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\treturn obj == null ? void 0 : obj[key];\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Helper for collection methods to determine whether a collection\n\t\t\t\t// should be iterated as an array or as an object\n\t\t\t\t// Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n\t\t\t\t// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n\t\t\t\tvar MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n\t\t\t\tvar getLength = property('length');\n\t\t\t\tvar isArrayLike = function isArrayLike(collection) {\n\t\t\t\t\tvar length = getLength(collection);\n\t\t\t\t\treturn typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n\t\t\t\t};\n\n\t\t\t\t// Collection Functions\n\t\t\t\t// --------------------\n\n\t\t\t\t// The cornerstone, an `each` implementation, aka `forEach`.\n\t\t\t\t// Handles raw objects in addition to array-likes. Treats all\n\t\t\t\t// sparse array-likes as if they were dense.\n\t\t\t\t_.each = _.forEach = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = optimizeCb(iteratee, context);\n\t\t\t\t\tvar i, length;\n\t\t\t\t\tif (isArrayLike(obj)) {\n\t\t\t\t\t\tfor (i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\titeratee(obj[i], i, obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\t\tfor (i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\t\titeratee(obj[keys[i]], keys[i], obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Return the results of applying the iteratee to each element.\n\t\t\t\t_.map = _.collect = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length,\n\t\t\t\t\t results = Array(length);\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tresults[index] = iteratee(obj[currentKey], currentKey, obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Create a reducing function iterating left or right.\n\t\t\t\tfunction createReduce(dir) {\n\t\t\t\t\t// Optimized iterator function as using arguments.length\n\t\t\t\t\t// in the main function will deoptimize the, see #1991.\n\t\t\t\t\tfunction iterator(obj, iteratee, memo, keys, index, length) {\n\t\t\t\t\t\tfor (; index >= 0 && index < length; index += dir) {\n\t\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\t\tmemo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn memo;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn function (obj, iteratee, memo, context) {\n\t\t\t\t\t\titeratee = optimizeCb(iteratee, context, 4);\n\t\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t\t length = (keys || obj).length,\n\t\t\t\t\t\t index = dir > 0 ? 0 : length - 1;\n\t\t\t\t\t\t// Determine the initial value if none is provided.\n\t\t\t\t\t\tif (arguments.length < 3) {\n\t\t\t\t\t\t\tmemo = obj[keys ? keys[index] : index];\n\t\t\t\t\t\t\tindex += dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn iterator(obj, iteratee, memo, keys, index, length);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// **Reduce** builds up a single result from a list of values, aka `inject`,\n\t\t\t\t// or `foldl`.\n\t\t\t\t_.reduce = _.foldl = _.inject = createReduce(1);\n\n\t\t\t\t// The right-associative version of reduce, also known as `foldr`.\n\t\t\t\t_.reduceRight = _.foldr = createReduce(-1);\n\n\t\t\t\t// Return the first value which passes a truth test. Aliased as `detect`.\n\t\t\t\t_.find = _.detect = function (obj, predicate, context) {\n\t\t\t\t\tvar key;\n\t\t\t\t\tif (isArrayLike(obj)) {\n\t\t\t\t\t\tkey = _.findIndex(obj, predicate, context);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkey = _.findKey(obj, predicate, context);\n\t\t\t\t\t}\n\t\t\t\t\tif (key !== void 0 && key !== -1) return obj[key];\n\t\t\t\t};\n\n\t\t\t\t// Return all the elements that pass a truth test.\n\t\t\t\t// Aliased as `select`.\n\t\t\t\t_.filter = _.select = function (obj, predicate, context) {\n\t\t\t\t\tvar results = [];\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\tif (predicate(value, index, list)) results.push(value);\n\t\t\t\t\t});\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Return all the elements for which a truth test fails.\n\t\t\t\t_.reject = function (obj, predicate, context) {\n\t\t\t\t\treturn _.filter(obj, _.negate(cb(predicate)), context);\n\t\t\t\t};\n\n\t\t\t\t// Determine whether all of the elements match a truth test.\n\t\t\t\t// Aliased as `all`.\n\t\t\t\t_.every = _.all = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tif (!predicate(obj[currentKey], currentKey, obj)) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Determine if at least one element in the object matches a truth test.\n\t\t\t\t// Aliased as `any`.\n\t\t\t\t_.some = _.any = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tif (predicate(obj[currentKey], currentKey, obj)) return true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\n\t\t\t\t// Determine if the array or object contains a given item (using `===`).\n\t\t\t\t// Aliased as `includes` and `include`.\n\t\t\t\t_.contains = _.includes = _.include = function (obj, item, fromIndex, guard) {\n\t\t\t\t\tif (!isArrayLike(obj)) obj = _.values(obj);\n\t\t\t\t\tif (typeof fromIndex != 'number' || guard) fromIndex = 0;\n\t\t\t\t\treturn _.indexOf(obj, item, fromIndex) >= 0;\n\t\t\t\t};\n\n\t\t\t\t// Invoke a method (with arguments) on every item in a collection.\n\t\t\t\t_.invoke = function (obj, method) {\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\tvar isFunc = _.isFunction(method);\n\t\t\t\t\treturn _.map(obj, function (value) {\n\t\t\t\t\t\tvar func = isFunc ? method : value[method];\n\t\t\t\t\t\treturn func == null ? func : func.apply(value, args);\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `map`: fetching a property.\n\t\t\t\t_.pluck = function (obj, key) {\n\t\t\t\t\treturn _.map(obj, _.property(key));\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `filter`: selecting only objects\n\t\t\t\t// containing specific `key:value` pairs.\n\t\t\t\t_.where = function (obj, attrs) {\n\t\t\t\t\treturn _.filter(obj, _.matcher(attrs));\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `find`: getting the first object\n\t\t\t\t// containing specific `key:value` pairs.\n\t\t\t\t_.findWhere = function (obj, attrs) {\n\t\t\t\t\treturn _.find(obj, _.matcher(attrs));\n\t\t\t\t};\n\n\t\t\t\t// Return the maximum element (or element-based computation).\n\t\t\t\t_.max = function (obj, iteratee, context) {\n\t\t\t\t\tvar result = -Infinity,\n\t\t\t\t\t lastComputed = -Infinity,\n\t\t\t\t\t value,\n\t\t\t\t\t computed;\n\t\t\t\t\tif (iteratee == null && obj != null) {\n\t\t\t\t\t\tobj = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\t\tfor (var i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\tvalue = obj[i];\n\t\t\t\t\t\t\tif (value > result) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\t\tcomputed = iteratee(value, index, list);\n\t\t\t\t\t\t\tif (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t\tlastComputed = computed;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return the minimum element (or element-based computation).\n\t\t\t\t_.min = function (obj, iteratee, context) {\n\t\t\t\t\tvar result = Infinity,\n\t\t\t\t\t lastComputed = Infinity,\n\t\t\t\t\t value,\n\t\t\t\t\t computed;\n\t\t\t\t\tif (iteratee == null && obj != null) {\n\t\t\t\t\t\tobj = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\t\tfor (var i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\tvalue = obj[i];\n\t\t\t\t\t\t\tif (value < result) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\t\tcomputed = iteratee(value, index, list);\n\t\t\t\t\t\t\tif (computed < lastComputed || computed === Infinity && result === Infinity) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t\tlastComputed = computed;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Shuffle a collection, using the modern version of the\n\t\t\t\t// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n\t\t\t\t_.shuffle = function (obj) {\n\t\t\t\t\tvar set = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\tvar length = set.length;\n\t\t\t\t\tvar shuffled = Array(length);\n\t\t\t\t\tfor (var index = 0, rand; index < length; index++) {\n\t\t\t\t\t\trand = _.random(0, index);\n\t\t\t\t\t\tif (rand !== index) shuffled[index] = shuffled[rand];\n\t\t\t\t\t\tshuffled[rand] = set[index];\n\t\t\t\t\t}\n\t\t\t\t\treturn shuffled;\n\t\t\t\t};\n\n\t\t\t\t// Sample **n** random values from a collection.\n\t\t\t\t// If **n** is not specified, returns a single random element.\n\t\t\t\t// The internal `guard` argument allows it to work with `map`.\n\t\t\t\t_.sample = function (obj, n, guard) {\n\t\t\t\t\tif (n == null || guard) {\n\t\t\t\t\t\tif (!isArrayLike(obj)) obj = _.values(obj);\n\t\t\t\t\t\treturn obj[_.random(obj.length - 1)];\n\t\t\t\t\t}\n\t\t\t\t\treturn _.shuffle(obj).slice(0, Math.max(0, n));\n\t\t\t\t};\n\n\t\t\t\t// Sort the object's values by a criterion produced by an iteratee.\n\t\t\t\t_.sortBy = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\treturn _.pluck(_.map(obj, function (value, index, list) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\t\tcriteria: iteratee(value, index, list)\n\t\t\t\t\t\t};\n\t\t\t\t\t}).sort(function (left, right) {\n\t\t\t\t\t\tvar a = left.criteria;\n\t\t\t\t\t\tvar b = right.criteria;\n\t\t\t\t\t\tif (a !== b) {\n\t\t\t\t\t\t\tif (a > b || a === void 0) return 1;\n\t\t\t\t\t\t\tif (a < b || b === void 0) return -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn left.index - right.index;\n\t\t\t\t\t}), 'value');\n\t\t\t\t};\n\n\t\t\t\t// An internal function used for aggregate \"group by\" operations.\n\t\t\t\tvar group = function group(behavior) {\n\t\t\t\t\treturn function (obj, iteratee, context) {\n\t\t\t\t\t\tvar result = {};\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index) {\n\t\t\t\t\t\t\tvar key = iteratee(value, index, obj);\n\t\t\t\t\t\t\tbehavior(result, value, key);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Groups the object's values by a criterion. Pass either a string attribute\n\t\t\t\t// to group by, or a function that returns the criterion.\n\t\t\t\t_.groupBy = group(function (result, value, key) {\n\t\t\t\t\tif (_.has(result, key)) result[key].push(value);else result[key] = [value];\n\t\t\t\t});\n\n\t\t\t\t// Indexes the object's values by a criterion, similar to `groupBy`, but for\n\t\t\t\t// when you know that your index values will be unique.\n\t\t\t\t_.indexBy = group(function (result, value, key) {\n\t\t\t\t\tresult[key] = value;\n\t\t\t\t});\n\n\t\t\t\t// Counts instances of an object that group by a certain criterion. Pass\n\t\t\t\t// either a string attribute to count by, or a function that returns the\n\t\t\t\t// criterion.\n\t\t\t\t_.countBy = group(function (result, value, key) {\n\t\t\t\t\tif (_.has(result, key)) result[key]++;else result[key] = 1;\n\t\t\t\t});\n\n\t\t\t\t// Safely create a real, live array from anything iterable.\n\t\t\t\t_.toArray = function (obj) {\n\t\t\t\t\tif (!obj) return [];\n\t\t\t\t\tif (_.isArray(obj)) return slice.call(obj);\n\t\t\t\t\tif (isArrayLike(obj)) return _.map(obj, _.identity);\n\t\t\t\t\treturn _.values(obj);\n\t\t\t\t};\n\n\t\t\t\t// Return the number of elements in an object.\n\t\t\t\t_.size = function (obj) {\n\t\t\t\t\tif (obj == null) return 0;\n\t\t\t\t\treturn isArrayLike(obj) ? obj.length : _.keys(obj).length;\n\t\t\t\t};\n\n\t\t\t\t// Split a collection into two arrays: one whose elements all satisfy the given\n\t\t\t\t// predicate, and one whose elements all do not satisfy the predicate.\n\t\t\t\t_.partition = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar pass = [],\n\t\t\t\t\t fail = [];\n\t\t\t\t\t_.each(obj, function (value, key, obj) {\n\t\t\t\t\t\t(predicate(value, key, obj) ? pass : fail).push(value);\n\t\t\t\t\t});\n\t\t\t\t\treturn [pass, fail];\n\t\t\t\t};\n\n\t\t\t\t// Array Functions\n\t\t\t\t// ---------------\n\n\t\t\t\t// Get the first element of an array. Passing **n** will return the first N\n\t\t\t\t// values in the array. Aliased as `head` and `take`. The **guard** check\n\t\t\t\t// allows it to work with `_.map`.\n\t\t\t\t_.first = _.head = _.take = function (array, n, guard) {\n\t\t\t\t\tif (array == null) return void 0;\n\t\t\t\t\tif (n == null || guard) return array[0];\n\t\t\t\t\treturn _.initial(array, array.length - n);\n\t\t\t\t};\n\n\t\t\t\t// Returns everything but the last entry of the array. Especially useful on\n\t\t\t\t// the arguments object. Passing **n** will return all the values in\n\t\t\t\t// the array, excluding the last N.\n\t\t\t\t_.initial = function (array, n, guard) {\n\t\t\t\t\treturn slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n\t\t\t\t};\n\n\t\t\t\t// Get the last element of an array. Passing **n** will return the last N\n\t\t\t\t// values in the array.\n\t\t\t\t_.last = function (array, n, guard) {\n\t\t\t\t\tif (array == null) return void 0;\n\t\t\t\t\tif (n == null || guard) return array[array.length - 1];\n\t\t\t\t\treturn _.rest(array, Math.max(0, array.length - n));\n\t\t\t\t};\n\n\t\t\t\t// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n\t\t\t\t// Especially useful on the arguments object. Passing an **n** will return\n\t\t\t\t// the rest N values in the array.\n\t\t\t\t_.rest = _.tail = _.drop = function (array, n, guard) {\n\t\t\t\t\treturn slice.call(array, n == null || guard ? 1 : n);\n\t\t\t\t};\n\n\t\t\t\t// Trim out all falsy values from an array.\n\t\t\t\t_.compact = function (array) {\n\t\t\t\t\treturn _.filter(array, _.identity);\n\t\t\t\t};\n\n\t\t\t\t// Internal implementation of a recursive `flatten` function.\n\t\t\t\tvar flatten = function flatten(input, shallow, strict, startIndex) {\n\t\t\t\t\tvar output = [],\n\t\t\t\t\t idx = 0;\n\t\t\t\t\tfor (var i = startIndex || 0, length = getLength(input); i < length; i++) {\n\t\t\t\t\t\tvar value = input[i];\n\t\t\t\t\t\tif (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n\t\t\t\t\t\t\t//flatten current level of array or arguments object\n\t\t\t\t\t\t\tif (!shallow) value = flatten(value, shallow, strict);\n\t\t\t\t\t\t\tvar j = 0,\n\t\t\t\t\t\t\t len = value.length;\n\t\t\t\t\t\t\toutput.length += len;\n\t\t\t\t\t\t\twhile (j < len) {\n\t\t\t\t\t\t\t\toutput[idx++] = value[j++];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!strict) {\n\t\t\t\t\t\t\toutput[idx++] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn output;\n\t\t\t\t};\n\n\t\t\t\t// Flatten out an array, either recursively (by default), or just one level.\n\t\t\t\t_.flatten = function (array, shallow) {\n\t\t\t\t\treturn flatten(array, shallow, false);\n\t\t\t\t};\n\n\t\t\t\t// Return a version of the array that does not contain the specified value(s).\n\t\t\t\t_.without = function (array) {\n\t\t\t\t\treturn _.difference(array, slice.call(arguments, 1));\n\t\t\t\t};\n\n\t\t\t\t// Produce a duplicate-free version of the array. If the array has already\n\t\t\t\t// been sorted, you have the option of using a faster algorithm.\n\t\t\t\t// Aliased as `unique`.\n\t\t\t\t_.uniq = _.unique = function (array, isSorted, iteratee, context) {\n\t\t\t\t\tif (!_.isBoolean(isSorted)) {\n\t\t\t\t\t\tcontext = iteratee;\n\t\t\t\t\t\titeratee = isSorted;\n\t\t\t\t\t\tisSorted = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (iteratee != null) iteratee = cb(iteratee, context);\n\t\t\t\t\tvar result = [];\n\t\t\t\t\tvar seen = [];\n\t\t\t\t\tfor (var i = 0, length = getLength(array); i < length; i++) {\n\t\t\t\t\t\tvar value = array[i],\n\t\t\t\t\t\t computed = iteratee ? iteratee(value, i, array) : value;\n\t\t\t\t\t\tif (isSorted) {\n\t\t\t\t\t\t\tif (!i || seen !== computed) result.push(value);\n\t\t\t\t\t\t\tseen = computed;\n\t\t\t\t\t\t} else if (iteratee) {\n\t\t\t\t\t\t\tif (!_.contains(seen, computed)) {\n\t\t\t\t\t\t\t\tseen.push(computed);\n\t\t\t\t\t\t\t\tresult.push(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!_.contains(result, value)) {\n\t\t\t\t\t\t\tresult.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Produce an array that contains the union: each distinct element from all of\n\t\t\t\t// the passed-in arrays.\n\t\t\t\t_.union = function () {\n\t\t\t\t\treturn _.uniq(flatten(arguments, true, true));\n\t\t\t\t};\n\n\t\t\t\t// Produce an array that contains every item shared between all the\n\t\t\t\t// passed-in arrays.\n\t\t\t\t_.intersection = function (array) {\n\t\t\t\t\tvar result = [];\n\t\t\t\t\tvar argsLength = arguments.length;\n\t\t\t\t\tfor (var i = 0, length = getLength(array); i < length; i++) {\n\t\t\t\t\t\tvar item = array[i];\n\t\t\t\t\t\tif (_.contains(result, item)) continue;\n\t\t\t\t\t\tfor (var j = 1; j < argsLength; j++) {\n\t\t\t\t\t\t\tif (!_.contains(arguments[j], item)) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j === argsLength) result.push(item);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Take the difference between one array and a number of other arrays.\n\t\t\t\t// Only the elements present in just the first array will remain.\n\t\t\t\t_.difference = function (array) {\n\t\t\t\t\tvar rest = flatten(arguments, true, true, 1);\n\t\t\t\t\treturn _.filter(array, function (value) {\n\t\t\t\t\t\treturn !_.contains(rest, value);\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Zip together multiple lists into a single array -- elements that share\n\t\t\t\t// an index go together.\n\t\t\t\t_.zip = function () {\n\t\t\t\t\treturn _.unzip(arguments);\n\t\t\t\t};\n\n\t\t\t\t// Complement of _.zip. Unzip accepts an array of arrays and groups\n\t\t\t\t// each array's elements on shared indices\n\t\t\t\t_.unzip = function (array) {\n\t\t\t\t\tvar length = array && _.max(array, getLength).length || 0;\n\t\t\t\t\tvar result = Array(length);\n\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tresult[index] = _.pluck(array, index);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Converts lists into objects. Pass either a single array of `[key, value]`\n\t\t\t\t// pairs, or two parallel arrays of the same length -- one of keys, and one of\n\t\t\t\t// the corresponding values.\n\t\t\t\t_.object = function (list, values) {\n\t\t\t\t\tvar result = {};\n\t\t\t\t\tfor (var i = 0, length = getLength(list); i < length; i++) {\n\t\t\t\t\t\tif (values) {\n\t\t\t\t\t\t\tresult[list[i]] = values[i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult[list[i][0]] = list[i][1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Generator function to create the findIndex and findLastIndex functions\n\t\t\t\tfunction createPredicateIndexFinder(dir) {\n\t\t\t\t\treturn function (array, predicate, context) {\n\t\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\t\tvar length = getLength(array);\n\t\t\t\t\t\tvar index = dir > 0 ? 0 : length - 1;\n\t\t\t\t\t\tfor (; index >= 0 && index < length; index += dir) {\n\t\t\t\t\t\t\tif (predicate(array[index], index, array)) return index;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Returns the first index on an array-like that passes a predicate test\n\t\t\t\t_.findIndex = createPredicateIndexFinder(1);\n\t\t\t\t_.findLastIndex = createPredicateIndexFinder(-1);\n\n\t\t\t\t// Use a comparator function to figure out the smallest index at which\n\t\t\t\t// an object should be inserted so as to maintain order. Uses binary search.\n\t\t\t\t_.sortedIndex = function (array, obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context, 1);\n\t\t\t\t\tvar value = iteratee(obj);\n\t\t\t\t\tvar low = 0,\n\t\t\t\t\t high = getLength(array);\n\t\t\t\t\twhile (low < high) {\n\t\t\t\t\t\tvar mid = Math.floor((low + high) / 2);\n\t\t\t\t\t\tif (iteratee(array[mid]) < value) low = mid + 1;else high = mid;\n\t\t\t\t\t}\n\t\t\t\t\treturn low;\n\t\t\t\t};\n\n\t\t\t\t// Generator function to create the indexOf and lastIndexOf functions\n\t\t\t\tfunction createIndexFinder(dir, predicateFind, sortedIndex) {\n\t\t\t\t\treturn function (array, item, idx) {\n\t\t\t\t\t\tvar i = 0,\n\t\t\t\t\t\t length = getLength(array);\n\t\t\t\t\t\tif (typeof idx == 'number') {\n\t\t\t\t\t\t\tif (dir > 0) {\n\t\t\t\t\t\t\t\ti = idx >= 0 ? idx : Math.max(idx + length, i);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlength = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sortedIndex && idx && length) {\n\t\t\t\t\t\t\tidx = sortedIndex(array, item);\n\t\t\t\t\t\t\treturn array[idx] === item ? idx : -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item !== item) {\n\t\t\t\t\t\t\tidx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t\t\t\t\t\t\treturn idx >= 0 ? idx + i : -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t\t\t\t\t\t\tif (array[idx] === item) return idx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Return the position of the first occurrence of an item in an array,\n\t\t\t\t// or -1 if the item is not included in the array.\n\t\t\t\t// If the array is large and already in sort order, pass `true`\n\t\t\t\t// for **isSorted** to use binary search.\n\t\t\t\t_.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n\t\t\t\t_.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n\t\t\t\t// Generate an integer Array containing an arithmetic progression. A port of\n\t\t\t\t// the native Python `range()` function. See\n\t\t\t\t// [the Python documentation](http://docs.python.org/library/functions.html#range).\n\t\t\t\t_.range = function (start, stop, step) {\n\t\t\t\t\tif (stop == null) {\n\t\t\t\t\t\tstop = start || 0;\n\t\t\t\t\t\tstart = 0;\n\t\t\t\t\t}\n\t\t\t\t\tstep = step || 1;\n\n\t\t\t\t\tvar length = Math.max(Math.ceil((stop - start) / step), 0);\n\t\t\t\t\tvar range = Array(length);\n\n\t\t\t\t\tfor (var idx = 0; idx < length; idx++, start += step) {\n\t\t\t\t\t\trange[idx] = start;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn range;\n\t\t\t\t};\n\n\t\t\t\t// Function (ahem) Functions\n\t\t\t\t// ------------------\n\n\t\t\t\t// Determines whether to execute a function as a constructor\n\t\t\t\t// or a normal function with the provided arguments\n\t\t\t\tvar executeBound = function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n\t\t\t\t\tif (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n\t\t\t\t\tvar self = baseCreate(sourceFunc.prototype);\n\t\t\t\t\tvar result = sourceFunc.apply(self, args);\n\t\t\t\t\tif (_.isObject(result)) return result;\n\t\t\t\t\treturn self;\n\t\t\t\t};\n\n\t\t\t\t// Create a function bound to a given object (assigning `this`, and arguments,\n\t\t\t\t// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n\t\t\t\t// available.\n\t\t\t\t_.bind = function (func, context) {\n\t\t\t\t\tif (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n\t\t\t\t\tif (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\tvar bound = function bound() {\n\t\t\t\t\t\treturn executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\n\t\t\t\t\t};\n\t\t\t\t\treturn bound;\n\t\t\t\t};\n\n\t\t\t\t// Partially apply a function by creating a version that has had some of its\n\t\t\t\t// arguments pre-filled, without changing its dynamic `this` context. _ acts\n\t\t\t\t// as a placeholder, allowing any combination of arguments to be pre-filled.\n\t\t\t\t_.partial = function (func) {\n\t\t\t\t\tvar boundArgs = slice.call(arguments, 1);\n\t\t\t\t\tvar bound = function bound() {\n\t\t\t\t\t\tvar position = 0,\n\t\t\t\t\t\t length = boundArgs.length;\n\t\t\t\t\t\tvar args = Array(length);\n\t\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\t\targs[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (position < arguments.length) {\n\t\t\t\t\t\t\targs.push(arguments[position++]);\n\t\t\t\t\t\t}return executeBound(func, bound, this, this, args);\n\t\t\t\t\t};\n\t\t\t\t\treturn bound;\n\t\t\t\t};\n\n\t\t\t\t// Bind a number of an object's methods to that object. Remaining arguments\n\t\t\t\t// are the method names to be bound. Useful for ensuring that all callbacks\n\t\t\t\t// defined on an object belong to it.\n\t\t\t\t_.bindAll = function (obj) {\n\t\t\t\t\tvar i,\n\t\t\t\t\t length = arguments.length,\n\t\t\t\t\t key;\n\t\t\t\t\tif (length <= 1) throw new Error('bindAll must be passed function names');\n\t\t\t\t\tfor (i = 1; i < length; i++) {\n\t\t\t\t\t\tkey = arguments[i];\n\t\t\t\t\t\tobj[key] = _.bind(obj[key], obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Memoize an expensive function by storing its results.\n\t\t\t\t_.memoize = function (func, hasher) {\n\t\t\t\t\tvar memoize = function memoize(key) {\n\t\t\t\t\t\tvar cache = memoize.cache;\n\t\t\t\t\t\tvar address = '' + (hasher ? hasher.apply(this, arguments) : key);\n\t\t\t\t\t\tif (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n\t\t\t\t\t\treturn cache[address];\n\t\t\t\t\t};\n\t\t\t\t\tmemoize.cache = {};\n\t\t\t\t\treturn memoize;\n\t\t\t\t};\n\n\t\t\t\t// Delays a function for the given number of milliseconds, and then calls\n\t\t\t\t// it with the arguments supplied.\n\t\t\t\t_.delay = function (func, wait) {\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\treturn setTimeout(function () {\n\t\t\t\t\t\treturn func.apply(null, args);\n\t\t\t\t\t}, wait);\n\t\t\t\t};\n\n\t\t\t\t// Defers a function, scheduling it to run after the current call stack has\n\t\t\t\t// cleared.\n\t\t\t\t_.defer = _.partial(_.delay, _, 1);\n\n\t\t\t\t// Returns a function, that, when invoked, will only be triggered at most once\n\t\t\t\t// during a given window of time. Normally, the throttled function will run\n\t\t\t\t// as much as it can, without ever going more than once per `wait` duration;\n\t\t\t\t// but if you'd like to disable the execution on the leading edge, pass\n\t\t\t\t// `{leading: false}`. To disable execution on the trailing edge, ditto.\n\t\t\t\t_.throttle = function (func, wait, options) {\n\t\t\t\t\tvar context, args, result;\n\t\t\t\t\tvar timeout = null;\n\t\t\t\t\tvar previous = 0;\n\t\t\t\t\tif (!options) options = {};\n\t\t\t\t\tvar later = function later() {\n\t\t\t\t\t\tprevious = options.leading === false ? 0 : _.now();\n\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t};\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tvar now = _.now();\n\t\t\t\t\t\tif (!previous && options.leading === false) previous = now;\n\t\t\t\t\t\tvar remaining = wait - (now - previous);\n\t\t\t\t\t\tcontext = this;\n\t\t\t\t\t\targs = arguments;\n\t\t\t\t\t\tif (remaining <= 0 || remaining > wait) {\n\t\t\t\t\t\t\tif (timeout) {\n\t\t\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprevious = now;\n\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t\t} else if (!timeout && options.trailing !== false) {\n\t\t\t\t\t\t\ttimeout = setTimeout(later, remaining);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function, that, as long as it continues to be invoked, will not\n\t\t\t\t// be triggered. The function will be called after it stops being called for\n\t\t\t\t// N milliseconds. If `immediate` is passed, trigger the function on the\n\t\t\t\t// leading edge, instead of the trailing.\n\t\t\t\t_.debounce = function (func, wait, immediate) {\n\t\t\t\t\tvar timeout, args, context, timestamp, result;\n\n\t\t\t\t\tvar later = function later() {\n\t\t\t\t\t\tvar last = _.now() - timestamp;\n\n\t\t\t\t\t\tif (last < wait && last >= 0) {\n\t\t\t\t\t\t\ttimeout = setTimeout(later, wait - last);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\t\tif (!immediate) {\n\t\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tcontext = this;\n\t\t\t\t\t\targs = arguments;\n\t\t\t\t\t\ttimestamp = _.now();\n\t\t\t\t\t\tvar callNow = immediate && !timeout;\n\t\t\t\t\t\tif (!timeout) timeout = setTimeout(later, wait);\n\t\t\t\t\t\tif (callNow) {\n\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\tcontext = args = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns the first function passed as an argument to the second,\n\t\t\t\t// allowing you to adjust arguments, run code before and after, and\n\t\t\t\t// conditionally execute the original function.\n\t\t\t\t_.wrap = function (func, wrapper) {\n\t\t\t\t\treturn _.partial(wrapper, func);\n\t\t\t\t};\n\n\t\t\t\t// Returns a negated version of the passed-in predicate.\n\t\t\t\t_.negate = function (predicate) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn !predicate.apply(this, arguments);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that is the composition of a list of functions, each\n\t\t\t\t// consuming the return value of the function that follows.\n\t\t\t\t_.compose = function () {\n\t\t\t\t\tvar args = arguments;\n\t\t\t\t\tvar start = args.length - 1;\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tvar i = start;\n\t\t\t\t\t\tvar result = args[start].apply(this, arguments);\n\t\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\t\tresult = args[i].call(this, result);\n\t\t\t\t\t\t}return result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will only be executed on and after the Nth call.\n\t\t\t\t_.after = function (times, func) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tif (--times < 1) {\n\t\t\t\t\t\t\treturn func.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will only be executed up to (but not including) the Nth call.\n\t\t\t\t_.before = function (times, func) {\n\t\t\t\t\tvar memo;\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tif (--times > 0) {\n\t\t\t\t\t\t\tmemo = func.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (times <= 1) func = null;\n\t\t\t\t\t\treturn memo;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will be executed at most one time, no matter how\n\t\t\t\t// often you call it. Useful for lazy initialization.\n\t\t\t\t_.once = _.partial(_.before, 2);\n\n\t\t\t\t// Object Functions\n\t\t\t\t// ----------------\n\n\t\t\t\t// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n\t\t\t\tvar hasEnumBug = !{ toString: null }.propertyIsEnumerable('toString');\n\t\t\t\tvar nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n\t\t\t\tfunction collectNonEnumProps(obj, keys) {\n\t\t\t\t\tvar nonEnumIdx = nonEnumerableProps.length;\n\t\t\t\t\tvar constructor = obj.constructor;\n\t\t\t\t\tvar proto = _.isFunction(constructor) && constructor.prototype || ObjProto;\n\n\t\t\t\t\t// Constructor is a special case.\n\t\t\t\t\tvar prop = 'constructor';\n\t\t\t\t\tif (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n\t\t\t\t\twhile (nonEnumIdx--) {\n\t\t\t\t\t\tprop = nonEnumerableProps[nonEnumIdx];\n\t\t\t\t\t\tif (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n\t\t\t\t\t\t\tkeys.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Retrieve the names of an object's own properties.\n\t\t\t\t// Delegates to **ECMAScript 5**'s native `Object.keys`\n\t\t\t\t_.keys = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return [];\n\t\t\t\t\tif (nativeKeys) return nativeKeys(obj);\n\t\t\t\t\tvar keys = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tif (_.has(obj, key)) keys.push(key);\n\t\t\t\t\t} // Ahem, IE < 9.\n\t\t\t\t\tif (hasEnumBug) collectNonEnumProps(obj, keys);\n\t\t\t\t\treturn keys;\n\t\t\t\t};\n\n\t\t\t\t// Retrieve all the property names of an object.\n\t\t\t\t_.allKeys = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return [];\n\t\t\t\t\tvar keys = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tkeys.push(key);\n\t\t\t\t\t} // Ahem, IE < 9.\n\t\t\t\t\tif (hasEnumBug) collectNonEnumProps(obj, keys);\n\t\t\t\t\treturn keys;\n\t\t\t\t};\n\n\t\t\t\t// Retrieve the values of an object's properties.\n\t\t\t\t_.values = function (obj) {\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tvar length = keys.length;\n\t\t\t\t\tvar values = Array(length);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tvalues[i] = obj[keys[i]];\n\t\t\t\t\t}\n\t\t\t\t\treturn values;\n\t\t\t\t};\n\n\t\t\t\t// Returns the results of applying the iteratee to each element of the object\n\t\t\t\t// In contrast to _.map it returns an object\n\t\t\t\t_.mapObject = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\tvar keys = _.keys(obj),\n\t\t\t\t\t length = keys.length,\n\t\t\t\t\t results = {},\n\t\t\t\t\t currentKey;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tcurrentKey = keys[index];\n\t\t\t\t\t\tresults[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Convert an object into a list of `[key, value]` pairs.\n\t\t\t\t_.pairs = function (obj) {\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tvar length = keys.length;\n\t\t\t\t\tvar pairs = Array(length);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tpairs[i] = [keys[i], obj[keys[i]]];\n\t\t\t\t\t}\n\t\t\t\t\treturn pairs;\n\t\t\t\t};\n\n\t\t\t\t// Invert the keys and values of an object. The values must be serializable.\n\t\t\t\t_.invert = function (obj) {\n\t\t\t\t\tvar result = {};\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tresult[obj[keys[i]]] = keys[i];\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return a sorted list of the function names available on the object.\n\t\t\t\t// Aliased as `methods`\n\t\t\t\t_.functions = _.methods = function (obj) {\n\t\t\t\t\tvar names = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tif (_.isFunction(obj[key])) names.push(key);\n\t\t\t\t\t}\n\t\t\t\t\treturn names.sort();\n\t\t\t\t};\n\n\t\t\t\t// Extend a given object with all the properties in passed-in object(s).\n\t\t\t\t_.extend = createAssigner(_.allKeys);\n\n\t\t\t\t// Assigns a given object with all the own properties in the passed-in object(s)\n\t\t\t\t// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\t\t\t\t_.extendOwn = _.assign = createAssigner(_.keys);\n\n\t\t\t\t// Returns the first key on an object that passes a predicate test\n\t\t\t\t_.findKey = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = _.keys(obj),\n\t\t\t\t\t key;\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tkey = keys[i];\n\t\t\t\t\t\tif (predicate(obj[key], key, obj)) return key;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// Return a copy of the object only containing the whitelisted properties.\n\t\t\t\t_.pick = function (object, oiteratee, context) {\n\t\t\t\t\tvar result = {},\n\t\t\t\t\t obj = object,\n\t\t\t\t\t iteratee,\n\t\t\t\t\t keys;\n\t\t\t\t\tif (obj == null) return result;\n\t\t\t\t\tif (_.isFunction(oiteratee)) {\n\t\t\t\t\t\tkeys = _.allKeys(obj);\n\t\t\t\t\t\titeratee = optimizeCb(oiteratee, context);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkeys = flatten(arguments, false, false, 1);\n\t\t\t\t\t\titeratee = function iteratee(value, key, obj) {\n\t\t\t\t\t\t\treturn key in obj;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tobj = Object(obj);\n\t\t\t\t\t}\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\tvar value = obj[key];\n\t\t\t\t\t\tif (iteratee(value, key, obj)) result[key] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return a copy of the object without the blacklisted properties.\n\t\t\t\t_.omit = function (obj, iteratee, context) {\n\t\t\t\t\tif (_.isFunction(iteratee)) {\n\t\t\t\t\t\titeratee = _.negate(iteratee);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar keys = _.map(flatten(arguments, false, false, 1), String);\n\t\t\t\t\t\titeratee = function iteratee(value, key) {\n\t\t\t\t\t\t\treturn !_.contains(keys, key);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn _.pick(obj, iteratee, context);\n\t\t\t\t};\n\n\t\t\t\t// Fill in a given object with default properties.\n\t\t\t\t_.defaults = createAssigner(_.allKeys, true);\n\n\t\t\t\t// Creates an object that inherits from the given prototype object.\n\t\t\t\t// If additional properties are provided then they will be added to the\n\t\t\t\t// created object.\n\t\t\t\t_.create = function (prototype, props) {\n\t\t\t\t\tvar result = baseCreate(prototype);\n\t\t\t\t\tif (props) _.extendOwn(result, props);\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Create a (shallow-cloned) duplicate of an object.\n\t\t\t\t_.clone = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return obj;\n\t\t\t\t\treturn _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n\t\t\t\t};\n\n\t\t\t\t// Invokes interceptor with the obj, and then returns obj.\n\t\t\t\t// The primary purpose of this method is to \"tap into\" a method chain, in\n\t\t\t\t// order to perform operations on intermediate results within the chain.\n\t\t\t\t_.tap = function (obj, interceptor) {\n\t\t\t\t\tinterceptor(obj);\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Returns whether an object has a given set of `key:value` pairs.\n\t\t\t\t_.isMatch = function (object, attrs) {\n\t\t\t\t\tvar keys = _.keys(attrs),\n\t\t\t\t\t length = keys.length;\n\t\t\t\t\tif (object == null) return !length;\n\t\t\t\t\tvar obj = Object(object);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\tif (attrs[key] !== obj[key] || !(key in obj)) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Internal recursive comparison function for `isEqual`.\n\t\t\t\tvar eq = function eq(a, b, aStack, bStack) {\n\t\t\t\t\t// Identical objects are equal. `0 === -0`, but they aren't identical.\n\t\t\t\t\t// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n\t\t\t\t\tif (a === b) return a !== 0 || 1 / a === 1 / b;\n\t\t\t\t\t// A strict comparison is necessary because `null == undefined`.\n\t\t\t\t\tif (a == null || b == null) return a === b;\n\t\t\t\t\t// Unwrap any wrapped objects.\n\t\t\t\t\tif (a instanceof _) a = a._wrapped;\n\t\t\t\t\tif (b instanceof _) b = b._wrapped;\n\t\t\t\t\t// Compare `[[Class]]` names.\n\t\t\t\t\tvar className = toString.call(a);\n\t\t\t\t\tif (className !== toString.call(b)) return false;\n\t\t\t\t\tswitch (className) {\n\t\t\t\t\t\t// Strings, numbers, regular expressions, dates, and booleans are compared by value.\n\t\t\t\t\t\tcase '[object RegExp]':\n\t\t\t\t\t\t// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\t\t\t\t\t\tcase '[object String]':\n\t\t\t\t\t\t\t// Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n\t\t\t\t\t\t\t// equivalent to `new String(\"5\")`.\n\t\t\t\t\t\t\treturn '' + a === '' + b;\n\t\t\t\t\t\tcase '[object Number]':\n\t\t\t\t\t\t\t// `NaN`s are equivalent, but non-reflexive.\n\t\t\t\t\t\t\t// Object(NaN) is equivalent to NaN\n\t\t\t\t\t\t\tif (+a !== +a) return +b !== +b;\n\t\t\t\t\t\t\t// An `egal` comparison is performed for other numeric values.\n\t\t\t\t\t\t\treturn +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\t\t\t\t\t\tcase '[object Date]':\n\t\t\t\t\t\tcase '[object Boolean]':\n\t\t\t\t\t\t\t// Coerce dates and booleans to numeric primitive values. Dates are compared by their\n\t\t\t\t\t\t\t// millisecond representations. Note that invalid dates with millisecond representations\n\t\t\t\t\t\t\t// of `NaN` are not equivalent.\n\t\t\t\t\t\t\treturn +a === +b;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar areArrays = className === '[object Array]';\n\t\t\t\t\tif (!areArrays) {\n\t\t\t\t\t\tif ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) != 'object' || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) != 'object') return false;\n\n\t\t\t\t\t\t// Objects with different constructors are not equivalent, but `Object`s or `Array`s\n\t\t\t\t\t\t// from different frames are.\n\t\t\t\t\t\tvar aCtor = a.constructor,\n\t\t\t\t\t\t bCtor = b.constructor;\n\t\t\t\t\t\tif (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && 'constructor' in a && 'constructor' in b) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Assume equality for cyclic structures. The algorithm for detecting cyclic\n\t\t\t\t\t// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n\t\t\t\t\t// Initializing stack of traversed objects.\n\t\t\t\t\t// It's done here since we only need them for objects and arrays comparison.\n\t\t\t\t\taStack = aStack || [];\n\t\t\t\t\tbStack = bStack || [];\n\t\t\t\t\tvar length = aStack.length;\n\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t// Linear search. Performance is inversely proportional to the number of\n\t\t\t\t\t\t// unique nested structures.\n\t\t\t\t\t\tif (aStack[length] === a) return bStack[length] === b;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the first object to the stack of traversed objects.\n\t\t\t\t\taStack.push(a);\n\t\t\t\t\tbStack.push(b);\n\n\t\t\t\t\t// Recursively compare objects and arrays.\n\t\t\t\t\tif (areArrays) {\n\t\t\t\t\t\t// Compare array lengths to determine if a deep comparison is necessary.\n\t\t\t\t\t\tlength = a.length;\n\t\t\t\t\t\tif (length !== b.length) return false;\n\t\t\t\t\t\t// Deep compare the contents, ignoring non-numeric properties.\n\t\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t\tif (!eq(a[length], b[length], aStack, bStack)) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Deep compare objects.\n\t\t\t\t\t\tvar keys = _.keys(a),\n\t\t\t\t\t\t key;\n\t\t\t\t\t\tlength = keys.length;\n\t\t\t\t\t\t// Ensure that both objects contain the same number of properties before comparing deep equality.\n\t\t\t\t\t\tif (_.keys(b).length !== length) return false;\n\t\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t\t// Deep compare each member\n\t\t\t\t\t\t\tkey = keys[length];\n\t\t\t\t\t\t\tif (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Remove the first object from the stack of traversed objects.\n\t\t\t\t\taStack.pop();\n\t\t\t\t\tbStack.pop();\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Perform a deep comparison to check if two objects are equal.\n\t\t\t\t_.isEqual = function (a, b) {\n\t\t\t\t\treturn eq(a, b);\n\t\t\t\t};\n\n\t\t\t\t// Is a given array, string, or object empty?\n\t\t\t\t// An \"empty\" object has no enumerable own-properties.\n\t\t\t\t_.isEmpty = function (obj) {\n\t\t\t\t\tif (obj == null) return true;\n\t\t\t\t\tif (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n\t\t\t\t\treturn _.keys(obj).length === 0;\n\t\t\t\t};\n\n\t\t\t\t// Is a given value a DOM element?\n\t\t\t\t_.isElement = function (obj) {\n\t\t\t\t\treturn !!(obj && obj.nodeType === 1);\n\t\t\t\t};\n\n\t\t\t\t// Is a given value an array?\n\t\t\t\t// Delegates to ECMA5's native Array.isArray\n\t\t\t\t_.isArray = nativeIsArray || function (obj) {\n\t\t\t\t\treturn toString.call(obj) === '[object Array]';\n\t\t\t\t};\n\n\t\t\t\t// Is a given variable an object?\n\t\t\t\t_.isObject = function (obj) {\n\t\t\t\t\tvar type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n\t\t\t\t\treturn type === 'function' || type === 'object' && !!obj;\n\t\t\t\t};\n\n\t\t\t\t// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n\t\t\t\t_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function (name) {\n\t\t\t\t\t_['is' + name] = function (obj) {\n\t\t\t\t\t\treturn toString.call(obj) === '[object ' + name + ']';\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Define a fallback version of the method in browsers (ahem, IE < 9), where\n\t\t\t\t// there isn't any inspectable \"Arguments\" type.\n\t\t\t\tif (!_.isArguments(arguments)) {\n\t\t\t\t\t_.isArguments = function (obj) {\n\t\t\t\t\t\treturn _.has(obj, 'callee');\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n\t\t\t\t// IE 11 (#1621), and in Safari 8 (#1929).\n\t\t\t\tif (typeof /./ != 'function' && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) != 'object') {\n\t\t\t\t\t_.isFunction = function (obj) {\n\t\t\t\t\t\treturn typeof obj == 'function' || false;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Is a given object a finite number?\n\t\t\t\t_.isFinite = function (obj) {\n\t\t\t\t\treturn isFinite(obj) && !isNaN(parseFloat(obj));\n\t\t\t\t};\n\n\t\t\t\t// Is the given value `NaN`? (NaN is the only number which does not equal itself).\n\t\t\t\t_.isNaN = function (obj) {\n\t\t\t\t\treturn _.isNumber(obj) && obj !== +obj;\n\t\t\t\t};\n\n\t\t\t\t// Is a given value a boolean?\n\t\t\t\t_.isBoolean = function (obj) {\n\t\t\t\t\treturn obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n\t\t\t\t};\n\n\t\t\t\t// Is a given value equal to null?\n\t\t\t\t_.isNull = function (obj) {\n\t\t\t\t\treturn obj === null;\n\t\t\t\t};\n\n\t\t\t\t// Is a given variable undefined?\n\t\t\t\t_.isUndefined = function (obj) {\n\t\t\t\t\treturn obj === void 0;\n\t\t\t\t};\n\n\t\t\t\t// Shortcut function for checking if an object has a given property directly\n\t\t\t\t// on itself (in other words, not on a prototype).\n\t\t\t\t_.has = function (obj, key) {\n\t\t\t\t\treturn obj != null && hasOwnProperty.call(obj, key);\n\t\t\t\t};\n\n\t\t\t\t// Utility Functions\n\t\t\t\t// -----------------\n\n\t\t\t\t// Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n\t\t\t\t// previous owner. Returns a reference to the Underscore object.\n\t\t\t\t_.noConflict = function () {\n\t\t\t\t\troot._ = previousUnderscore;\n\t\t\t\t\treturn this;\n\t\t\t\t};\n\n\t\t\t\t// Keep the identity function around for default iteratees.\n\t\t\t\t_.identity = function (value) {\n\t\t\t\t\treturn value;\n\t\t\t\t};\n\n\t\t\t\t// Predicate-generating functions. Often useful outside of Underscore.\n\t\t\t\t_.constant = function (value) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t_.noop = function () {};\n\n\t\t\t\t_.property = property;\n\n\t\t\t\t// Generates a function for a given object that returns a given property.\n\t\t\t\t_.propertyOf = function (obj) {\n\t\t\t\t\treturn obj == null ? function () {} : function (key) {\n\t\t\t\t\t\treturn obj[key];\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a predicate for checking whether an object has a given set of\n\t\t\t\t// `key:value` pairs.\n\t\t\t\t_.matcher = _.matches = function (attrs) {\n\t\t\t\t\tattrs = _.extendOwn({}, attrs);\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\treturn _.isMatch(obj, attrs);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Run a function **n** times.\n\t\t\t\t_.times = function (n, iteratee, context) {\n\t\t\t\t\tvar accum = Array(Math.max(0, n));\n\t\t\t\t\titeratee = optimizeCb(iteratee, context, 1);\n\t\t\t\t\tfor (var i = 0; i < n; i++) {\n\t\t\t\t\t\taccum[i] = iteratee(i);\n\t\t\t\t\t}return accum;\n\t\t\t\t};\n\n\t\t\t\t// Return a random integer between min and max (inclusive).\n\t\t\t\t_.random = function (min, max) {\n\t\t\t\t\tif (max == null) {\n\t\t\t\t\t\tmax = min;\n\t\t\t\t\t\tmin = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn min + Math.floor(Math.random() * (max - min + 1));\n\t\t\t\t};\n\n\t\t\t\t// A (possibly faster) way to get the current timestamp as an integer.\n\t\t\t\t_.now = Date.now || function () {\n\t\t\t\t\treturn new Date().getTime();\n\t\t\t\t};\n\n\t\t\t\t// List of HTML entities for escaping.\n\t\t\t\tvar escapeMap = {\n\t\t\t\t\t'&': '&',\n\t\t\t\t\t'<': '<',\n\t\t\t\t\t'>': '>',\n\t\t\t\t\t'\"': '"',\n\t\t\t\t\t\"'\": ''',\n\t\t\t\t\t'`': '`'\n\t\t\t\t};\n\t\t\t\tvar unescapeMap = _.invert(escapeMap);\n\n\t\t\t\t// Functions for escaping and unescaping strings to/from HTML interpolation.\n\t\t\t\tvar createEscaper = function createEscaper(map) {\n\t\t\t\t\tvar escaper = function escaper(match) {\n\t\t\t\t\t\treturn map[match];\n\t\t\t\t\t};\n\t\t\t\t\t// Regexes for identifying a key that needs to be escaped\n\t\t\t\t\tvar source = '(?:' + _.keys(map).join('|') + ')';\n\t\t\t\t\tvar testRegexp = RegExp(source);\n\t\t\t\t\tvar replaceRegexp = RegExp(source, 'g');\n\t\t\t\t\treturn function (string) {\n\t\t\t\t\t\tstring = string == null ? '' : '' + string;\n\t\t\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t_.escape = createEscaper(escapeMap);\n\t\t\t\t_.unescape = createEscaper(unescapeMap);\n\n\t\t\t\t// If the value of the named `property` is a function then invoke it with the\n\t\t\t\t// `object` as context; otherwise, return it.\n\t\t\t\t_.result = function (object, property, fallback) {\n\t\t\t\t\tvar value = object == null ? void 0 : object[property];\n\t\t\t\t\tif (value === void 0) {\n\t\t\t\t\t\tvalue = fallback;\n\t\t\t\t\t}\n\t\t\t\t\treturn _.isFunction(value) ? value.call(object) : value;\n\t\t\t\t};\n\n\t\t\t\t// Generate a unique integer id (unique within the entire client session).\n\t\t\t\t// Useful for temporary DOM ids.\n\t\t\t\tvar idCounter = 0;\n\t\t\t\t_.uniqueId = function (prefix) {\n\t\t\t\t\tvar id = ++idCounter + '';\n\t\t\t\t\treturn prefix ? prefix + id : id;\n\t\t\t\t};\n\n\t\t\t\t// By default, Underscore uses ERB-style template delimiters, change the\n\t\t\t\t// following template settings to use alternative delimiters.\n\t\t\t\t_.templateSettings = {\n\t\t\t\t\tevaluate: /<%([\\s\\S]+?)%>/g,\n\t\t\t\t\tinterpolate: /<%=([\\s\\S]+?)%>/g,\n\t\t\t\t\tescape: /<%-([\\s\\S]+?)%>/g\n\t\t\t\t};\n\n\t\t\t\t// When customizing `templateSettings`, if you don't want to define an\n\t\t\t\t// interpolation, evaluation or escaping regex, we need one that is\n\t\t\t\t// guaranteed not to match.\n\t\t\t\tvar noMatch = /(.)^/;\n\n\t\t\t\t// Certain characters need to be escaped so that they can be put into a\n\t\t\t\t// string literal.\n\t\t\t\tvar escapes = {\n\t\t\t\t\t\"'\": \"'\",\n\t\t\t\t\t'\\\\': '\\\\',\n\t\t\t\t\t'\\r': 'r',\n\t\t\t\t\t'\\n': 'n',\n\t\t\t\t\t'\\u2028': 'u2028',\n\t\t\t\t\t'\\u2029': 'u2029'\n\t\t\t\t};\n\n\t\t\t\tvar escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n\t\t\t\tvar escapeChar = function escapeChar(match) {\n\t\t\t\t\treturn '\\\\' + escapes[match];\n\t\t\t\t};\n\n\t\t\t\t// JavaScript micro-templating, similar to John Resig's implementation.\n\t\t\t\t// Underscore templating handles arbitrary delimiters, preserves whitespace,\n\t\t\t\t// and correctly escapes quotes within interpolated code.\n\t\t\t\t// NB: `oldSettings` only exists for backwards compatibility.\n\t\t\t\t_.template = function (text, settings, oldSettings) {\n\t\t\t\t\tif (!settings && oldSettings) settings = oldSettings;\n\t\t\t\t\tsettings = _.defaults({}, settings, _.templateSettings);\n\n\t\t\t\t\t// Combine delimiters into one regular expression via alternation.\n\t\t\t\t\tvar matcher = RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g');\n\n\t\t\t\t\t// Compile the template source, escaping string literals appropriately.\n\t\t\t\t\tvar index = 0;\n\t\t\t\t\tvar source = \"__p+='\";\n\t\t\t\t\ttext.replace(matcher, function (match, escape, interpolate, evaluate, offset) {\n\t\t\t\t\t\tsource += text.slice(index, offset).replace(escaper, escapeChar);\n\t\t\t\t\t\tindex = offset + match.length;\n\n\t\t\t\t\t\tif (escape) {\n\t\t\t\t\t\t\tsource += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n\t\t\t\t\t\t} else if (interpolate) {\n\t\t\t\t\t\t\tsource += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n\t\t\t\t\t\t} else if (evaluate) {\n\t\t\t\t\t\t\tsource += \"';\\n\" + evaluate + \"\\n__p+='\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Adobe VMs need the match returned to produce the correct offest.\n\t\t\t\t\t\treturn match;\n\t\t\t\t\t});\n\t\t\t\t\tsource += \"';\\n\";\n\n\t\t\t\t\t// If a variable is not specified, place data values in local scope.\n\t\t\t\t\tif (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n\t\t\t\t\tsource = \"var __t,__p='',__j=Array.prototype.join,\" + \"print=function(){__p+=__j.call(arguments,'');};\\n\" + source + 'return __p;\\n';\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar render = new Function(settings.variable || 'obj', '_', source);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\te.source = source;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar template = function template(data) {\n\t\t\t\t\t\treturn render.call(this, data, _);\n\t\t\t\t\t};\n\n\t\t\t\t\t// Provide the compiled source as a convenience for precompilation.\n\t\t\t\t\tvar argument = settings.variable || 'obj';\n\t\t\t\t\ttemplate.source = 'function(' + argument + '){\\n' + source + '}';\n\n\t\t\t\t\treturn template;\n\t\t\t\t};\n\n\t\t\t\t// Add a \"chain\" function. Start chaining a wrapped Underscore object.\n\t\t\t\t_.chain = function (obj) {\n\t\t\t\t\tvar instance = _(obj);\n\t\t\t\t\tinstance._chain = true;\n\t\t\t\t\treturn instance;\n\t\t\t\t};\n\n\t\t\t\t// OOP\n\t\t\t\t// ---------------\n\t\t\t\t// If Underscore is called as a function, it returns a wrapped object that\n\t\t\t\t// can be used OO-style. This wrapper holds altered versions of all the\n\t\t\t\t// underscore functions. Wrapped objects may be chained.\n\n\t\t\t\t// Helper function to continue chaining intermediate results.\n\t\t\t\tvar result = function result(instance, obj) {\n\t\t\t\t\treturn instance._chain ? _(obj).chain() : obj;\n\t\t\t\t};\n\n\t\t\t\t// Add your own custom functions to the Underscore object.\n\t\t\t\t_.mixin = function (obj) {\n\t\t\t\t\t_.each(_.functions(obj), function (name) {\n\t\t\t\t\t\tvar func = _[name] = obj[name];\n\t\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\t\tvar args = [this._wrapped];\n\t\t\t\t\t\t\tpush.apply(args, arguments);\n\t\t\t\t\t\t\treturn result(this, func.apply(_, args));\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Add all of the Underscore functions to the wrapper object.\n\t\t\t\t_.mixin(_);\n\n\t\t\t\t// Add all mutator Array functions to the wrapper.\n\t\t\t\t_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function (name) {\n\t\t\t\t\tvar method = ArrayProto[name];\n\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\tvar obj = this._wrapped;\n\t\t\t\t\t\tmethod.apply(obj, arguments);\n\t\t\t\t\t\tif ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n\t\t\t\t\t\treturn result(this, obj);\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Add all accessor Array functions to the wrapper.\n\t\t\t\t_.each(['concat', 'join', 'slice'], function (name) {\n\t\t\t\t\tvar method = ArrayProto[name];\n\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\treturn result(this, method.apply(this._wrapped, arguments));\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Extracts the result from a wrapped and chained object.\n\t\t\t\t_.prototype.value = function () {\n\t\t\t\t\treturn this._wrapped;\n\t\t\t\t};\n\n\t\t\t\t// Provide unwrapping proxy for some methods used in engine operations\n\t\t\t\t// such as arithmetic and JSON stringification.\n\t\t\t\t_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n\t\t\t\t_.prototype.toString = function () {\n\t\t\t\t\treturn '' + this._wrapped;\n\t\t\t\t};\n\n\t\t\t\t// AMD registration happens at the end for compatibility with AMD loaders\n\t\t\t\t// that may not enforce next-turn semantics on modules. Even though general\n\t\t\t\t// practice for AMD registration is to be anonymous, underscore registers\n\t\t\t\t// as a named module because, like jQuery, it is a base library that is\n\t\t\t\t// popular enough to be bundled in a third party lib, but not be part of\n\t\t\t\t// an AMD load request. Those cases could generate an error when an\n\t\t\t\t// anonymous define() is called outside of a loader request.\n\t\t\t\tif (true) {\n\t\t\t\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\t\t\t\treturn _;\n\t\t\t\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t\t\t}\n\t\t\t}).call(this);\n\n\t\t\t/***/\n\t\t}])\n\t);\n});\n;"]} \ No newline at end of file diff --git a/sdk/dist/websdk-1.4.11.js b/sdk/dist/websdk-1.4.12.js similarity index 90% rename from sdk/dist/websdk-1.4.11.js rename to sdk/dist/websdk-1.4.12.js index 83b0cef4..ccf21e66 100644 --- a/sdk/dist/websdk-1.4.11.js +++ b/sdk/dist/websdk-1.4.12.js @@ -1,14 +1,4 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["WebIM"] = factory(); - else - root["WebIM"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap +/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -44,6459 +34,5132 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; +/******/ __webpack_require__.p = "./"; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/******/ ({ - module.exports = __webpack_require__(1) +/***/ 0: +/***/ function(module, exports, __webpack_require__) { + module.exports = __webpack_require__(247); -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - var _version = '1.4.2'; - var _code = __webpack_require__(2).code; - var _utils = __webpack_require__(3).utils; - var _msg = __webpack_require__(4); - var _message = _msg._msg; - var _msgHash = {}; - var Queue = __webpack_require__(39).Queue; - var CryptoJS = __webpack_require__(5); - var _ = __webpack_require__(40); - var stropheConn = null; +/***/ }, - window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - - if (window.XDomainRequest) { - // not support ie8 send is not a function , canot - // case send is object, doesn't has a attr of call - // XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send; - // XDomainRequest.prototype.send = function () { - // XDomainRequest.prototype.oldsend.call(this, arguments); - // this.readyState = 2; - // }; - } +/***/ 183: +/***/ function(module, exports, __webpack_require__) { - Strophe.Request.prototype._newXHR = function () { - var xhr = _utils.xmlrequest(true); - if (xhr.overrideMimeType) { - xhr.overrideMimeType('text/xml'); - } - // use Function.bind() to prepend ourselves as an argument - xhr.onreadystatechange = this.func.bind(null, this); - return xhr; - }; + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3 + // http://underscorejs.org + // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + // Underscore may be freely distributed under the MIT license. - Strophe.Websocket.prototype._closeSocket = function () { - if (this.socket) { - var me = this; - setTimeout(function () { - try { - me.socket.close(); - } catch (e) { - } - }, 0); - } else { - this.socket = null; - } - }; + (function() { + // Baseline setup + // -------------- - /** - * - * Strophe.Websocket has a bug while logout: - * 1.send: is ok; - * 2.send: will cause a problem,log as follows: - * WebSocket connection to 'ws://im-api.easemob.com/ws/' failed: Data frame received after close_connect @ strophe.js:5292connect @ strophe.js:2491_login @ websdk-1.1.2.js:278suc @ websdk-1.1.2.js:636xhr.onreadystatechange @ websdk-1.1.2.js:2582 - * 3 "Websocket error [object Event]" - * _changeConnectStatus - * onError Object {type: 7, msg: "The WebSocket connection could not be established or was disconnected.", reconnect: true} - * - * this will trigger socket.onError, therefore _doDisconnect again. - * Fix it by overide _onMessage - */ - Strophe.Websocket.prototype._onMessage = function (message) { - logMessage(message) - var elem, data; - // check for closing stream - // var close = ''; - // if (message.data === close) { - // this._conn.rawInput(close); - // this._conn.xmlInput(message); - // if (!this._conn.disconnecting) { - // this._conn._doDisconnect(); - // } - // return; - // - // send and receive close xml: - // so we can't judge whether message.data equals close by === simply. - if (message.data.indexOf(" from server"); - // } - } - return; - } else if (message.data.search(" tag before we close the connection - return; - } - this._conn._dataRecv(elem, message.data); - }; + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; - var _listenNetwork = function (onlineCallback, offlineCallback) { + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind, + nativeCreate = Object.create; - if (window.addEventListener) { - window.addEventListener('online', onlineCallback); - window.addEventListener('offline', offlineCallback); + // Naked function reference for surrogate-prototype-swapping. + var Ctor = function(){}; - } else if (window.attachEvent) { - if (document.body) { - document.body.attachEvent('ononline', onlineCallback); - document.body.attachEvent('onoffline', offlineCallback); - } else { - window.attachEvent('load', function () { - document.body.attachEvent('ononline', onlineCallback); - document.body.attachEvent('onoffline', offlineCallback); - }); - } - } else { - /*var onlineTmp = window.ononline; - var offlineTmp = window.onoffline; + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; - window.attachEvent('ononline', function () { - try { - typeof onlineTmp === 'function' && onlineTmp(); - } catch ( e ) {} - onlineCallback(); - }); - window.attachEvent('onoffline', function () { - try { - typeof offlineTmp === 'function' && offlineTmp(); - } catch ( e ) {} - offlineCallback(); - });*/ + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object. + if (true) { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; } - }; + exports._ = _; + } else { + root._ = _; + } - var _parseRoom = function (result) { - var rooms = []; - var items = result.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var roomJid = item.getAttribute('jid'); - var tmp = roomJid.split('@')[0]; - var room = { - jid: roomJid, - name: item.getAttribute('name'), - roomId: tmp.split('_')[1] - }; - rooms.push(room); - } - } - return rooms; - }; + // Current version. + _.VERSION = '1.8.3'; - var _parseRoomOccupants = function (result) { - var occupants = []; - var items = result.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var room = { - jid: item.getAttribute('jid'), - name: item.getAttribute('name') - }; - occupants.push(room); - } + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var optimizeCb = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; } - return occupants; - }; + return function() { + return func.apply(context, arguments); + }; + }; - var _parseResponseMessage = function (msginfo) { - var parseMsgData = {errorMsg: true, data: []}; + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + var cb = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return optimizeCb(value, context, argCount); + if (_.isObject(value)) return _.matcher(value); + return _.property(value); + }; + _.iteratee = function(value, context) { + return cb(value, context, Infinity); + }; - var msgBodies = msginfo.getElementsByTagName('body'); - if (msgBodies) { - for (var i = 0; i < msgBodies.length; i++) { - var msgBody = msgBodies[i]; - var childNodes = msgBody.childNodes; - if (childNodes && childNodes.length > 0) { - var childNode = msgBody.childNodes[0]; - if (childNode.nodeType == Strophe.ElementType.TEXT) { - var jsondata = childNode.wholeText || childNode.nodeValue; - jsondata = jsondata.replace('\n', '
'); - try { - var data = eval('(' + jsondata + ')'); - parseMsgData.errorMsg = false; - parseMsgData.data = [data]; - } catch (e) { - } - } - } - } - - var delayTags = msginfo.getElementsByTagName('delay'); - if (delayTags && delayTags.length > 0) { - var delayTag = delayTags[0]; - var delayMsgTime = delayTag.getAttribute('stamp'); - if (delayMsgTime) { - parseMsgData.delayTimeStamp = delayMsgTime; - } - } - } else { - var childrens = msginfo.childNodes; - if (childrens && childrens.length > 0) { - var child = msginfo.childNodes[0]; - if (child.nodeType == Strophe.ElementType.TEXT) { - try { - var data = eval('(' + child.nodeValue + ')'); - parseMsgData.errorMsg = false; - parseMsgData.data = [data]; - } catch (e) { - } - } + // An internal function for creating assigner functions. + var createAssigner = function(keysFunc, undefinedOnly) { + return function(obj) { + var length = arguments.length; + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; } - } - return parseMsgData; - }; + } + return obj; + }; + }; - var _parseNameFromJidFn = function (jid, domain) { - domain = domain || ''; - var tempstr = jid; - var findex = tempstr.indexOf('_'); + // An internal function for creating a new object that inherits from another. + var baseCreate = function(prototype) { + if (!_.isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; + }; - if (findex !== -1) { - tempstr = tempstr.substring(findex + 1); - } - var atindex = tempstr.indexOf('@' + domain); - if (atindex !== -1) { - tempstr = tempstr.substring(0, atindex); - } - return tempstr; - }; + var property = function(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + }; - var _parseFriend = function (queryTag, conn, from) { - var rouster = []; - var items = queryTag.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('jid'); - if (!jid) { - continue; - } - var subscription = item.getAttribute('subscription'); - var friend = { - subscription: subscription, - jid: jid - }; - var ask = item.getAttribute('ask'); - if (ask) { - friend.ask = ask; - } - var name = item.getAttribute('name'); - if (name) { - friend.name = name; - } else { - var n = _parseNameFromJidFn(jid); - friend.name = n; - } - var groups = []; - Strophe.forEachChild(item, 'group', function (group) { - groups.push(Strophe.getText(group)); - }); - friend.groups = groups; - rouster.push(friend); - // B同意之后 -> B订阅A - // fix: 含有ask标示的好友代表已经发送过反向订阅消息,不需要再次发送。 - if (conn && (subscription == 'from') && !ask) { - conn.subscribe({ - toJid: jid, - message: "[resp:true]" - }); - } + // Helper for collection methods to determine whether a collection + // should be iterated as an array or as an object + // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + var getLength = property('length'); + var isArrayLike = function(collection) { + var length = getLength(collection); + return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; + }; - if (conn && (subscription == 'to')) { - conn.subscribed({ - toJid: jid - }); - } - } - } - return rouster; - }; + // Collection Functions + // -------------------- - var _login = function (options, conn) { - var accessToken = options.access_token || ''; - if (accessToken == '') { - var loginfo = _utils.stringify(options); - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, - data: options - }); - return; - } - conn.context.accessToken = options.access_token; - conn.context.accessTokenExpires = options.expires_in; - if (conn.isOpening() && conn.context.stropheConn) { - stropheConn = conn.context.stropheConn; - } else if (conn.isOpened() && conn.context.stropheConn) { - // return; - stropheConn = conn.getStrophe(); + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } } else { - stropheConn = conn.getStrophe(); + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); + } } - var callback = function (status, msg) { - _loginCallback(status, msg, conn); - }; + return obj; + }; - conn.context.stropheConn = stropheConn; - if (conn.route) { - stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold, conn.route); - } else { - stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold); + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); } - }; - - var _parseMessageType = function (msginfo) { - var receiveinfo = msginfo.getElementsByTagName('received'), - inviteinfo = msginfo.getElementsByTagName('invite'), - deliveryinfo = msginfo.getElementsByTagName('delivery'), - acked = msginfo.getElementsByTagName('acked'), - error = msginfo.getElementsByTagName('error'), - msgtype = 'normal'; - if (receiveinfo && receiveinfo.length > 0 - && - receiveinfo[0].namespaceURI === 'urn:xmpp:receipts') { + return results; + }; - msgtype = 'received'; + // Create a reducing function iterating left or right. + function createReduce(dir) { + // Optimized iterator function as using arguments.length + // in the main function will deoptimize the, see #1991. + function iterator(obj, iteratee, memo, keys, index, length) { + for (; index >= 0 && index < length; index += dir) { + var currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + } - } else if (inviteinfo && inviteinfo.length > 0) { + return function(obj, iteratee, memo, context) { + iteratee = optimizeCb(iteratee, context, 4); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + index = dir > 0 ? 0 : length - 1; + // Determine the initial value if none is provided. + if (arguments.length < 3) { + memo = obj[keys ? keys[index] : index]; + index += dir; + } + return iterator(obj, iteratee, memo, keys, index, length); + }; + } - msgtype = 'invite'; + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + _.reduce = _.foldl = _.inject = createReduce(1); - } else if (deliveryinfo && deliveryinfo.length > 0) { + // The right-associative version of reduce, also known as `foldr`. + _.reduceRight = _.foldr = createReduce(-1); - msgtype = 'delivery'; // 消息送达 + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var key; + if (isArrayLike(obj)) { + key = _.findIndex(obj, predicate, context); + } else { + key = _.findKey(obj, predicate, context); + } + if (key !== void 0 && key !== -1) return obj[key]; + }; - } else if (acked && acked.length) { + // Return all the elements that pass a truth test. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + }; - msgtype = 'acked'; // 消息已读 + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(cb(predicate)), context); + }; - } else if (error && error.length) { + // Determine whether all of the elements match a truth test. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + }; - var errorItem = error[0], - userMuted = errorItem.getElementsByTagName('user-muted'); + // Determine if at least one element in the object matches a truth test. + // Aliased as `any`. + _.some = _.any = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + }; - if (userMuted && userMuted.length) { + // Determine if the array or object contains a given item (using `===`). + // Aliased as `includes` and `include`. + _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return _.indexOf(obj, item, fromIndex) >= 0; + }; - msgtype = 'userMuted'; + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + var func = isFunc ? method : value[method]; + return func == null ? func : func.apply(value, args); + }); + }; - } + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matcher(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matcher(attrs)); + }; + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); } - return msgtype; - }; + return result; + }; - var _handleMessageQueue = function (conn) { - for (var i in _msgHash) { - if (_msgHash.hasOwnProperty(i)) { - _msgHash[i].send(conn); + // Return the minimum element (or element-based computation). + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; } + }); } - }; + return result; + }; - var _loginCallback = function (status, msg, conn) { - var conflict, error; + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var set = isArrayLike(obj) ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } + return shuffled; + }; - if (msg === 'conflict') { - conflict = true; + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; - if (status == Strophe.Status.CONNFAIL) { - //client offline, ping/pong timeout, server quit, server offline - error = { - type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, - msg: msg, - reconnect: true - }; + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iteratee(value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; - conflict && (error.conflict = true); - conn.onError(error); - } else if (status == Strophe.Status.ATTACHED || status == Strophe.Status.CONNECTED) { - // client should limit the speed of sending ack messages up to 5/s - conn.autoReconnectNumTotal = 0; - conn.intervalId = setInterval(function () { - conn.handelSendQueue(); - }, 200); - var handleMessage = function (msginfo) { - var delivery = msginfo.getElementsByTagName('delivery'); - var acked = msginfo.getElementsByTagName('acked'); - if (delivery.length) { - conn.handleDeliveredMessage(msginfo); - return true; - } - if (acked.length) { - conn.handleAckedMessage(msginfo); - return true; - } - var type = _parseMessageType(msginfo); - switch (type) { - case "received": - conn.handleReceivedMessage(msginfo); - return true; - case "invite": - conn.handleInviteMessage(msginfo); - return true; - case "delivery": - conn.handleDeliveredMessage(msginfo); - return true; - case "acked": - conn.handleAckedMessage(msginfo); - return true; - case "userMuted": - conn.handleMutedMessage(msginfo); - return true; - default: - conn.handleMessage(msginfo); - return true; - } - }; - var handlePresence = function (msginfo) { - conn.handlePresence(msginfo); - return true; - }; - var handlePing = function (msginfo) { - conn.handlePing(msginfo); - return true; - }; - var handleIqRoster = function (msginfo) { - conn.handleIqRoster(msginfo); - return true; - }; - var handleIqPrivacy = function (msginfo) { - conn.handleIqPrivacy(msginfo); - return true; - }; - var handleIq = function (msginfo) { - conn.handleIq(msginfo); - return true; - }; + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = cb(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + }; - conn.addHandler(handleMessage, null, 'message', null, null, null); - conn.addHandler(handlePresence, null, 'presence', null, null, null); - conn.addHandler(handlePing, 'urn:xmpp:ping', 'iq', 'get', null, null); - conn.addHandler(handleIqRoster, 'jabber:iq:roster', 'iq', 'set', null, null); - conn.addHandler(handleIqPrivacy, 'jabber:iq:privacy', 'iq', 'set', null, null); - conn.addHandler(handleIq, null, 'iq', null, null, null); + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); - conn.registerConfrIQHandler && (conn.registerConfrIQHandler()); + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); - conn.context.status = _code.STATUS_OPENED; + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); - var supportRecMessage = [ - _code.WEBIM_MESSAGE_REC_TEXT, - _code.WEBIM_MESSAGE_REC_EMOJI]; + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (isArrayLike(obj)) return _.map(obj, _.identity); + return _.values(obj); + }; - if (_utils.isCanDownLoadFile) { - supportRecMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); - supportRecMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); - } - var supportSedMessage = [_code.WEBIM_MESSAGE_SED_TEXT]; - if (_utils.isCanUploadFile) { - supportSedMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); - supportSedMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); - } - conn.notifyVersion(); - conn.retry && _handleMessageQueue(conn); - conn.heartBeat(); - conn.isAutoLogin && conn.setPresence(); - - try { - if (conn.unSendMsgArr.length > 0) { - for (var i in conn.unSendMsgArr) { - var dom = conn.unSendMsgArr[i]; - conn.sendCommand(dom); - delete conn.unSendMsgArr[i]; - } - } - } catch (e) { - console.error(e.message); - } - conn.offLineSendConnecting = false; - conn.logOut = false; + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : _.keys(obj).length; + }; - conn.onOpened({ - canReceive: supportRecMessage, - canSend: supportSedMessage, - accessToken: conn.context.accessToken - }); - } else if (status == Strophe.Status.DISCONNECTING) { - if (conn.isOpened()) { - conn.stopHeartBeat(); - conn.context.status = _code.STATUS_CLOSING; + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = cb(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; + }; - error = { - type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, - msg: msg, - reconnect: true - }; + // Array Functions + // --------------- - conflict && (error.conflict = true); - conn.onError(error); - } - } else if (status == Strophe.Status.DISCONNECTED) { - if (conn.isOpened()) { - if (conn.autoReconnectNumTotal < conn.autoReconnectNumMax) { - conn.reconnect(); - return; - } else { - error = { - type: _code.WEBIM_CONNCTION_DISCONNECTED - }; - conn.onError(error); - } - } - conn.context.status = _code.STATUS_CLOSED; - conn.clear(); - conn.onClosed(); - } else if (status == Strophe.Status.AUTHFAIL) { - error = { - type: _code.WEBIM_CONNCTION_AUTH_ERROR - }; + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[0]; + return _.initial(array, array.length - n); + }; - conflict && (error.conflict = true); - conn.onError(error); - conn.clear(); - } else if (status == Strophe.Status.ERROR) { - conn.context.status = _code.STATUS_ERROR; - error = { - type: _code.WEBIM_CONNCTION_SERVER_ERROR - }; + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + _.initial = function(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + }; - conflict && (error.conflict = true); - conn.onError(error); - } - conn.context.status_now = status; - }; + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[array.length - 1]; + return _.rest(array, Math.max(0, array.length - n)); + }; - var _getJid = function (options, conn) { - var jid = options.toJid || ''; + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + }; - if (jid === '') { - var appKey = conn.context.appKey || ''; - var toJid = appKey + '_' + options.to + '@' + conn.domain; + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; - if (options.resource) { - toJid = toJid + '/' + options.resource; + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, strict, startIndex) { + var output = [], idx = 0; + for (var i = startIndex || 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { + //flatten current level of array or arguments object + if (!shallow) value = flatten(value, shallow, strict); + var j = 0, len = value.length; + output.length += len; + while (j < len) { + output[idx++] = value[j++]; } - jid = toJid; - } - return jid; - }; - - var _getJidByName = function (name, conn) { - var options = { - to: name - }; - return _getJid(options, conn); - }; - - var _validCheck = function (options, conn) { - options = options || {}; - - if (options.user == '') { - conn.onError({ - type: _code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR - }); - return false; + } else if (!strict) { + output[idx++] = value; + } } + return output; + }; - var user = (options.user + '') || ''; - var appKey = options.appKey || ''; - var devInfos = appKey.split('#'); + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, false); + }; - if (devInfos.length !== 2) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } - var orgName = devInfos[0]; - var appName = devInfos[1]; + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; - if (!orgName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; } - if (!appName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!_.contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!_.contains(result, value)) { + result.push(value); + } } + return result; + }; - var jid = appKey + '_' + user.toLowerCase() + '@' + conn.domain, - resource = options.resource || 'webim'; + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(flatten(arguments, true, true)); + }; - if (conn.isMultiLoginSessions) { - resource += user + new Date().getTime() + Math.floor(Math.random().toFixed(6) * 1000000); + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); } - conn.context.jid = jid + '/' + resource; - conn.context.userId = user; - conn.context.appKey = appKey; - conn.context.appName = appName; - conn.context.orgName = orgName; + return result; + }; - return true; - }; + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = flatten(arguments, true, true, 1); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); + }; - var _getXmppUrl = function (baseUrl, https) { - if (/^(ws|http)s?:\/\/?/.test(baseUrl)) { - return baseUrl; - } + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + return _.unzip(arguments); + }; - var url = { - prefix: 'http', - base: '://' + baseUrl, - suffix: '/http-bind/' - }; + // Complement of _.zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices + _.unzip = function(array) { + var length = array && _.max(array, getLength).length || 0; + var result = Array(length); - if (https && _utils.isSupportWss) { - url.prefix = 'wss'; - url.suffix = '/ws/'; - } else { - if (https) { - url.prefix = 'https'; - } else if (window.WebSocket) { - url.prefix = 'ws'; - url.suffix = '/ws/'; - } + for (var index = 0; index < length; index++) { + result[index] = _.pluck(array, index); } + return result; + }; - return url.prefix + url.base + url.suffix; - }; - - - /** - * The connection class. - * @constructor - * @param {Object} options - - * @param {String} options.url - xmppURL for xmpp server - * @param {String} options.apiUrl - apiURL for restful API server - * @param {Boolean} options.isHttpDNS - while http:// protocol,use ip directly,instead of ServerName,avoiding DNS problem.default false - * @param {Boolean} options.isMultiLoginSessions - true: A visitor can sign in to multiple webpages and receive messages at all the webpages. false: A visitor can sign in to only one webpage and receive messages at the webpage. - * @param {Boolean} options.https - Whether use wss or not. - * @param {Number} options.heartBeatWait - after login, send empty message to xmpp server like heartBeat every 45s, to keep the ws connection alive. - * @param {Boolean} options.isAutoLogin - set presence after login - * @param {Number} options.autoReconnectNumMax - will auto connect the xmpp server autoReconnectNumMax times in background when client is offline. - * @param {Number} options.autoReconnectInterval - the interval seconds between each auto reconnectting. - * @param {Boolean} options.isWindowSDK - Whether for windows platform. default false. - * @param {Boolean} options.encrypt - whether encrypt text message and emoji message - * @param {Boolean} options.delivery - When a message arrived, whether the receiver send an ack message to the sender or not. - * @param {Number} options.pollingTime - - * @param {Number} options.maxRetries - - * @param {Boolean} options.hold - - * @param {String} options.route - - * @param {String} options.domain - - * @param {Boolean} options.inactivity - - * - * @returns {Class} a single instance of connection - */ - var connection = function (options) { - if (!this instanceof connection) { - return new connection(options); + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } } + return result; + }; - var options = options || {}; - - this.isHttpDNS = options.isHttpDNS || false; - this.isMultiLoginSessions = options.isMultiLoginSessions || false; - this.wait = options.wait || 30; - this.hold = options.hold || 1; - this.retry = options.retry || false; - this.https = options.https || location.protocol === 'https:'; - this.url = _getXmppUrl(options.url, this.https); - this.route = options.route || null; - this.domain = options.domain || 'easemob.com'; - this.inactivity = options.inactivity || 30; - this.heartBeatWait = options.heartBeatWait || 4500; - this.maxRetries = options.maxRetries || 5; - this.isAutoLogin = options.isAutoLogin === false ? false : true; - this.pollingTime = options.pollingTime || 800; - this.stropheConn = false; - this.autoReconnectNumMax = options.autoReconnectNumMax || 0; - this.autoReconnectNumTotal = 0; - this.autoReconnectInterval = options.autoReconnectInterval || 0; - this.context = {status: _code.STATUS_INIT}; - this.sendQueue = new Queue(); //instead of sending message immediately,cache them in this queue - this.intervalId = null; //clearInterval return value - this.apiUrl = options.apiUrl || ''; - this.isWindowSDK = options.isWindowSDK || false; - this.encrypt = options.encrypt || {encrypt: {type: 'none'}}; - this.delivery = options.delivery || false; - this.user = ''; - this.orgName = ''; - this.appName = ''; - this.token = ''; - this.unSendMsgArr = []; - this.offLineSendConnecting = false; - this.logOut = false; + // Generator function to create the findIndex and findLastIndex functions + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; + } - this.dnsArr = ['https://rs.easemob.com', 'https://rsbak.easemob.com', 'http://182.92.174.78', 'http://112.126.66.111']; //http dns server hosts - this.dnsIndex = 0; //the dns ip used in dnsArr currently - this.dnsTotal = this.dnsArr.length; //max number of getting dns retries - this.restHosts = null; //rest server ips - this.restIndex = 0; //the rest ip used in restHosts currently - this.restTotal = 0; //max number of getting rest token retries - this.xmppHosts = null; //xmpp server ips - this.xmppIndex = 0; //the xmpp ip used in xmppHosts currently - this.xmppTotal = 0; //max number of creating xmpp server connection(ws/bosh) retries + // Returns the first index on an array-like that passes a predicate test + _.findIndex = createPredicateIndexFinder(1); + _.findLastIndex = createPredicateIndexFinder(-1); - this.groupOption = {}; - }; + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + }; - connection.prototype.testInit = function (options) { - this.orgName = options.orgName; - this.appName = options.appName; - this.user = options.user; - this.token = options.token; - }; + // Generator function to create the indexOf and lastIndexOf functions + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), _.isNaN); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; + } - /** - * 注册新用户 - * @param {options} options - - */ - connection.prototype.registerUser = function (options) { - if (location.protocol != 'https:' && this.isHttpDNS) { - this.dnsIndex = 0; - this.getHttpDNS(options, 'signup'); - } else { - this.signup(options); - } - } + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); + _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); - /** - * 处理发送队列 - * @private - */ - connection.prototype.handelSendQueue = function () { - var options = this.sendQueue.pop(); - if (options !== null) { - this.sendReceiptsMessage(options); + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; } - }; - - /** - * 注册监听函数 - * @param {options} options - - */ - connection.prototype.listen = function (options) { - this.onOpened = options.onOpened || _utils.emptyfn; - this.onClosed = options.onClosed || _utils.emptyfn; - this.onTextMessage = options.onTextMessage || _utils.emptyfn; - this.onEmojiMessage = options.onEmojiMessage || _utils.emptyfn; - this.onPictureMessage = options.onPictureMessage || _utils.emptyfn; - this.onAudioMessage = options.onAudioMessage || _utils.emptyfn; - this.onVideoMessage = options.onVideoMessage || _utils.emptyfn; - this.onFileMessage = options.onFileMessage || _utils.emptyfn; - this.onLocationMessage = options.onLocationMessage || _utils.emptyfn; - this.onCmdMessage = options.onCmdMessage || _utils.emptyfn; - this.onPresence = options.onPresence || _utils.emptyfn; - this.onRoster = options.onRoster || _utils.emptyfn; - this.onError = options.onError || _utils.emptyfn; - this.onReceivedMessage = options.onReceivedMessage || _utils.emptyfn; - this.onInviteMessage = options.onInviteMessage || _utils.emptyfn; - this.onDeliverdMessage = options.onDeliveredMessage || _utils.emptyfn; - this.onReadMessage = options.onReadMessage || _utils.emptyfn; - this.onMutedMessage = options.onMutedMessage || _utils.emptyfn; - this.onOffline = options.onOffline || _utils.emptyfn; - this.onOnline = options.onOnline || _utils.emptyfn; - this.onConfirmPop = options.onConfirmPop || _utils.emptyfn; - this.onCreateGroup = options.onCreateGroup || _utils.emptyfn; - //for WindowSDK start - this.onUpdateMyGroupList = options.onUpdateMyGroupList || _utils.emptyfn; - this.onUpdateMyRoster = options.onUpdateMyRoster || _utils.emptyfn; - //for WindowSDK end - this.onBlacklistUpdate = options.onBlacklistUpdate || _utils.emptyfn; + step = step || 1; - _listenNetwork(this.onOnline, this.onOffline); - }; + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); - /** - * 发送心跳 - * webrtc需要强制心跳,加个默认为false的参数 向下兼容 - * @param {Boolean} forcing - 是否强制发送 - * @private - */ - connection.prototype.heartBeat = function (forcing) { - if (forcing !== true) { - forcing = false; + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; } - var me = this; - //IE8: strophe auto switch from ws to BOSH, need heartbeat - var isNeed = !/^ws|wss/.test(me.url) || /mobile/.test(navigator.userAgent); - if (this.heartBeatID || (!forcing && !isNeed)) { - return; - } + return range; + }; - var options = { - toJid: this.domain, - type: 'normal' - }; - this.heartBeatID = setInterval(function () { - // fix: do heartbeat only when websocket - _utils.isSupportWss && me.ping(options); - }, this.heartBeatWait); - }; - - /** - * @private - */ - connection.prototype.stopHeartBeat = function () { - if (typeof this.heartBeatID == "number") { - this.heartBeatID = clearInterval(this.heartBeatID); - } - }; + // Function (ahem) Functions + // ------------------ - /** - * 发送接收消息回执 - * @param {Object} options - - * @private - */ - connection.prototype.sendReceiptsMessage = function (options) { - var dom = $msg({ - from: this.context.jid || '', - to: this.domain, - id: options.id || '' - }).c('received', { - xmlns: 'urn:xmpp:receipts', - id: options.id || '' - }); - this.sendCommand(dom.tree()); - }; + // Determines whether to execute a function as a constructor + // or a normal function with the provided arguments + var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (_.isObject(result)) return result; + return self; + }; - /** - * @private - */ - connection.prototype.cacheReceiptsMessage = function (options) { - this.sendQueue.push(options); - }; + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + var args = slice.call(arguments, 2); + var bound = function() { + return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); + }; + return bound; + }; - /** - * @private - */ - connection.prototype.getStrophe = function () { - if (location.protocol != 'https:' && this.isHttpDNS) { - //TODO: try this.xmppTotal times on fail - var url = ''; - var host = this.xmppHosts[this.xmppIndex]; - var domain = _utils.getXmlFirstChild(host, 'domain'); - var ip = _utils.getXmlFirstChild(host, 'ip'); - if (ip) { - url = ip.textContent; - var port = _utils.getXmlFirstChild(host, 'port'); - if (port.textContent != '80') { - url += ':' + port.textContent; - } - } else { - url = domain.textContent; - } + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }; - if (url != '') { - var parter = /(.+\/\/).+(\/.+)/; - this.url = this.url.replace(parter, "$1" + url + "$2"); - } + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); } + return obj; + }; - var stropheConn = new Strophe.Connection(this.url, { - inactivity: this.inactivity, - maxRetries: this.maxRetries, - pollingTime: this.pollingTime - }); - return stropheConn; - }; + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + }; - /** - * - * @param data - * @param tagName - * @private - */ - connection.prototype.getHostsByTag = function (data, tagName) { - var tag = _utils.getXmlFirstChild(data, tagName); - if (!tag) { - console.log(tagName + ' hosts error'); - return null; - } - var hosts = tag.getElementsByTagName('hosts'); - if (hosts.length == 0) { - console.log(tagName + ' hosts error2'); - return null; - } - return hosts[0].getElementsByTagName('host'); + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); + }; - }; + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = _.partial(_.delay, _, 1); - /** - * @private - */ - connection.prototype.getRestFromHttpDNS = function (options, type) { - if (this.restIndex > this.restTotal) { - console.log('rest hosts all tried,quit'); - return; - } - var url = ''; - var host = this.restHosts[this.restIndex]; - var domain = _utils.getXmlFirstChild(host, 'domain'); - var ip = _utils.getXmlFirstChild(host, 'ip'); - if (ip) { - var port = _utils.getXmlFirstChild(host, 'port'); - url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + ip.textContent + ':' + port.textContent; - } else { - url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + domain.textContent; - } + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; - if (url != '') { - this.apiUrl = url; - options.apiUrl = url; - } + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; - if (type == 'login') { - this.login(options); - } else { - this.signup(options); - } - }; + var later = function() { + var last = _.now() - timestamp; - /** - * @private - */ - connection.prototype.getHttpDNS = function (options, type) { - if (this.restHosts) { - this.getRestFromHttpDNS(options, type); - return; - } - var self = this; - var suc = function (data, xhr) { - data = new DOMParser().parseFromString(data, "text/xml").documentElement; - //get rest ips - var restHosts = self.getHostsByTag(data, 'rest'); - if (!restHosts) { - console.log('rest hosts error3'); - return; + if (last < wait && last >= 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; } - self.restHosts = restHosts; - self.restTotal = restHosts.length; + } + }; - //get xmpp ips - var xmppHosts = self.getHostsByTag(data, 'xmpp'); - if (!xmppHosts) { - console.log('xmpp hosts error3'); - return; - } - self.xmppHosts = xmppHosts; - self.xmppTotal = xmppHosts.length; + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } - self.getRestFromHttpDNS(options, type); + return result; }; - var error = function (res, xhr, msg) { + }; - console.log('getHttpDNS error', res, msg); - self.dnsIndex++; - if (self.dnsIndex < self.dnsTotal) { - self.getHttpDNS(options, type); - } + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); }; - var options2 = { - url: this.dnsArr[this.dnsIndex] + '/easemob/server.xml', - dataType: 'text', - type: 'GET', + }; - // url: 'http://www.easemob.com/easemob/server.xml', - // dataType: 'xml', - data: {app_key: encodeURIComponent(options.appKey)}, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; }; - _utils.ajax(options2); - }; - - /** - * @private - */ - connection.prototype.signup = function (options) { - var self = this; - var orgName = options.orgName || ''; - var appName = options.appName || ''; - var appKey = options.appKey || ''; - var suc = options.success || EMPTYFN; - var err = options.error || EMPTYFN; - - if (!orgName && !appName && appKey) { - var devInfos = appKey.split('#'); - if (devInfos.length === 2) { - orgName = devInfos[0]; - appName = devInfos[1]; - } - } - if (!orgName && !appName) { - err({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return; - } + }; - var error = function (res, xhr, msg) { - if (location.protocol != 'https:' && self.isHttpDNS) { - if ((self.restIndex + 1) < self.restTotal) { - self.restIndex++; - self.getRestFromHttpDNS(options, 'signup'); - return; - } - } - self.clear(); - err(res); + // Returns a function that will only be executed on and after the Nth call. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } }; - var https = options.https || https; - var apiUrl = options.apiUrl; - var restUrl = apiUrl + '/' + orgName + '/' + appName + '/users'; + }; - var userjson = { - username: options.username, - password: options.password, - nickname: options.nickname || '' + // Returns a function that will only be executed up to (but not including) the Nth call. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; }; + }; - var userinfo = _utils.stringify(userjson); - var options2 = { - url: restUrl, - dataType: 'json', - data: userinfo, - success: suc, - error: error - }; - _utils.ajax(options2); - }; + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); - /** - * 登录 - * @param {Object} options - - */ - connection.prototype.open = function (options) { - var appkey = options.appKey, - orgName = appkey.split('#')[0], - appName = appkey.split('#')[1]; - this.orgName = orgName; - this.appName = appName; - if (options.accessToken) { - this.token = options.accessToken; - } - if (options.xmppURL) { - this.url = _getXmppUrl(options.xmppURL, this.https); - } - if (location.protocol != 'https:' && this.isHttpDNS) { - this.dnsIndex = 0; - this.getHttpDNS(options, 'login'); - } else { - this.login(options); - } - }; + // Object Functions + // ---------------- - /** - * - * @param options - * @private - */ - connection.prototype.login = function (options) { - this.user = options.user; - var pass = _validCheck(options, this); + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - if (!pass) { - return; - } + function collectNonEnumProps(obj, keys) { + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; - var conn = this; + // Constructor is a special case. + var prop = 'constructor'; + if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); - if (conn.isOpened()) { - return; + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { + keys.push(prop); + } } + } - if (options.accessToken) { - options.access_token = options.accessToken; - conn.context.restTokenData = options; - _login(options, conn); - } else { - var apiUrl = options.apiUrl; - var userId = this.context.userId; - var pwd = options.pwd || ''; - var appName = this.context.appName; - var orgName = this.context.orgName; - - var suc = function (data, xhr) { - conn.context.status = _code.STATUS_DOLOGIN_IM; - conn.context.restTokenData = data; - if (options.success) - options.success(data); - conn.token = data.access_token; - _login(data, conn); - }; - var error = function (res, xhr, msg) { - if (options.error) - options.error(); - if (location.protocol != 'https:' && conn.isHttpDNS) { - if ((conn.restIndex + 1) < conn.restTotal) { - conn.restIndex++; - conn.getRestFromHttpDNS(options, 'login'); - return; - } - } - conn.clear(); - if (res.error && res.error_description) { - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, - data: res, - xhr: xhr - }); - } else { - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_ERROR, - data: res, - xhr: xhr - }); - } - }; + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; - this.context.status = _code.STATUS_DOLOGIN_USERGRID; + // Retrieve all the property names of an object. + _.allKeys = function(obj) { + if (!_.isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; - var loginJson = { - grant_type: 'password', - username: userId, - password: pwd, - timestamp: +new Date() - }; - var loginfo = _utils.stringify(loginJson); + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; - var options2 = { - url: apiUrl + '/' + orgName + '/' + appName + '/token', - dataType: 'json', - data: loginfo, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn - }; - _utils.ajax(options2); + // Returns the results of applying the iteratee to each element of the object + // In contrast to _.map it returns an object + _.mapObject = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = _.keys(obj), + length = keys.length, + results = {}, + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; } - }; + return pairs; + }; - /** - * attach to xmpp server for BOSH - * @private - */ - connection.prototype.attach = function (options) { - var pass = _validCheck(options, this); + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; - if (!pass) { - return; + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); } + return names.sort(); + }; - options = options || {}; + // Extend a given object with all the properties in passed-in object(s). + _.extend = createAssigner(_.allKeys); - var accessToken = options.accessToken || ''; - if (accessToken == '') { - this.onError({ - type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR - }); - return; - } + // Assigns a given object with all the own properties in the passed-in object(s) + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + _.extendOwn = _.assign = createAssigner(_.keys); - var sid = options.sid || ''; - if (sid === '') { - this.onError({ - type: _code.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR - }); - return; + // Returns the first key on an object that passes a predicate test + _.findKey = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = _.keys(obj), key; + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (predicate(obj[key], key, obj)) return key; } + }; - var rid = options.rid || ''; - if (rid === '') { - this.onError({ - type: _code.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR - }); - return; + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(object, oiteratee, context) { + var result = {}, obj = object, iteratee, keys; + if (obj == null) return result; + if (_.isFunction(oiteratee)) { + keys = _.allKeys(obj); + iteratee = optimizeCb(oiteratee, context); + } else { + keys = flatten(arguments, false, false, 1); + iteratee = function(value, key, obj) { return key in obj; }; + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; } + return result; + }; - stropheConn = this.getStrophe(); + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(flatten(arguments, false, false, 1), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; + } + return _.pick(obj, iteratee, context); + }; - this.context.accessToken = accessToken; - this.context.stropheConn = stropheConn; - this.context.status = _code.STATUS_DOLOGIN_IM; + // Fill in a given object with default properties. + _.defaults = createAssigner(_.allKeys, true); - var conn = this; - var callback = function (status, msg) { - _loginCallback(status, msg, conn); - }; + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + _.create = function(prototype, props) { + var result = baseCreate(prototype); + if (props) _.extendOwn(result, props); + return result; + }; - var jid = this.context.jid; - var wait = this.wait; - var hold = this.hold; - var wind = this.wind || 5; - stropheConn.attach(jid, sid, rid, callback, wait, hold, wind); - }; + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; - /** - * close connection - * @param {String} reason - */ - connection.prototype.close = function (reason) { - this.logOut = true; - this.stopHeartBeat(); + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; - var status = this.context.status; - if (status == _code.STATUS_INIT) { - return; + // Returns whether an object has a given set of `key:value` pairs. + _.isMatch = function(object, attrs) { + var keys = _.keys(attrs), length = keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; } + return true; + }; - if (this.isClosed() || this.isClosing()) { - return; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; } - this.context.status = _code.STATUS_CLOSING; - this.context.stropheConn.disconnect(reason); - }; + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; - /** - * @private - */ - connection.prototype.addHandler = function (handler, ns, name, type, id, from, options) { - this.context.stropheConn.addHandler(handler, ns, name, type, id, from, options); - }; + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - /** - * @private - */ - connection.prototype.notifyVersion = function (suc, fail) { - var jid = stropheConn.getJid(); - this.context.jid = jid; - var dom = $iq({ - from: jid || '' - , to: this.domain - , type: 'result' - }) - .c('query', {xmlns: 'jabber:iq:version'}) - .c('name') - .t('easemob') - .up() - .c('version') - .t(_version) - .up() - .c('os') - .t('webim'); + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } - var suc = suc || _utils.emptyfn; - var error = fail || this.onError; - var failFn = function (ele) { - error({ - type: _code.WEBIM_CONNCTION_NOTIFYVERSION_ERROR - , data: ele - }); - }; - this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); - return; - }; + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); - /** - * handle all types of presence message - * @private - */ - connection.prototype.handlePresence = function (msginfo) { - console.log('Info: ', typeof msginfo); - if (this.isClosed()) { - return; + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var keys = _.keys(a), key; + length = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (_.keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = keys[length]; + if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } } - var from = msginfo.getAttribute('from') || ''; - var to = msginfo.getAttribute('to') || ''; - var type = msginfo.getAttribute('type') || ''; - var presence_type = msginfo.getAttribute('presence_type') || ''; - var fromUser = _parseNameFromJidFn(from); - var toUser = _parseNameFromJidFn(to); - var isCreate = false; - var isMemberJoin = false; - var isDecline = false; - var isApply = false; - var info = { - from: fromUser, - to: toUser, - fromJid: from, - toJid: to, - type: type, - chatroom: msginfo.getElementsByTagName('roomtype').length ? true : false - }; + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + }; - var showTags = msginfo.getElementsByTagName('show'); - if (showTags && showTags.length > 0) { - var showTag = showTags[0]; - info.show = Strophe.getText(showTag); - } - var statusTags = msginfo.getElementsByTagName('status'); - if (statusTags && statusTags.length > 0) { - var statusTag = statusTags[0]; - info.status = Strophe.getText(statusTag); - info.code = statusTag.getAttribute('code'); - } + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b); + }; - var priorityTags = msginfo.getElementsByTagName('priority'); - if (priorityTags && priorityTags.length > 0) { - var priorityTag = priorityTags[0]; - info.priority = Strophe.getText(priorityTag); - } + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; + return _.keys(obj).length === 0; + }; - var error = msginfo.getElementsByTagName('error'); - if (error && error.length > 0) { - var error = error[0]; - info.error = { - code: error.getAttribute('code') - }; - } + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; - var destroy = msginfo.getElementsByTagName('destroy'); - if (destroy && destroy.length > 0) { - var destroy = destroy[0]; - info.destroy = true; + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; + }; - var reason = destroy.getElementsByTagName('reason'); - if (reason && reason.length > 0) { - info.reason = Strophe.getText(reason[0]); - } - } + // Is a given variable an object? + _.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; - var members = msginfo.getElementsByTagName('item'); - if (members && members.length > 0) { - var member = members[0]; - var role = member.getAttribute('role'); - var jid = member.getAttribute('jid'); - var affiliation = member.getAttribute('affiliation'); - // dismissed by group - if (role == 'none' && jid) { - var kickedMember = _parseNameFromJidFn(jid); - var actor = member.getElementsByTagName('actor')[0]; - var actorNick = actor.getAttribute('nick'); - info.actor = actorNick; - info.kicked = kickedMember; - } - // Service Acknowledges Room Creation `createGroupACK` - if (role == 'moderator' && info.code == '201') { - if (affiliation === 'owner') { - info.type = 'createGroupACK'; - isCreate = true; - } - // else - // info.type = 'joinPublicGroupSuccess'; - } - } + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; + }); - var x = msginfo.getElementsByTagName('x'); - if (x && x.length > 0) { - // 加群申请 - var apply = x[0].getElementsByTagName('apply'); - // 加群成功 - var accept = x[0].getElementsByTagName('accept'); - // 同意加群后用户进群通知 - var item = x[0].getElementsByTagName('item'); - // 加群被拒绝 - var decline = x[0].getElementsByTagName('decline'); - // 被设为管理员 - var addAdmin = x[0].getElementsByTagName('add_admin'); - // 被取消管理员 - var removeAdmin = x[0].getElementsByTagName('remove_admin'); - // 被禁言 - var addMute = x[0].getElementsByTagName('add_mute'); - // 取消禁言 - var removeMute = x[0].getElementsByTagName('remove_mute'); + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return _.has(obj, 'callee'); + }; + } - if (apply && apply.length > 0) { - isApply = true; - info.toNick = apply[0].getAttribute('toNick'); - info.type = 'joinGroupNotifications'; - var groupJid = apply[0].getAttribute('to'); - var gid = groupJid.split('@')[0].split('_'); - gid = gid[gid.length - 1]; - info.gid = gid; - } else if (accept && accept.length > 0) { - info.type = 'joinPublicGroupSuccess'; - } else if (item && item.length > 0) { - var affiliation = item[0].getAttribute('affiliation'), - role = item[0].getAttribute('role'); - if (affiliation == 'member' - || - role == 'participant') { - isMemberJoin = true; - info.mid = info.fromJid.split('/'); - info.mid = info.mid[info.mid.length - 1]; - info.type = 'memberJoinPublicGroupSuccess'; - var roomtype = msginfo.getElementsByTagName('roomtype'); - if (roomtype && roomtype.length > 0) { - var type = roomtype[0].getAttribute('type'); - if (type == 'chatroom') { - info.type = 'memberJoinChatRoomSuccess'; - } - } - } - } else if (decline && decline.length) { - isDecline = true; - var gid = decline[0].getAttribute("fromNick"); - var owner = _parseNameFromJidFn(decline[0].getAttribute("from")); - info.type = "joinPublicGroupDeclined"; - info.owner = owner; - info.gid = gid; - } else if (addAdmin && addAdmin.length > 0) { - var gid = _parseNameFromJidFn(addAdmin[0].getAttribute('mucjid')); - var owner = _parseNameFromJidFn(addAdmin[0].getAttribute('from')); - info.owner = owner; - info.gid = gid; - info.type = "addAdmin"; - } else if (removeAdmin && removeAdmin.length > 0) { - var gid = _parseNameFromJidFn(removeAdmin[0].getAttribute('mucjid')); - var owner = _parseNameFromJidFn(removeAdmin[0].getAttribute('from')); - info.owner = owner; - info.gid = gid; - info.type = "removeAdmin"; - } else if (addMute && addMute.length > 0) { - var gid = _parseNameFromJidFn(addMute[0].getAttribute('mucjid')); - var owner = _parseNameFromJidFn(addMute[0].getAttribute('from')); - info.owner = owner; - info.gid = gid; - info.type = "addMute"; - } else if (removeMute && removeMute.length > 0) { - var gid = _parseNameFromJidFn(removeMute[0].getAttribute('mucjid')); - var owner = _parseNameFromJidFn(removeMute[0].getAttribute('from')); - info.owner = owner; - info.gid = gid; - info.type = "removeMute"; - } - } + // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, + // IE 11 (#1621), and in Safari 8 (#1929). + if (typeof /./ != 'function' && typeof Int8Array != 'object') { + _.isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; - if (info.chatroom) { - // diff the - info.presence_type = presence_type; - info.original_type = info.type; - var reflectUser = from.slice(from.lastIndexOf('/') + 1); + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj !== +obj; + }; - if (reflectUser === this.context.userId) { - if (info.type === '' && !info.code) { - info.type = 'joinChatRoomSuccess'; - } else if (presence_type === 'unavailable' || info.type === 'unavailable') { - if (!info.status) {// logout successfully. - info.type = 'leaveChatRoom'; - } else if (info.code == 110) {// logout or dismissied by admin. - info.type = 'leaveChatRoom'; - } else if (info.error && info.error.code == 406) {// The chat room is full. - info.type = 'reachChatRoomCapacity'; - } - } - } - } else { - info.presence_type = presence_type; - info.original_type = type; + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + }; - if (/subscribe/.test(info.type)) { - //subscribe | subscribed | unsubscribe | unsubscribed - } else if (type == "" - && - !info.status - && - !info.error - && - !isCreate - && - !isApply - && - !isMemberJoin - && - !isDecline - ) { - console.log(2222222, msginfo, info, isApply); - // info.type = 'joinPublicGroupSuccess'; - } else if (presence_type === 'unavailable' || type === 'unavailable') {// There is no roomtype when a chat room is deleted. - if (info.destroy) {// Group or Chat room Deleted. - info.type = 'deleteGroupChat'; - } else if (info.code == 307 || info.code == 321) {// Dismissed by group. - var nick = msginfo.getAttribute('nick'); - if (!nick) - info.type = 'leaveGroup'; - else - info.type = 'removedFromGroup'; - } - } - } - this.onPresence(info, msginfo); - }; + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; - /** - * @private - */ - connection.prototype.handlePing = function (e) { - if (this.isClosed()) { - return; - } - var id = e.getAttribute('id'); - var from = e.getAttribute('from'); - var to = e.getAttribute('to'); - var dom = $iq({ - from: to - , to: from - , id: id - , type: 'result' - }); - this.sendCommand(dom.tree()); - }; + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; - /** - * @private - */ - connection.prototype.handleIq = function (iq) { - return true; - }; + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + }; - /** - * @private - */ - connection.prototype.handleIqPrivacy = function (msginfo) { - var list = msginfo.getElementsByTagName('list'); - if (list.length == 0) { - return; - } - this.getBlacklist(); - }; + // Utility Functions + // ----------------- - /** - * @private - */ - connection.prototype.handleIqRoster = function (e) { - var id = e.getAttribute('id'); - var from = e.getAttribute('from') || ''; - var name = _parseNameFromJidFn(from); - var curJid = this.context.jid; - var curUser = this.context.userId; + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; - var iqresult = $iq({type: 'result', id: id, from: curJid}); - this.sendCommand(iqresult.tree()); + // Keep the identity function around for default iteratees. + _.identity = function(value) { + return value; + }; - var msgBodies = e.getElementsByTagName('query'); - if (msgBodies && msgBodies.length > 0) { - var queryTag = msgBodies[0]; - var rouster = _parseFriend(queryTag, this, from); - this.onRoster(rouster); - } - return true; - }; + // Predicate-generating functions. Often useful outside of Underscore. + _.constant = function(value) { + return function() { + return value; + }; + }; - /** - * @private - */ - connection.prototype.handleMessage = function (msginfo) { - var self = this; - if (this.isClosed()) { - return; - } + _.noop = function(){}; - var id = msginfo.getAttribute('id') || ''; + _.property = property; + // Generates a function for a given object that returns a given property. + _.propertyOf = function(obj) { + return obj == null ? function(){} : function(key) { + return obj[key]; + }; + }; - // cache ack into sendQueue first , handelSendQueue will do the send thing with the speed of 5/s - this.cacheReceiptsMessage({ - id: id - }); - var parseMsgData = _parseResponseMessage(msginfo); - if (parseMsgData.errorMsg) { - this.handlePresence(msginfo); - return; + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + _.matcher = _.matches = function(attrs) { + attrs = _.extendOwn({}, attrs); + return function(obj) { + return _.isMatch(obj, attrs); + }; + }; + + // Run a function **n** times. + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; } - // send error - var error = msginfo.getElementsByTagName('error'); - var errorCode = ''; - var errorText = ''; - var errorBool = false; - if (error.length > 0) { - errorBool = true; - errorCode = error[0].getAttribute('code'); - var textDOM = error[0].getElementsByTagName('text'); - errorText = textDOM[0].textContent || textDOM[0].text; + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); + }; + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + var unescapeMap = _.invert(escapeMap); + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property, fallback) { + var value = object == null ? void 0 : object[property]; + if (value === void 0) { + value = fallback; } + return _.isFunction(value) ? value.call(object) : value; + }; - var msgDatas = parseMsgData.data; - for (var i in msgDatas) { - if (!msgDatas.hasOwnProperty(i)) { - continue; - } - var msg = msgDatas[i]; - if (!msg.from || !msg.to) { - continue; - } + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; - var from = (msg.from + '').toLowerCase(); - var too = (msg.to + '').toLowerCase(); - var extmsg = msg.ext || {}; - var chattype = ''; - var typeEl = msginfo.getElementsByTagName('roomtype'); - if (typeEl.length) { - chattype = typeEl[0].getAttribute('type') || 'chat'; - } else { - chattype = msginfo.getAttribute('type') || 'chat'; - } + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; - var msgBodies = msg.bodies; - if (!msgBodies || msgBodies.length == 0) { - continue; - } - var msgBody = msg.bodies[0]; - var type = msgBody.type; + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; - try { - switch (type) { - case 'txt': - var receiveMsg = msgBody.msg; - if (self.encrypt.type === 'base64') { - receiveMsg = atob(receiveMsg); - } else if (self.encrypt.type === 'aes') { - var key = CryptoJS.enc.Utf8.parse(self.encrypt.key); - var iv = CryptoJS.enc.Utf8.parse(self.encrypt.iv); - var mode = self.encrypt.mode.toLowerCase(); - var option = {}; - if (mode === 'cbc') { - option = { - iv: iv, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }; - } else if (mode === 'ebc') { - option = { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 - } - } - var encryptedBase64Str = receiveMsg; - var decryptedData = CryptoJS.AES.decrypt(encryptedBase64Str, key, option); - var decryptedStr = decryptedData.toString(CryptoJS.enc.Utf8); - receiveMsg = decryptedStr; - } - var emojibody = _utils.parseTextMessage(receiveMsg, WebIM.Emoji); - if (emojibody.isemoji) { - var msg = { - id: id - , type: chattype - , from: from - , to: too - , delay: parseMsgData.delayTimeStamp - , data: emojibody.body - , ext: extmsg - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onEmojiMessage(msg); - } else { - var msg = { - id: id - , type: chattype - , from: from - , to: too - , delay: parseMsgData.delayTimeStamp - , data: receiveMsg - , ext: extmsg - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onTextMessage(msg); - } - break; - case 'img': - var rwidth = 0; - var rheight = 0; - if (msgBody.size) { - rwidth = msgBody.size.width; - rheight = msgBody.size.height; - } - var msg = { - id: id - , type: chattype - , from: from - , to: too - , - url: (location.protocol != 'https:' && self.isHttpDNS) ? (self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9))) : msgBody.url - , secret: msgBody.secret - , filename: msgBody.filename - , thumb: msgBody.thumb - , thumb_secret: msgBody.thumb_secret - , file_length: msgBody.file_length || '' - , width: rwidth - , height: rheight - , filetype: msgBody.filetype || '' - , accessToken: this.context.accessToken || '' - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onPictureMessage(msg); - break; - case 'audio': - var msg = { - id: id - , type: chattype - , from: from - , to: too - , - url: (location.protocol != 'https:' && self.isHttpDNS) ? (self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9))) : msgBody.url - , secret: msgBody.secret - , filename: msgBody.filename - , length: msgBody.length || '' - , file_length: msgBody.file_length || '' - , filetype: msgBody.filetype || '' - , accessToken: this.context.accessToken || '' - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onAudioMessage(msg); - break; - case 'file': - var msg = { - id: id - , type: chattype - , from: from - , to: too - , - url: (location.protocol != 'https:' && self.isHttpDNS) ? (self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9))) : msgBody.url - , secret: msgBody.secret - , filename: msgBody.filename - , file_length: msgBody.file_length - , accessToken: this.context.accessToken || '' - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onFileMessage(msg); - break; - case 'loc': - var msg = { - id: id - , type: chattype - , from: from - , to: too - , addr: msgBody.addr - , lat: msgBody.lat - , lng: msgBody.lng - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onLocationMessage(msg); - break; - case 'video': - var msg = { - id: id - , type: chattype - , from: from - , to: too - , - url: (location.protocol != 'https:' && self.isHttpDNS) ? (self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9))) : msgBody.url - , secret: msgBody.secret - , filename: msgBody.filename - , file_length: msgBody.file_length - , accessToken: this.context.accessToken || '' - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onVideoMessage(msg); - break; - case 'cmd': - var msg = { - id: id - , from: from - , to: too - , action: msgBody.action - , ext: extmsg - , delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onCmdMessage(msg); - break; - } - ; - if (self.delivery) { - var msgId = self.getUniqueId(); - var bodyId = msg.id; - var deliverMessage = new WebIM.message('delivery', msgId); - deliverMessage.set({ - id: bodyId - , to: msg.from - }); - self.send(deliverMessage.body); - } - } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR - , data: e - }); - } - } - }; + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; - /** - * @private - */ - connection.prototype.handleDeliveredMessage = function (message) { - var id = message.id; - var body = message.getElementsByTagName('body'); - var mid = 0; - if (isNaN(body[0].innerHTML)) - mid = body[1].innerHTML; - else - mid = body[0].innerHTML; - var msg = { - mid: mid - }; - this.onDeliverdMessage(msg); - this.sendReceiptsMessage({ - id: id - }); - }; + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; - /** - * @private - */ - connection.prototype.handleAckedMessage = function (message) { - var id = message.id; - var body = message.getElementsByTagName('body'); - var mid = 0; - if (isNaN(body[0].innerHTML)) - mid = body[1].innerHTML; - else - mid = body[0].innerHTML; - var msg = { - mid: mid - }; - this.onReadMessage(msg); - this.sendReceiptsMessage({ - id: id + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offest. + return match; }); - }; + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; - /** - * @private - */ - connection.prototype.handleReceivedMessage = function (message) { try { - var received = message.getElementsByTagName("received"); - var mid = received[0].getAttribute('mid'); - var body = message.getElementsByTagName("body"); - var id = body[0].innerHTML; - var msg = { - mid: mid, - id: id - }; - this.onReceivedMessage(msg); + var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR - , data: e - }); + e.source = source; + throw e; } - var rcv = message.getElementsByTagName('received'), - id, - mid; - - if (rcv.length > 0) { - if (rcv[0].childNodes && rcv[0].childNodes.length > 0) { - id = rcv[0].childNodes[0].nodeValue; - } else { - id = rcv[0].innerHTML || rcv[0].innerText; - } - mid = rcv[0].getAttribute('mid'); - } + var template = function(data) { + return render.call(this, data, _); + }; - if (_msgHash[id]) { - try { - _msgHash[id].msg.success instanceof Function && _msgHash[id].msg.success(id, mid); - } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR - , data: e - }); - } - delete _msgHash[id]; - } - }; + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; - /** - * @private - */ - connection.prototype.handleInviteMessage = function (message) { - var form = null; - var invitemsg = message.getElementsByTagName('invite'); - var reasonDom = message.getElementsByTagName('reason')[0]; - var reasonMsg = reasonDom.textContent; - var id = message.getAttribute('id') || ''; - this.sendReceiptsMessage({ - id: id - }); + return template; + }; - if (invitemsg && invitemsg.length > 0) { - var fromJid = invitemsg[0].getAttribute('from'); - form = _parseNameFromJidFn(fromJid); - } - var xmsg = message.getElementsByTagName('x'); - var roomid = null; - if (xmsg && xmsg.length > 0) { - for (var i = 0; i < xmsg.length; i++) { - if ('jabber:x:conference' === xmsg[i].namespaceURI) { - var roomjid = xmsg[i].getAttribute('jid'); - roomid = _parseNameFromJidFn(roomjid); - } - } - } - this.onInviteMessage({ - type: 'invite', - from: form, - roomid: roomid, - reason: reasonMsg - }); - }; + // Add a "chain" function. Start chaining a wrapped Underscore object. + _.chain = function(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + }; - /** - * @private - */ - connection.prototype.handleMutedMessage = function (message) { - var id = message.id; - this.onMutedMessage({ - mid: id + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(instance, obj) { + return instance._chain ? _(obj).chain() : obj; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result(this, func.apply(_, args)); + }; }); - }; + }; - /** - * @private - */ - connection.prototype.sendCommand = function (dom, id) { - if (this.isOpened()) { - this.context.stropheConn.send(dom); - } else { - this.unSendMsgArr.push(dom); - if (!this.offLineSendConnecting && !this.logOut) { - this.offLineSendConnecting = true; - this.reconnect(); - } - this.onError({ - type: _code.WEBIM_CONNCTION_DISCONNECTED, - reconnect: true - }); - } - }; + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); - /** - * gen uuid with customized prefix - * @param {String} prefix - * @returns {string} - */ - connection.prototype.getUniqueId = function (prefix) { - // fix: too frequently msg sending will make same id - if (this.autoIncrement) { - this.autoIncrement++ - } else { - this.autoIncrement = 1 - } - var cdate = new Date(); - var offdate = new Date(2010, 1, 1); - var offset = cdate.getTime() - offdate.getTime(); - var hexd = parseFloat(offset).toString(16) + this.autoIncrement; + // Add all mutator Array functions to the wrapper. + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + return result(this, obj); + }; + }); - if (typeof prefix === 'string' || typeof prefix === 'number') { - return prefix + '_' + hexd; - } else { - return 'WEBIM_' + hexd; - } - }; + // Add all accessor Array functions to the wrapper. + _.each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result(this, method.apply(this._wrapped, arguments)); + }; + }); - /** - * send message - * @param {Object} messageSource - */ - connection.prototype.send = function (messageSource) { - var self = this; - var message = messageSource; - if (message.type === 'txt') { - if (this.encrypt.type === 'base64') { - message = _.clone(messageSource); - message.msg = btoa(message.msg); - } else if (this.encrypt.type === 'aes') { - message = _.clone(messageSource); - var key = CryptoJS.enc.Utf8.parse(this.encrypt.key); - var iv = CryptoJS.enc.Utf8.parse(this.encrypt.iv); - var mode = this.encrypt.mode.toLowerCase(); - var option = {}; - if (mode === 'cbc') { - option = { - iv: iv, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }; - } else if (mode === 'ebc') { - option = { - mode: CryptoJS.mode.ECB, - padding: CryptoJS.pad.Pkcs7 - } - } - var encryptedData = CryptoJS.AES.encrypt(message.msg, key, option); + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; - message.msg = encryptedData.toString(); - } - } - if (this.isWindowSDK) { - WebIM.doQuery('{"type":"sendMessage","to":"' + message.to + '","message_type":"' + message.type + '","msg":"' + encodeURI(message.msg) + '","chatType":"' + message.chatType + '"}', - function (response) { - }, - function (code, msg) { - var message = { - data: { - data: "send" - }, - type: _code.WEBIM_MESSAGE_SED_ERROR - }; - self.onError(message); - }); - } else { - if (Object.prototype.toString.call(message) === '[object Object]') { - var appKey = this.context.appKey || ''; - var toJid = appKey + '_' + message.to + '@' + this.domain; + // Provide unwrapping proxy for some methods used in engine operations + // such as arithmetic and JSON stringification. + _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - if (message.group) { - toJid = appKey + '_' + message.to + '@conference.' + this.domain; - } - if (message.resource) { - toJid = toJid + '/' + message.resource; - } + _.prototype.toString = function() { + return '' + this._wrapped; + }; - message.toJid = toJid; - message.id = message.id || this.getUniqueId(); - _msgHash[message.id] = new _message(message); - _msgHash[message.id].send(this); - } else if (typeof message === 'string') { - _msgHash[message] && _msgHash[message].send(this); - } - } - }; + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { + return _; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + }.call(this)); - /** - * 添加联系人 - * @param {Object} options - * @deprecated - */ - connection.prototype.addRoster = function (options) { - var jid = _getJid(options, this); - var name = options.name || ''; - var groups = options.groups || ''; - var iq = $iq({type: 'set'}); - iq.c('query', {xmlns: 'jabber:iq:roster'}); - iq.c('item', {jid: jid, name: name}); +/***/ }, - if (groups) { - for (var i = 0; i < groups.length; i++) { - iq.c('group').t(groups[i]).up(); - } - } - var suc = options.success || _utils.emptyfn; - var error = options.error || _utils.emptyfn; - this.context.stropheConn.sendIQ(iq.tree(), suc, error); - }; +/***/ 206: +/***/ function(module, exports, __webpack_require__) { - /** - * 删除联系人 - * @param {Object} options - */ - connection.prototype.removeRoster = function (options) { - var jid = _getJid(options, this); - var iq = $iq({type: 'set'}).c('query', {xmlns: 'jabber:iq:roster'}).c('item', { - jid: jid, - subscription: 'remove' - }); + 'use strict'; - var suc = options.success || _utils.emptyfn; - var error = options.error || _utils.emptyfn; - this.context.stropheConn.sendIQ(iq, suc, error); - }; + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - /** - * 获取联系人 - * @param {Object} options - */ - connection.prototype.getRoster = function (options) { - var conn = this; - var dom = $iq({ - type: 'get' - }).c('query', {xmlns: 'jabber:iq:roster'}); + ; + (function () { - var options = options || {}; - var suc = options.success || this.onRoster; - var completeFn = function (ele) { - var rouster = []; - var msgBodies = ele.getElementsByTagName('query'); - if (msgBodies && msgBodies.length > 0) { - var queryTag = msgBodies[0]; - rouster = _parseFriend(queryTag); + var EMPTYFN = function EMPTYFN() {}; + var _code = __webpack_require__(207).code; + var WEBIM_FILESIZE_LIMIT = 10485760; + + var _createStandardXHR = function _createStandardXHR() { + try { + return new window.XMLHttpRequest(); + } catch (e) { + return false; } - suc(rouster, ele); }; - var error = options.error || this.onError; - var failFn = function (ele) { - error({ - type: _code.WEBIM_CONNCTION_GETROSTER_ERROR - , data: ele - }); - }; - if (this.isOpened()) { - this.context.stropheConn.sendIQ(dom.tree(), completeFn, failFn); - } else { - error({ - type: _code.WEBIM_CONNCTION_DISCONNECTED - }); - } - }; - /** - * 订阅 - * @param {Object} options - */ - connection.prototype.subscribe = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'subscribe'}); - if (options.message) { - pres.c('status').t(options.message).up(); - } - if (options.nick) { - pres.c('nick', {'xmlns': 'http://jabber.org/protocol/nick'}).t(options.nick); - } - this.sendCommand(pres.tree()); - }; + var _createActiveXHR = function _createActiveXHR() { + try { + return new window.ActiveXObject('Microsoft.XMLHTTP'); + } catch (e) { + return false; + } + }; - /** - * 订阅成功 - * @param {Object} options - */ - connection.prototype.subscribed = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'subscribed'}); + var _xmlrequest = function _xmlrequest(crossDomain) { + crossDomain = crossDomain || true; + var temp = _createStandardXHR() || _createActiveXHR(); - if (options.message) { - pres.c('status').t(options.message).up(); - } - this.sendCommand(pres.tree()); - }; + if ('withCredentials' in temp) { + return temp; + } + if (!crossDomain) { + return temp; + } + if (typeof window.XDomainRequest === 'undefined') { + return temp; + } + var xhr = new XDomainRequest(); + xhr.readyState = 0; + xhr.status = 100; + xhr.onreadystatechange = EMPTYFN; + xhr.onload = function () { + xhr.readyState = 4; + xhr.status = 200; - /** - * 取消订阅成功 - * @param {Object} options - * @deprecated - */ - connection.prototype.unsubscribe = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'unsubscribe'}); + var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); + xmlDoc.async = 'false'; + xmlDoc.loadXML(xhr.responseText); + xhr.responseXML = xmlDoc; + xhr.response = xhr.responseText; + xhr.onreadystatechange(); + }; + xhr.ontimeout = xhr.onerror = function () { + xhr.readyState = 4; + xhr.status = 500; + xhr.onreadystatechange(); + }; + return xhr; + }; - if (options.message) { - pres.c('status').t(options.message); - } - this.sendCommand(pres.tree()); - }; + var _hasFlash = function () { + if ('ActiveXObject' in window) { + try { + return new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); + } catch (ex) { + return 0; + } + } else { + if (navigator.plugins && navigator.plugins.length > 0) { + return navigator.plugins['Shockwave Flash']; + } + } + return 0; + }(); - /** - * 取消订阅成功 - * @param {Object} options - */ - connection.prototype.unsubscribed = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'unsubscribed'}); + var _tmpUtilXHR = _xmlrequest(), + _hasFormData = typeof FormData !== 'undefined', + _hasBlob = typeof Blob !== 'undefined', + _isCanSetRequestHeader = _tmpUtilXHR.setRequestHeader || false, + _hasOverrideMimeType = _tmpUtilXHR.overrideMimeType || false, + _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData, + _isCanUploadFile = _isCanUploadFileAsync || _hasFlash, + _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType); - if (options.message) { - pres.c('status').t(options.message).up(); + if (!Object.keys) { + Object.keys = function () { + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'), + dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && (typeof obj !== 'function' || obj === null)) { + throw new TypeError('Object.keys called on non-object'); + } + + var result = [], + prop, + i; + + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } + } + + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } + } + } + return result; + }; + }(); } - this.sendCommand(pres.tree()); - }; - /** - * 加入公开群组 - * @param {Object} options - * @deprecated - */ - connection.prototype.joinPublicGroup = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_JOINROOM_ERROR, - data: ele - }); - }; - var iq = $pres({ - from: this.context.jid, - to: room_nick - }) - .c('x', {xmlns: Strophe.NS.MUC}); + var utils = { + hasFormData: _hasFormData, - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; + hasBlob: _hasBlob, - /** - * 获取聊天室列表 - * @param {Object} options - * @deprecated - */ - connection.prototype.listRooms = function (options) { - var iq = $iq({ - to: options.server || 'conference.' + this.domain, - from: this.context.jid, - type: 'get' - }) - .c('query', {xmlns: Strophe.NS.DISCO_ITEMS}); + emptyfn: EMPTYFN, - var suc = options.success || _utils.emptyfn; - var error = options.error || this.onError; - var completeFn = function (result) { - var rooms = []; - rooms = _parseRoom(result); - try { - suc(rooms); - } catch (e) { - error({ - type: _code.WEBIM_CONNCTION_GETROOM_ERROR, - data: e - }); - } - }; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOM_ERROR - , data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; + isCanSetRequestHeader: _isCanSetRequestHeader, - /** - * 获取聊天室成员列表 - * @param {Object} options - */ - connection.prototype.queryRoomMember = function (options) { - var domain = this.domain; - var members = []; - var iq = $iq({ - to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain - , type: 'get' - }) - .c('query', {xmlns: Strophe.NS.MUC + '#admin'}) - .c('item', {affiliation: 'member'}); + hasOverrideMimeType: _hasOverrideMimeType, - var suc = options.success || _utils.emptyfn; - var completeFn = function (result) { - var items = result.getElementsByTagName('item'); + isCanUploadFileAsync: _isCanUploadFileAsync, - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var mem = { - jid: item.getAttribute('jid') - , affiliation: 'member' - }; - members.push(mem); + isCanUploadFile: _isCanUploadFile, + + isCanDownLoadFile: _isCanDownLoadFile, + + isSupportWss: function () { + var notSupportList = [ + //1: QQ browser X5 core + /MQQBrowser[\/]5([.]\d+)?\sTBS/ + + //2: etc. + //... + ]; + + if (!window.WebSocket) { + return false; } - } - suc(members); - }; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR - , data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; - /** - * 获取聊天室信息 - * @param {Object} options - */ - connection.prototype.queryRoomInfo = function (options) { - var domain = this.domain; - var iq = $iq({ - to: this.context.appKey + '_' + options.roomId + '@conference.' + domain, - type: 'get' - }).c('query', {xmlns: Strophe.NS.DISCO_INFO}); + var ua = window.navigator.userAgent; + for (var i = 0, l = notSupportList.length; i < l; i++) { + if (notSupportList[i].test(ua)) { + return false; + } + } + return true; + }(), - var suc = options.success || _utils.emptyfn; - var members = []; + getIEVersion: function () { + var ua = navigator.userAgent, + matches, + tridentMap = { '4': 8, '5': 9, '6': 10, '7': 11 }; - var completeFn = function (result) { - var settings = ''; - var features = result.getElementsByTagName('feature'); - if (features) { - settings = features[1].getAttribute('var') + '|' + features[3].getAttribute('var') + '|' + features[4].getAttribute('var'); - } - switch (settings) { - case 'muc_public|muc_membersonly|muc_notallowinvites': - settings = 'PUBLIC_JOIN_APPROVAL'; - break; - case 'muc_public|muc_open|muc_notallowinvites': - settings = 'PUBLIC_JOIN_OPEN'; - break; - case 'muc_hidden|muc_membersonly|muc_allowinvites': - settings = 'PRIVATE_MEMBER_INVITE'; - break; - case 'muc_hidden|muc_membersonly|muc_notallowinvites': - settings = 'PRIVATE_OWNER_INVITE'; - break; - } - var owner = ''; - var fields = result.getElementsByTagName('field'); - var fieldValues = {}; - if (fields) { - for (var i = 0; i < fields.length; i++) { - var field = fields[i]; - var fieldVar = field.getAttribute('var'); - var fieldSimplify = fieldVar.split('_')[1]; - switch (fieldVar) { - case 'muc#roominfo_occupants': - case 'muc#roominfo_maxusers': - case 'muc#roominfo_affiliations': - case 'muc#roominfo_description': - fieldValues[fieldSimplify] = (field.textContent || field.text || ''); - break; - case 'muc#roominfo_owner': - var mem = { - jid: (field.textContent || field.text) + '@' + domain - , affiliation: 'owner' - }; - members.push(mem); - fieldValues[fieldSimplify] = (field.textContent || field.text); - break; - } + matches = ua.match(/MSIE (\d+)/i); - // if (field.getAttribute('label') === 'owner') { - // var mem = { - // jid: (field.textContent || field.text) + '@' + domain - // , affiliation: 'owner' - // }; - // members.push(mem); - // break; - // } + if (matches && matches[1]) { + return +matches[1]; } - fieldValues['name'] = (result.getElementsByTagName('identity')[0]).getAttribute('name'); - } - suc(settings, members, fieldValues); - }; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMINFO_ERROR - , data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; + matches = ua.match(/Trident\/(\d+)/i); + if (matches && matches[1]) { + return tridentMap[matches[1]] || null; + } + return null; + }(), - /** - * 获取聊天室管理员 - * @param {Object} options - * @deprecated - */ - connection.prototype.queryRoomOccupants = function (options) { - var suc = options.success || _utils.emptyfn; - var completeFn = function (result) { - var occupants = []; - occupants = _parseRoomOccupants(result); - suc(occupants); - } - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR - , data: ele - }); - }; - var attrs = { - xmlns: Strophe.NS.DISCO_ITEMS - }; - var info = $iq({ - from: this.context.jid - , to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain - , type: 'get' - }).c('query', attrs); - this.context.stropheConn.sendIQ(info.tree(), completeFn, errorFn); - }; + stringify: function stringify(json) { + if (typeof JSON !== 'undefined' && JSON.stringify) { + return JSON.stringify(json); + } else { + var s = '', + arr = []; - /** - * - * @deprecated - * @private - */ - connection.prototype.setUserSig = function (desc) { - var dom = $pres({xmlns: 'jabber:client'}); - desc = desc || ''; - dom.c('status').t(desc); - this.sendCommand(dom.tree()); - }; + var iterate = function iterate(json) { + var isArr = false; - /** - * - * @private - */ - connection.prototype.setPresence = function (type, status) { - var dom = $pres({xmlns: 'jabber:client'}); - if (type) { - if (status) { - dom.c('show').t(type); - dom.up().c('status').t(status); - } else { - dom.c('show').t(type); - } - } - this.sendCommand(dom.tree()); - }; + if (Object.prototype.toString.call(json) === '[object Array]') { + arr.push(']', '['); + isArr = true; + } else if (Object.prototype.toString.call(json) === '[object Object]') { + arr.push('}', '{'); + } - /** - * @private - * - */ - connection.prototype.getPresence = function () { - var dom = $pres({xmlns: 'jabber:client'}); - var conn = this; - this.sendCommand(dom.tree()); - }; + for (var o in json) { + if (Object.prototype.toString.call(json[o]) === '[object Null]') { + json[o] = 'null'; + } else if (Object.prototype.toString.call(json[o]) === '[object Undefined]') { + json[o] = 'undefined'; + } - /** - * @private - * - */ - connection.prototype.ping = function (options) { - var options = options || {}; - var jid = _getJid(options, this); + if (json[o] && _typeof(json[o]) === 'object') { + s += ',' + (isArr ? '' : '"' + o + '":' + (isArr ? '"' : '')) + iterate(json[o]) + ''; + } else { + s += ',"' + (isArr ? '' : o + '":"') + json[o] + '"'; + } + } - var dom = $iq({ - from: this.context.jid || '' - , to: jid - , type: 'get' - }).c('ping', {xmlns: 'urn:xmpp:ping'}); + if (s != '') { + s = s.slice(1); + } - var suc = options.success || _utils.emptyfn; - var error = options.error || this.onError; - var failFn = function (ele) { - error({ - type: _code.WEBIM_CONNCTION_PING_ERROR - , data: ele - }); - }; - if (this.isOpened()) { - this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); - } else { - error({ - type: _code.WEBIM_CONNCTION_DISCONNECTED - }); - } - return; - }; + return arr.pop() + s + arr.pop(); + }; + return iterate(json); + } + }, + login: function login(options) { + var options = options || {}; + var suc = options.success || EMPTYFN; + var err = options.error || EMPTYFN; - /** - * @private - * - */ - connection.prototype.isOpened = function () { - return this.context.status == _code.STATUS_OPENED; - }; + var appKey = options.appKey || ''; + var devInfos = appKey.split('#'); + if (devInfos.length !== 2) { + err({ + type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR + }); + return false; + } - /** - * @private - * - */ - connection.prototype.isOpening = function () { - var status = this.context.status; - return status == _code.STATUS_DOLOGIN_USERGRID || status == _code.STATUS_DOLOGIN_IM; - }; + var orgName = devInfos[0]; + var appName = devInfos[1]; + var https = https || options.https; + var user = options.user || ''; + var pwd = options.pwd || ''; - /** - * @private - * - */ - connection.prototype.isClosing = function () { - return this.context.status == _code.STATUS_CLOSING; - }; + var apiUrl = options.apiUrl; - /** - * @private - * - */ - connection.prototype.isClosed = function () { - return this.context.status == _code.STATUS_CLOSED; - }; + var loginJson = { + grant_type: 'password', + username: user, + password: pwd, + timestamp: +new Date() + }; + var loginfo = utils.stringify(loginJson); - /** - * @private - * - */ - connection.prototype.clear = function () { - var key = this.context.appKey; - if (this.errorType != _code.WEBIM_CONNCTION_DISCONNECTED) { - if (this.logOut) { - this.unSendMsgArr = []; - this.offLineSendConnecting = false; - this.context = { - status: _code.STATUS_INIT, - appKey: key + var options = { + url: apiUrl + '/' + orgName + '/' + appName + '/token', + dataType: 'json', + data: loginfo, + success: suc, + error: err }; - } - } - if (this.intervalId) { - clearInterval(this.intervalId); - } - this.restIndex = 0; - this.xmppIndex = 0; + return utils.ajax(options); + }, - if (this.errorType == _code.WEBIM_CONNCTION_CLIENT_LOGOUT || this.errorType == -1) { - var message = { - data: { - data: "logout" - }, - type: _code.WEBIM_CONNCTION_CLIENT_LOGOUT - }; - this.onError(message); - } - }; + getFileUrl: function getFileUrl(fileInputId) { + var uri = { + url: '', + filename: '', + filetype: '', + data: '' + }; - /** - * 获取聊天室列表 - * @param {Object} options - */ - connection.prototype.getChatRooms = function (options) { - - var conn = this, - token = options.accessToken || this.context.accessToken; + var fileObj = typeof fileInputId === 'string' ? document.getElementById(fileInputId) : fileInputId; - if (!_utils.isCanSetRequestHeader) { - conn.onError({ - type: _code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR - }); - return; - } + if (!utils.isCanUploadFileAsync || !fileObj) { + return uri; + } + try { + if (window.URL.createObjectURL) { + var fileItems = fileObj.files; + if (fileItems.length > 0) { + var u = fileItems.item(0); + uri.data = u; + uri.url = window.URL.createObjectURL(u); + uri.filename = u.name || ''; + } + } else { + // IE + var u = document.getElementById(fileInputId).value; + uri.url = u; + var pos1 = u.lastIndexOf('/'); + var pos2 = u.lastIndexOf('\\'); + var pos = Math.max(pos1, pos2); + if (pos < 0) uri.filename = u;else uri.filename = u.substring(pos + 1); + } + var index = uri.filename.lastIndexOf('.'); + if (index != -1) { + uri.filetype = uri.filename.substring(index + 1).toLowerCase(); + } + return uri; + } catch (e) { + throw e; + } + }, - if (token) { - var apiUrl = options.apiUrl; - var appName = this.context.appName; - var orgName = this.context.orgName; + getFileSize: function getFileSize(file) { + var fileSize = this.getFileLength(file); + if (fileSize > 10000000) { + return false; + } + var kb = Math.round(fileSize / 1000); + if (kb < 1000) { + fileSize = kb + ' KB'; + } else if (kb >= 1000) { + var mb = kb / 1000; + if (mb < 1000) { + fileSize = mb.toFixed(1) + ' MB'; + } else { + var gb = mb / 1000; + fileSize = gb.toFixed(1) + ' GB'; + } + } + return fileSize; + }, - if (!appName || !orgName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_AUTH_ERROR - }); - return; - } + getFileLength: function getFileLength(file) { + var fileLength = 0; + if (file) { + if (file.files) { + if (file.files.length > 0) { + fileLength = file.files[0].size; + } + } else if (file.select && 'ActiveXObject' in window) { + file.select(); + var fileobject = new ActiveXObject('Scripting.FileSystemObject'); + var file = fileobject.GetFile(file.value); + fileLength = file.Size; + } + } + return fileLength; + }, - var suc = function (data, xhr) { - typeof options.success === 'function' && options.success(data); - }; + hasFlash: _hasFlash, - var error = function (res, xhr, msg) { - if (res.error && res.error_description) { - conn.onError({ - type: _code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR, - msg: res.error_description, - data: res, - xhr: xhr - }); - } - }; + trim: function trim(str) { - var pageInfo = { - pagenum: parseInt(options.pagenum) || 1, - pagesize: parseInt(options.pagesize) || 20 - }; + str = typeof str === 'string' ? str : ''; - var opts = { - url: apiUrl + '/' + orgName + '/' + appName + '/chatrooms', - dataType: 'json', - type: 'GET', - headers: {'Authorization': 'Bearer ' + token}, - data: pageInfo, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn - }; - _utils.ajax(opts); - } else { - conn.onError({ - type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR - }); - } + return str.trim ? str.trim() : str.replace(/^\s|\s$/g, ''); + }, - }; + parseEmoji: function parseEmoji(msg) { + if (typeof WebIM.Emoji === 'undefined' || typeof WebIM.Emoji.map === 'undefined') { + return msg; + } else { + var emoji = WebIM.Emoji, + reg = null; - /** - * 加入聊天室 - * @param {Object} options - */ - connection.prototype.joinChatRoom = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_JOINCHATROOM_ERROR - , data: ele - }); - }; + for (var face in emoji.map) { + if (emoji.map.hasOwnProperty(face)) { + while (msg.indexOf(face) > -1) { + msg = msg.replace(face, ''); + } + } + } + return msg; + } + }, - var iq = $pres({ - from: this.context.jid, - to: room_nick - }) - .c('x', {xmlns: Strophe.NS.MUC + '#user'}) - .c('item', {affiliation: 'member', role: 'participant'}) - .up().up() - .c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); + parseLink: function parseLink(msg) { - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; + var reg = /(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-/=]*/gm; - /** - * 退出聊天室 - * @param {Object} options - */ - connection.prototype.quitChatRoom = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function (ele) { - err({ - type: _code.WEBIM_CONNCTION_QUITCHATROOM_ERROR - , data: ele - }); - }; - var iq = $pres({ - from: this.context.jid, - to: room_nick, - type: 'unavailable' - }) - .c('x', {xmlns: Strophe.NS.MUC + '#user'}) - .c('item', {affiliation: 'none', role: 'none'}) - .up().up() - .c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); + msg = msg.replace(reg, function (v) { - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; + var prefix = /^https?/gm.test(v); - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveInviteFromGroup = function (info) { - info = eval('(' + info + ')'); - var self = this; - var options = { - title: "Group invitation", - msg: info.user + " invites you to join into group:" + info.group_id, - agree: function agree() { - WebIM.doQuery('{"type":"acceptInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "acceptInvitationFromGroup error:" + msg - }, - type: _code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP - }; - self.onError(message); + return "" + v + ""; }); + + return msg; }, - reject: function reject() { - WebIM.doQuery('{"type":"declineInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "declineInvitationFromGroup error:" + msg - }, - type: _code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP - }; - self.onError(message); - }); - } - }; - this.onConfirmPop(options); - }; + parseJSON: function parseJSON(data) { - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveInviteAcceptionFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation response", - msg: info.user + " agreed to join into group:" + info.group_id, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data + ''); + } - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveInviteDeclineFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation response", - msg: info.user + " rejected to join into group:" + info.group_id, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; + var requireNonComma, + depth = null, + str = utils.trim(data + ''); - /** - * for windowSDK - * @private - * - */ - connection.prototype._onAutoAcceptInvitationFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation", - msg: "You had joined into the group:" + info.group_name + " automatically.Inviter:" + info.user, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - - /** - * for windowSDK - * @private - * - */ - connection.prototype._onLeaveGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You have been out of the group:" + info.group_id + ".Reason:" + info.msg, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveJoinGroupApplication = function (info) { - info = eval('(' + info + ')'); - var self = this; - var options = { - title: "Group join application", - msg: info.user + " applys to join into group:" + info.group_id, - agree: function agree() { - WebIM.doQuery('{"type":"acceptJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "acceptJoinGroupApplication error:" + msg - }, - type: _code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP - }; - self.onError(message); - }); - }, - reject: function reject() { - WebIM.doQuery('{"type":"declineJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "declineJoinGroupApplication error:" + msg - }, - type: _code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP - }; - self.onError(message); - }); - } - }; - this.onConfirmPop(options); - }; - - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveAcceptionFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You had joined into the group:" + info.group_name + ".", - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; + return str && !utils.trim(str.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g, function (token, comma, open, close) { - /** - * for windowSDK - * @private - * - */ - connection.prototype._onReceiveRejectionFromGroup = function () { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You have been rejected to join into the group:" + info.group_name + ".", - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; + if (requireNonComma && comma) { + depth = 0; + } - /** - * for windowSDK - * @private - * - */ - connection.prototype._onUpdateMyGroupList = function (options) { - this.onUpdateMyGroupList(options); - }; + if (depth === 0) { + return token; + } - /** - * for windowSDK - * @private - * - */ - connection.prototype._onUpdateMyRoster = function (options) { - this.onUpdateMyRoster(options); - }; + requireNonComma = open || comma; + depth += !close - !open; + return ''; + })) ? Function('return ' + str)() : Function('Invalid JSON: ' + data)(); + }, - /** - * @private - * - */ - connection.prototype.reconnect = function () { - var that = this; - setTimeout(function () { - _login(that.context.restTokenData, that); - }, (this.autoReconnectNumTotal == 0 ? 0 : this.autoReconnectInterval) * 1000); - this.autoReconnectNumTotal++; - }; + parseUploadResponse: function parseUploadResponse(response) { + return response.indexOf('callback') > -1 ? //lte ie9 + response.slice(9, -1) : response; + }, - /** - * - * @private - * @deprecated - */ - connection.prototype.closed = function () { - var message = { - data: { - data: "Closed error" + parseDownloadResponse: function parseDownloadResponse(response) { + return response && response.type && response.type === 'application/json' || 0 > Object.prototype.toString.call(response).indexOf('Blob') ? this.url + '?token=' : window.URL.createObjectURL(response); }, - type: _code.WEBIM_CONNECTION_CLOSED - }; - this.onError(message); - }; - /** - * used for blacklist - * @private - * - */ - function _parsePrivacy(iq) { - var list = []; - var items = iq.getElementsByTagName('item'); + uploadFile: function uploadFile(options) { + var options = options || {}; + options.onFileUploadProgress = options.onFileUploadProgress || EMPTYFN; + options.onFileUploadComplete = options.onFileUploadComplete || EMPTYFN; + options.onFileUploadError = options.onFileUploadError || EMPTYFN; + options.onFileUploadCanceled = options.onFileUploadCanceled || EMPTYFN; - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('value'); - var order = item.getAttribute('order'); - var type = item.getAttribute('type'); - if (!jid) { - continue; + var acc = options.accessToken || this.context.accessToken; + if (!acc) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_NO_LOGIN, + id: options.id + }); + return; } - var n = _parseNameFromJidFn(jid); - list[n] = { - type: type, - order: order, - jid: jid, - name: n - }; - } - } - return list; - }; - - /** - * 获取好友黑名单 - * @param {Object} options - * - */ - connection.prototype.getBlacklist = function (options) { - options = (options || {}); - var iq = $iq({type: 'get'}); - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var me = this; - iq.c('query', {xmlns: 'jabber:iq:privacy'}) - .c('list', {name: 'special'}); - - this.context.stropheConn.sendIQ(iq.tree(), function (iq) { - me.onBlacklistUpdate(_parsePrivacy(iq)); - sucFn(); - }, function () { - me.onBlacklistUpdate([]); - errFn(); - }); - }; - - /** - * 加入好友黑名单 - * @param {Object} options - * - */ - connection.prototype.addToBlackList = function (options) { - var iq = $iq({type: 'set'}); - var blacklist = options.list || {}; - var type = options.type || 'jid'; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var piece = iq.c('query', {xmlns: 'jabber:iq:privacy'}) - .c('list', {name: 'special'}); + var orgName, appName, devInfos; + var appKey = options.appKey || this.context.appKey || ''; - var keys = Object.keys(blacklist); - var len = keys.length; - var order = 2; + if (appKey) { + devInfos = appKey.split('#'); + orgName = devInfos[0]; + appName = devInfos[1]; + } - for (var i = 0; i < len; i++) { - var item = blacklist[keys[i]]; - var type = item.type || 'jid'; - var jid = item.jid; + if (!orgName && !appName) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + id: options.id + }); + return; + } - piece = piece.c('item', {action: 'deny', order: order++, type: type, value: jid}) - .c('message'); - if (i !== len - 1) { - piece = piece.up().up(); - } - } + var apiUrl = options.apiUrl; + var uploadUrl = apiUrl + '/' + orgName + '/' + appName + '/chatfiles'; - // console.log('addToBlackList', blacklist, piece.tree()); - this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); - }; + if (!utils.isCanUploadFileAsync) { + if (utils.hasFlash && typeof options.flashUpload === 'function') { + options.flashUpload && options.flashUpload(uploadUrl, options); + } else { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_BROWSER_ERROR, + id: options.id + }); + } + return; + } - /** - * 从好友黑名单删除 - * @param {Object} options - * - */ - connection.prototype.removeFromBlackList = function (options) { + var fileSize = options.file.data ? options.file.data.size : undefined; + if (fileSize > WEBIM_FILESIZE_LIMIT) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + id: options.id + }); + return; + } else if (fileSize <= 0) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + id: options.id + }); + return; + } - var iq = $iq({type: 'set'}); - var blacklist = options.list || {}; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var piece = iq.c('query', {xmlns: 'jabber:iq:privacy'}) - .c('list', {name: 'special'}); - - var keys = Object.keys(blacklist); - var len = keys.length; - - for (var i = 0; i < len; i++) { - var item = blacklist[keys[i]]; - var type = item.type || 'jid'; - var jid = item.jid; - var order = item.order; + var xhr = utils.xmlrequest(); + var onError = function onError(e) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + id: options.id, + xhr: xhr + }); + }; + if (xhr.upload) { + xhr.upload.addEventListener('progress', options.onFileUploadProgress, false); + } + if (xhr.addEventListener) { + xhr.addEventListener('abort', options.onFileUploadCanceled, false); + xhr.addEventListener('load', function (e) { + try { + var json = utils.parseJSON(xhr.responseText); + try { + options.onFileUploadComplete(json); + } catch (e) { + options.onFileUploadError({ + type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, + data: e + }); + } + } catch (e) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + data: xhr.responseText, + id: options.id, + xhr: xhr + }); + } + }, false); + xhr.addEventListener('error', onError, false); + } else if (xhr.onreadystatechange) { + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (ajax.status === 200) { + try { + var json = utils.parseJSON(xhr.responseText); + options.onFileUploadComplete(json); + } catch (e) { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + data: xhr.responseText, + id: options.id, + xhr: xhr + }); + } + } else { + options.onFileUploadError({ + type: _code.WEBIM_UPLOADFILE_ERROR, + data: xhr.responseText, + id: options.id, + xhr: xhr + }); + } + } else { + xhr.abort(); + options.onFileUploadCanceled(); + } + }; + } - piece = piece.c('item', {action: 'deny', order: order, type: type, value: jid}) - .c('message'); - if (i !== len - 1) { - piece = piece.up().up(); - } - } + xhr.open('POST', uploadUrl); - // console.log('removeFromBlackList', blacklist, piece.tree()); - this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); - }; + xhr.setRequestHeader('restrict-access', 'true'); + xhr.setRequestHeader('Accept', '*/*'); // Android QQ browser has some problem with this attribute. + xhr.setRequestHeader('Authorization', 'Bearer ' + acc); - /** - * - * @private - */ - connection.prototype._getGroupJid = function (to) { - var appKey = this.context.appKey || ''; - return appKey + '_' + to + '@conference.' + this.domain; - }; + var formData = new FormData(); + formData.append('file', options.file.data); + // fix: ie8 status error + window.XDomainRequest && (xhr.readyState = 2); + xhr.send(formData); + }, - /** - * 加入群组黑名单 - * @param {Object} options - * - */ - connection.prototype.addToGroupBlackList = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var jid = _getJid(options, this); - var affiliation = 'admin';//options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); + download: function download(options) { + options.onFileDownloadComplete = options.onFileDownloadComplete || EMPTYFN; + options.onFileDownloadError = options.onFileDownloadError || EMPTYFN; - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('item', { - affiliation: 'outcast', - jid: jid - }); + var accessToken = options.accessToken || this.context.accessToken; + if (!accessToken) { + options.onFileDownloadError({ + type: _code.WEBIM_DOWNLOADFILE_NO_LOGIN, + id: options.id + }); + return; + } - this.context.stropheConn.sendIQ(iq.tree(), sucFn, errFn); - }; + var onError = function onError(e) { + options.onFileDownloadError({ + type: _code.WEBIM_DOWNLOADFILE_ERROR, + id: options.id, + xhr: xhr + }); + }; - /** - * - * @private - */ - function _parseGroupBlacklist(iq) { - var list = {}; - var items = iq.getElementsByTagName('item'); + if (!utils.isCanDownLoadFile) { + options.onFileDownloadComplete(); + return; + } + var xhr = utils.xmlrequest(); + if ('addEventListener' in xhr) { + xhr.addEventListener('load', function (e) { + options.onFileDownloadComplete(xhr.response, xhr); + }, false); + xhr.addEventListener('error', onError, false); + } else if ('onreadystatechange' in xhr) { + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (ajax.status === 200) { + options.onFileDownloadComplete(xhr.response, xhr); + } else { + options.onFileDownloadError({ + type: _code.WEBIM_DOWNLOADFILE_ERROR, + id: options.id, + xhr: xhr + }); + } + } else { + xhr.abort(); + options.onFileDownloadError({ + type: _code.WEBIM_DOWNLOADFILE_ERROR, + id: options.id, + xhr: xhr + }); + } + }; + } - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('jid'); - var affiliation = item.getAttribute('affiliation'); - var nick = item.getAttribute('nick'); - if (!jid) { - continue; + var method = options.method || 'GET'; + var resType = options.responseType || 'blob'; + var mimeType = options.mimeType || 'text/plain; charset=x-user-defined'; + xhr.open(method, options.url); + if (typeof Blob !== 'undefined') { + xhr.responseType = resType; + } else { + xhr.overrideMimeType(mimeType); } - var n = _parseNameFromJidFn(jid); - list[n] = { - jid: jid, - affiliation: affiliation, - nick: nick, - name: n + + var innerHeaer = { + 'X-Requested-With': 'XMLHttpRequest', + 'Accept': 'application/octet-stream', + 'share-secret': options.secret, + 'Authorization': 'Bearer ' + accessToken }; - } - } - return list; - } + var headers = options.headers || {}; + for (var key in headers) { + innerHeaer[key] = headers[key]; + } + for (var key in innerHeaer) { + if (innerHeaer[key]) { + xhr.setRequestHeader(key, innerHeaer[key]); + } + } + // fix: ie8 status error + window.XDomainRequest && (xhr.readyState = 2); + xhr.send(null); + }, - /** - * 获取群组黑名单 - * @param {Object} options - */ - connection.prototype.getGroupBlacklist = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; + parseTextMessage: function parseTextMessage(message, faces) { + if (typeof message !== 'string') { + return; + } - // var jid = _getJid(options, this); - var affiliation = 'admin';//options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'get', to: to}); + if (Object.prototype.toString.call(faces) !== '[object Object]') { + return { + isemoji: false, + body: [{ + type: 'txt', + data: message + }] + }; + } - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('item', { - affiliation: 'outcast', - }); + var receiveMsg = message; + var emessage = []; + var expr = /\[[^[\]]{2,3}\]/mg; + var emoji = receiveMsg.match(expr); - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(_parseGroupBlacklist(msginfo)); - }, function () { - errFn(); - }); - }; + if (!emoji || emoji.length < 1) { + return { + isemoji: false, + body: [{ + type: 'txt', + data: message + }] + }; + } + var isemoji = false; + for (var i = 0; i < emoji.length; i++) { + var tmsg = receiveMsg.substring(0, receiveMsg.indexOf(emoji[i])), + existEmoji = WebIM.Emoji.map[emoji[i]]; - /** - * 从群组黑名单删除 - * @param {Object} options - */ - connection.prototype.removeGroupMemberFromBlacklist = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; + if (tmsg) { + emessage.push({ + type: 'txt', + data: tmsg + }); + } + if (!existEmoji) { + emessage.push({ + type: 'txt', + data: emoji[i] + }); + continue; + } + var emojiStr = WebIM.Emoji.map ? WebIM.Emoji.path + existEmoji : null; - var jid = _getJid(options, this); - var affiliation = 'admin';//options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); + if (emojiStr) { + isemoji = true; + emessage.push({ + type: 'emoji', + data: emojiStr + }); + } else { + emessage.push({ + type: 'txt', + data: emoji[i] + }); + } + var restMsgIndex = receiveMsg.indexOf(emoji[i]) + emoji[i].length; + receiveMsg = receiveMsg.substring(restMsgIndex); + } + if (receiveMsg) { + emessage.push({ + type: 'txt', + data: receiveMsg + }); + } + if (isemoji) { + return { + isemoji: isemoji, + body: emessage + }; + } + return { + isemoji: false, + body: [{ + type: 'txt', + data: message + }] + }; + }, - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('item', { - affiliation: 'none', - jid: jid - }); + parseUri: function parseUri() { + var pattern = /([^\?|&])\w+=([^&]+)/g; + var uri = {}; + if (window.location.search) { + var args = window.location.search.match(pattern); + for (var i in args) { + var str = args[i]; + var eq = str.indexOf('='); + var key = str.substr(0, eq); + var value = str.substr(eq + 1); + uri[key] = value; + } + } + return uri; + }, - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; + parseHrefHash: function parseHrefHash() { + var pattern = /([^\#|&])\w+=([^&]+)/g; + var uri = {}; + if (window.location.hash) { + var args = window.location.hash.match(pattern); + for (var i in args) { + var str = args[i]; + var eq = str.indexOf('='); + var key = str.substr(0, eq); + var value = str.substr(eq + 1); + uri[key] = value; + } + } + return uri; + }, - /** - * 修改群名称 - * - * @param {Object} options - - * @example - - - - http://jabber.org/protocol/muc#roomconfig - Room Name - - - - */ - connection.prototype.changeGroupSubject = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; + xmlrequest: _xmlrequest, - // must be `owner` - var affiliation = 'owner'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('x', {type: 'submit', xmlns: 'jabber:x:data'}) - .c('field', {'var': 'FORM_TYPE'}) - .c('value') - .t('http://jabber.org/protocol/muc#roomconfig') - .up().up() - .c('field', {'var': 'muc#roomconfig_roomname'}) - .c('value') - .t(options.subject) - .up().up() - .c('field', {'var': 'muc#roomconfig_roomdesc'}) - .c('value') - .t(options.description); + getXmlFirstChild: function getXmlFirstChild(data, tagName) { + var children = data.getElementsByTagName(tagName); + if (children.length == 0) { + return null; + } else { + return children[0]; + } + }, + ajax: function ajax(options) { + var dataType = options.dataType || 'text'; + var suc = options.success || EMPTYFN; + var error = options.error || EMPTYFN; + var xhr = utils.xmlrequest(); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + var status = xhr.status || 0; + if (status === 200) { + try { + switch (dataType) { + case 'text': + suc(xhr.responseText); + return; + case 'json': + var json = utils.parseJSON(xhr.responseText); + suc(json, xhr); + return; + case 'xml': + if (xhr.responseXML && xhr.responseXML.documentElement) { + suc(xhr.responseXML.documentElement, xhr); + } else { + error({ + type: _code.WEBIM_CONNCTION_AJAX_ERROR, + data: xhr.responseText + }); + } + return; + } + suc(xhr.response || xhr.responseText, xhr); + } catch (e) { + error({ + type: _code.WEBIM_CONNCTION_AJAX_ERROR, + data: e + }); + } + return; + } else { + error({ + type: _code.WEBIM_CONNCTION_AJAX_ERROR, + data: xhr.responseText + }); + return; + } + } + if (xhr.readyState === 0) { + error({ + type: _code.WEBIM_CONNCTION_AJAX_ERROR, + data: xhr.responseText + }); + } + }; - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; + if (options.responseType) { + if (xhr.responseType) { + xhr.responseType = options.responseType; + } + } + if (options.mimeType) { + if (utils.hasOverrideMimeType) { + xhr.overrideMimeType(options.mimeType); + } + } - /** - * 删除群组 - * - * @param {Object} options - - * @example - - - - xxx destory group yyy - - - - */ - connection.prototype.destroyGroup = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; + var type = options.type || 'POST', + data = options.data || null, + tempData = ''; - // must be `owner` - var affiliation = 'owner'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); + if (type.toLowerCase() === 'get' && data) { + for (var o in data) { + if (data.hasOwnProperty(o)) { + tempData += o + '=' + data[o] + '&'; + } + } + tempData = tempData ? tempData.slice(0, -1) : tempData; + options.url += (options.url.indexOf('?') > 0 ? '&' : '?') + (tempData ? tempData + '&' : tempData) + '_v=' + new Date().getTime(); + data = null; + tempData = null; + } + xhr.open(type, options.url, utils.isCanSetRequestHeader); - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('destroy') - .c('reason').t(options.reason || ''); + if (utils.isCanSetRequestHeader) { + var headers = options.headers || {}; + for (var key in headers) { + if (headers.hasOwnProperty(key)) { + xhr.setRequestHeader(key, headers[key]); + } + } + } + // fix: ie8 status error + window.XDomainRequest && (xhr.readyState = 2); + xhr.send(data); + return xhr; + }, + ts: function ts() { + var d = new Date(); + var Hours = d.getHours(); //获取当前小时数(0-23) + var Minutes = d.getMinutes(); //获取当前分钟数(0-59) + var Seconds = d.getSeconds(); //获取当前秒数(0-59) + var Milliseconds = d.getMilliseconds(); //获取当前毫秒 + return (Hours < 10 ? "0" + Hours : Hours) + ':' + (Minutes < 10 ? "0" + Minutes : Minutes) + ':' + (Seconds < 10 ? "0" + Seconds : Seconds) + ':' + Milliseconds + ' '; + }, - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; + getObjectKey: function getObjectKey(obj, val) { + for (var key in obj) { + if (obj[key] == val) { + return key; + } + } + return ''; + }, - /** - * 主动离开群组 - * - * @param {Object} options - - * @example - - - - - - - */ - connection.prototype.leaveGroupBySelf = function (options) { - var self = this; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - // must be `owner` - var jid = _getJid(options, this); - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); + sprintf: function sprintf() { + var arg = arguments, + str = arg[0] || '', + i, + len; + for (i = 1, len = arg.length; i < len; i++) { + str = str.replace(/%s/, arg[i]); + } + return str; + }, - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}) - .c('item', { - affiliation: 'none', - jid: jid - }); + setCookie: function setCookie(name, value, days) { + var cookie = name + '=' + encodeURIComponent(value); + if (typeof days == 'number') { + cookie += '; max-age: ' + days * 60 * 60 * 24; + } + document.cookie = cookie; + }, - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - var pres = $pres({type: 'unavailable', to: to + '/' + self.context.userId}); - self.sendCommand(pres.tree()); - }, function (errInfo) { - errFn(errInfo); - }); - }; + getCookie: function getCookie() { + var allCookie = {}; + var all = document.cookie; + if (all === "") { + return allCookie; + } + var list = all.split("; "); + for (var i = 0; i < list.length; i++) { + var cookie = list[i]; + var p = cookie.indexOf('='); + var name = cookie.substring(0, p); + var value = cookie.substring(p + 1); + value = decodeURIComponent(value); + allCookie[name] = value; + } + return allCookie; + } + }; - /** - * 被踢出群组 - * - * @param {Object} options - - * @example - - - - - - - - - */ - connection.prototype.leaveGroup = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var list = options.list || []; - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - var piece = iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}); - var keys = Object.keys(list); - var len = keys.length; + exports.utils = utils; + })(); - for (var i = 0; i < len; i++) { - var name = list[keys[i]]; - var jid = _getJidByName(name, this); +/***/ }, - piece = piece.c('item', { - affiliation: 'none', - jid: jid - }).up().c('item', { - role: 'none', - jid: jid, - }).up(); - } +/***/ 207: +/***/ function(module, exports) { - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - }, function (errInfo) { - errFn(errInfo); - }); - }; + "use strict"; - /** - * 添加群组成员 - * - * @param {Object} options - - * @example - Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发) - - - - - liuwz invite you to join group '谢谢' - - - - - - - - - - */ - connection.prototype.addGroupMembers = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var list = options.list || []; - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - var piece = iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}); - var len = list.length; + ; + (function () { - for (var i = 0; i < len; i++) { + exports.code = { + WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0, + WEBIM_CONNCTION_OPEN_ERROR: 1, + WEBIM_CONNCTION_AUTH_ERROR: 2, + WEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3, + WEBIM_CONNCTION_ATTACH_ERROR: 4, + WEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5, + WEBIM_CONNCTION_REOPEN_ERROR: 6, + WEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7, //7: client-side network offline (net::ERR_INTERNET_DISCONNECTED) + WEBIM_CONNCTION_SERVER_ERROR: 8, //8: offline by multi login + WEBIM_CONNCTION_IQ_ERROR: 9, - var name = list[i]; - var jid = _getJidByName(name, this); + WEBIM_CONNCTION_PING_ERROR: 10, + WEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11, + WEBIM_CONNCTION_GETROSTER_ERROR: 12, + WEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13, + WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14, + WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15, + WEBIM_CONNCTION_DISCONNECTED: 16, //16: server-side close the websocket connection + WEBIM_CONNCTION_AJAX_ERROR: 17, + WEBIM_CONNCTION_JOINROOM_ERROR: 18, + WEBIM_CONNCTION_GETROOM_ERROR: 19, - piece = piece.c('item', { - affiliation: 'member', - jid: jid - }).up(); + WEBIM_CONNCTION_GETROOMINFO_ERROR: 20, + WEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21, + WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22, + WEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23, + WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24, + WEBIM_CONNCTION_JOINCHATROOM_ERROR: 25, + WEBIM_CONNCTION_QUITCHATROOM_ERROR: 26, + WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27, + WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28, + WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29, - var dom = $msg({ - to: to - }).c('x', { - xmlns: 'http://jabber.org/protocol/muc#user' - }).c('invite', { - to: jid - }).c('reason').t(options.reason || ''); + WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30, + WEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31, //31: 处理下行消息出错 try/catch抛出异常 + WEBIM_CONNCTION_CLIENT_OFFLINE: 32, //32: client offline + WEBIM_CONNCTION_CLIENT_LOGOUT: 33, //33: client logout + WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34, // 34: Over amount of the tabs a user opened in the same browser + WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35, + WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36, + WEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37, + WEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38, + WEBIM_CONNECTION_CLOSED: 39, - this.sendCommand(dom.tree()); + WEBIM_UPLOADFILE_BROWSER_ERROR: 100, + WEBIM_UPLOADFILE_ERROR: 101, + WEBIM_UPLOADFILE_NO_LOGIN: 102, + WEBIM_UPLOADFILE_NO_FILE: 103, - } + WEBIM_DOWNLOADFILE_ERROR: 200, + WEBIM_DOWNLOADFILE_NO_LOGIN: 201, + WEBIM_DOWNLOADFILE_BROWSER_ERROR: 202, - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - }, function (errInfo) { - errFn(errInfo); - }); - }; + WEBIM_MESSAGE_REC_TEXT: 300, + WEBIM_MESSAGE_REC_TEXT_ERROR: 301, + WEBIM_MESSAGE_REC_EMOTION: 302, + WEBIM_MESSAGE_REC_PHOTO: 303, + WEBIM_MESSAGE_REC_AUDIO: 304, + WEBIM_MESSAGE_REC_AUDIO_FILE: 305, + WEBIM_MESSAGE_REC_VEDIO: 306, + WEBIM_MESSAGE_REC_VEDIO_FILE: 307, + WEBIM_MESSAGE_REC_FILE: 308, + WEBIM_MESSAGE_SED_TEXT: 309, + WEBIM_MESSAGE_SED_EMOTION: 310, + WEBIM_MESSAGE_SED_PHOTO: 311, + WEBIM_MESSAGE_SED_AUDIO: 312, + WEBIM_MESSAGE_SED_AUDIO_FILE: 313, + WEBIM_MESSAGE_SED_VEDIO: 314, + WEBIM_MESSAGE_SED_VEDIO_FILE: 315, + WEBIM_MESSAGE_SED_FILE: 316, + WEBIM_MESSAGE_SED_ERROR: 317, - /** - * 接受加入申请 - * - * @param {Object} options - - */ - connection.prototype.acceptInviteFromGroup = function (options) { - options.success = function () { - // then send sendAcceptInviteMessage - // connection.prototype.sendAcceptInviteMessage(optoins); + STATUS_INIT: 400, + STATUS_DOLOGIN_USERGRID: 401, + STATUS_DOLOGIN_IM: 402, + STATUS_OPENED: 403, + STATUS_CLOSING: 404, + STATUS_CLOSED: 405, + STATUS_ERROR: 406 }; - this.addGroupMembers(options); - }; + })(); - /** - * 拒绝入群申请 - * @param {Object} options - - * @example - throw request for now 暂时不处理,直接丢弃 +/***/ }, - - - - reject - - - - */ - connection.prototype.rejectInviteFromGroup = function (options) { - // var from = _getJidByName(options.from, this); - // var dom = $msg({ - // from: from, - // to: _getJidByName(options.to, this) - // }).c('x', { - // xmlns: 'http://jabber.org/protocol/muc#user' - // }).c('apply', { - // from: from, - // to: this._getGroupJid(options.groupId), - // toNick: options.groupName - // }).c('reason').t(options.reason || ''); - // - // this.sendCommand(dom.tree()); - }; +/***/ 211: +/***/ function(module, exports, __webpack_require__) { - /** - * 创建群组-异步 - * @param {Object} p - - */ - connection.prototype.createGroupAsync = function (p) { - var roomId = p.from - var me = this; - var toRoom = this._getGroupJid(roomId); - var to = toRoom + '/' + this.context.userId; - var options = this.groupOption; - var suc = p.success || _utils.emptyfn; - - // Creating a Reserved Room - var iq = $iq({type: 'get', to: toRoom}) - .c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}); + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(213), __webpack_require__(214), __webpack_require__(215), __webpack_require__(216), __webpack_require__(217), __webpack_require__(218), __webpack_require__(219), __webpack_require__(220), __webpack_require__(221), __webpack_require__(222), __webpack_require__(223), __webpack_require__(224), __webpack_require__(225), __webpack_require__(226), __webpack_require__(227), __webpack_require__(228), __webpack_require__(229), __webpack_require__(230), __webpack_require__(231), __webpack_require__(232), __webpack_require__(233), __webpack_require__(234), __webpack_require__(235), __webpack_require__(236), __webpack_require__(237), __webpack_require__(238), __webpack_require__(239), __webpack_require__(240), __webpack_require__(241), __webpack_require__(242), __webpack_require__(243), __webpack_require__(244)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // Strophe.info('step 1 ----------'); - // Strophe.info(options); - me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - // console.log(msgInfo); + return CryptoJS; - // for ie hack - if ('setAttribute' in msgInfo) { - // Strophe.info('step 3 ----------'); - var x = msgInfo.getElementsByTagName('x')[0]; - x.setAttribute('type', 'submit'); - } else { - // Strophe.info('step 4 ----------'); - Strophe.forEachChild(msgInfo, 'x', function (field) { - field.setAttribute('type', 'submit'); - }); - } + })); - Strophe.info('step 5 ----------'); - Strophe.forEachChild(x, 'field', function (field) { - var fieldVar = field.getAttribute('var'); - var valueDom = field.getElementsByTagName('value')[0]; - Strophe.info(fieldVar); - switch (fieldVar) { - case 'muc#roomconfig_maxusers': - _setText(valueDom, options.optionsMaxUsers || 200); - break; - case 'muc#roomconfig_roomname': - _setText(valueDom, options.subject || ''); - break; - case 'muc#roomconfig_roomdesc': - _setText(valueDom, options.description || ''); - break; - case 'muc#roomconfig_publicroom': // public 1 - _setText(valueDom, +options.optionsPublic); - break; - case 'muc#roomconfig_membersonly': - _setText(valueDom, +options.optionsMembersOnly); - break; - case 'muc#roomconfig_moderatedroom': - _setText(valueDom, +options.optionsModerate); - break; - case 'muc#roomconfig_persistentroom': - _setText(valueDom, 1); - break; - case 'muc#roomconfig_allowinvites': - _setText(valueDom, +options.optionsAllowInvites); - break; - case 'muc#roomconfig_allowvisitornickchange': - _setText(valueDom, 0); - break; - case 'muc#roomconfig_allowvisitorstatus': - _setText(valueDom, 0); - break; - case 'allow_private_messages': - _setText(valueDom, 0); - break; - case 'allow_private_messages_from_visitors': - _setText(valueDom, 'nobody'); - break; - default: - break; - } - }); +/***/ }, - var iq = $iq({to: toRoom, type: 'set'}) - .c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}) - .cnode(x); +/***/ 212: +/***/ function(module, exports, __webpack_require__) { - me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - me.addGroupMembers({ - list: options.members, - roomId: roomId - }); + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(); + } + else if (typeof define === "function" && define.amd) { + // AMD + define([], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(); + } + }(this, function () { - suc(options); - }, function (errInfo) { - // errFn(errInfo); - }); - // sucFn(msgInfo); - }, function (errInfo) { - // errFn(errInfo); - }); - }; + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + /* + * Local polyfil of Object.create + */ + var create = Object.create || (function () { + function F() {}; - /** - * 创建群组 - * @param {Object} options - - * @example - * 1. 创建申请 -> 得到房主身份 - * 2. 获取房主信息 -> 得到房间form - * 3. 完善房间form -> 创建成功 - * 4. 添加房间成员 - * 5. 消息通知成员 - */ - connection.prototype.createGroup = function (options) { - this.groupOption = options; - var roomId = +new Date(); - var toRoom = this._getGroupJid(roomId); - var to = toRoom + '/' + this.context.userId; + return function (obj) { + var subtype; - var pres = $pres({to: to}) - .c('x', {xmlns: 'http://jabber.org/protocol/muc'}).up() - .c('create', {xmlns: 'http://jabber.org/protocol/muc'}).up(); + F.prototype = obj; - // createGroupACK - this.sendCommand(pres.tree()); - }; - // 通过RestFul API接口创建群组 - connection.prototype.createGroupNew = function (opt) { - opt.data.owner = this.user; - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups', - dataType: 'json', - type: 'POST', - data: JSON.stringify(opt.data), - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = function (respData) { - opt.success(respData); - this.onCreateGroup(respData); - }.bind(this); - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + subtype = new F(); - /** - * 通过RestFul API屏蔽群组 - * @param {Object} options - - */ - connection.prototype.blockGroup = function (opt) { - var groupId = opt.groupId; - groupId = 'notification_ignore_' + groupId; - var data = { - entities: [] - }; - data.entities[0] = {}; - data.entities[0][groupId] = true; - var options = { - type: 'PUT', - url: this.apiUrl + '/' + this.orgName + '/' - + this.appName + '/' + 'users' + '/' + this.user, - data: JSON.stringify(data), - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + F.prototype = null; - /** - * 通过RestFul API发出入群申请 - * @param {Object} opt - - */ - connection.prototype.joinGroup = function (opt) { - var options = { - url: this.apiUrl + '/' + this.orgName + '/' - + this.appName + '/' + 'chatgroups' + '/' + opt.groupId + '/' + 'apply', - type: 'POST', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + return subtype; + }; + }()) - /** - * 通过RestFul API获取群组列表 - * @param {Object} opt - - */ - connection.prototype.listGroups = function (opt) { - var requestData = []; - requestData['limit'] = opt.limit; - requestData['cursor'] = opt.cursor; - if (!requestData['cursor']) - delete requestData['cursor']; - if (isNaN(opt.limit)) { - throw 'The parameter \"limit\" should be a number'; - return; - } - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/publicchatgroups', - type: 'GET', - dataType: 'json', - data: requestData, - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * CryptoJS namespace. + */ + var C = {}; - /** - * 通过RestFul API根据groupid获取群组详情 - * @param {Object} opt - - */ - connection.prototype.getGroupInfo = function (opt) { - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups/' + opt.groupId, - type: 'GET', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Library namespace. + */ + var C_lib = C.lib = {}; - /** - * 通过RestFul API列出某用户所加入的所有群组 - * @param {Object} opt - - */ - connection.prototype.getGroup = function (opt) { - var options = { - url: this.apiUrl + '/' + this.orgName + - '/' + this.appName + '/' + 'users' + '/' + - this.user + '/' + 'joined_chatgroups', - dataType: 'json', - type: 'GET', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; - - /** - * 通过RestFul API列出群组的所有成员 - * @param {Object} opt - - */ - connection.prototype.listGroupMember = function (opt) { - if (isNaN(opt.pageNum) || opt.pageNum <= 0) { - throw 'The parameter \"pageNum\" should be a positive number'; - return; - } else if (isNaN(opt.pageSize) || opt.pageSize <= 0) { - throw 'The parameter \"pageSize\" should be a positive number'; - return; - } else if (opt.groupId === null && typeof opt.groupId === 'undefined') { - throw 'The parameter \"groupId\" should be added'; - return; - } - var requestData = [], - groupId = opt.groupId; - requestData['pagenum'] = opt.pageNum; - requestData['pagesize'] = opt.pageSize; - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' - + '/' + groupId + '/users', - dataType: 'json', - type: 'GET', - data: requestData, - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { - /** - * 通过RestFul API禁止群用户发言 - * @param {Object} opt - - */ - connection.prototype.mute = function (opt) { - var groupId = opt.groupId, - requestData = { - "usernames": [opt.username], - "mute_duration": opt.muteDuration - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' - + '/' + groupId + '/' + 'mute', - dataType: 'json', - type: 'POST', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - }, - data: JSON.stringify(requestData) - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; - /** - * 通过RestFul API取消对用户禁言 - * @param {Object} opt - - */ - connection.prototype.removeMute = function (opt) { - var groupId = opt.groupId, - username = opt.username; - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' - + '/' + groupId + '/' + 'mute' + '/' + username, - dataType: 'json', - type: 'DELETE', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); - /** - * 通过RestFul API获取群组下所有管理员 - * @param {Object} opt - - */ - connection.prototype.getGroupAdmin = function (opt) { - var groupId = opt.groupId; - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' - + '/' + groupId + '/admin', - dataType: 'json', - type: 'GET', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + // Augment + if (overrides) { + subtype.mixIn(overrides); + } - /** - * 通过RestFul API获取群组下所有被禁言成员 - * @param {Object} opt - - */ - connection.prototype.getMuted = function (opt) { - var groupId = opt.groupId; - var options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' - + '/' + groupId + '/mute', - dataType: 'json', - type: 'GET', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } - /** - * 通过RestFul API设置群管理员 - * @param {Object} opt - - */ - connection.prototype.setAdmin = function (opt) { - var groupId = opt.groupId, - requestData = { - newadmin: opt.username - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' - + '/' + groupId + '/' + 'admin', - type: "POST", - dataType: 'json', - data: JSON.stringify(requestData), - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; - /** - * 通过RestFul API取消群管理员 - * @param {Object} opt - - */ - connection.prototype.removeAdmin = function (opt) { - var groupId = opt.groupId, - username = opt.username, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' - + '/' + groupId + '/' + 'admin' + '/' + username, - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + // Reference supertype + subtype.$super = this; - /** - * 通过RestFul API同意用户加入群 - * @param {Object} opt - - */ - connection.prototype.agreeJoinGroup = function (opt) { - var groupId = opt.groupId, - requestData = { - "applicant": opt.applicant, - "verifyResult": true, - "reason": "no clue" - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify', - type: 'POST', - dataType: "json", - data: JSON.stringify(requestData), - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + return subtype; + }, - /** - * 通过RestFul API拒绝用户加入群 - * @param {Object} opt - - */ - connection.prototype.rejectJoinGroup = function (opt) { - var groupId = opt.groupId, - requestData = { - "applicant": opt.applicant, - "verifyResult": false, - "reason": "no clue" - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify', - type: 'POST', - dataType: "json", - data: JSON.stringify(requestData), - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); - /** - * 通过RestFul API添加用户至群组黑名单(单个) - * @param {Object} opt - - */ - connection.prototype.groupBlockSingle = function (opt) { - var groupId = opt.groupId, - username = opt.username, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' - + 'users' + '/' + username, - type: 'POST', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + return instance; + }, - /** - * 通过RestFul API添加用户至群组黑名单(批量) - * @param {Object} opt - - */ - connection.prototype.groupBlockMulti = function (opt) { - var groupId = opt.groupId, - usernames = opt.usernames, - requestData = { - usernames: usernames - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' - + 'users', - data: JSON.stringify(requestData), - type: 'POST', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, - /** - * 通过RestFul API将用户从群黑名单移除(单个) - * @param {Object} opt - - */ - connection.prototype.removeGroupBlockSingle = function (opt) { - var groupId = opt.groupId, - username = opt.username, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' - + 'users' + '/' + username, - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } - /** - * 通过RestFul API将用户从群黑名单移除(批量) - * @param {Object} opt - - */ - connection.prototype.removeGroupBlockMulti = function (opt) { - var groupId = opt.groupId, - username = opt.username.join(','), - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' - + 'users' + '/' + username, - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, - /** - * 通过RestFul API解散群组 - * @param {Object} opt - - */ - connection.prototype.dissolveGroup = function (opt) { - var groupId = opt.groupId, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '?version=v3', - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); - /** - * 通过RestFul API获取群组黑名单 - * @param {Object} opt - - */ - connection.prototype.getGroupBlacklistNew = function (opt) { - var groupId = opt.groupId, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users', - type: 'GET', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; - /** - * 通过RestFul API离开群组 - * @param {Object} opt - - */ - connection.prototype.quitGroup = function (opt) { - var groupId = opt.groupId, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'quit', - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, - /** - * 通过RestFul API修改群信息 - * @param {Object} opt - - */ - connection.prototype.modifyGroup = function (opt) { - var groupId = opt.groupId, - requestData = { - groupname: opt.groupName, - description: opt.description - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId, - type: 'PUT', - data: JSON.stringify(requestData), - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, - /** - * 通过RestFul API删除单个群成员 - * @param {Object} opt - - */ - connection.prototype.removeSingleGroupMember = function (opt) { - var groupId = opt.groupId, - username = opt.username, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' - + username, - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; - /** - * 通过RestFul API删除多个群成员 - * @param {Object} opt - - */ - connection.prototype.removeMultiGroupMember = function (opt) { - var groupId = opt.groupId, - users = opt.users.join(','), - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' - + users, - type: 'DELETE', - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; - - /** - * 通过RestFul API邀请群成员 - * @param {Object} opt - - */ - connection.prototype.inviteToGroup = function (opt) { - var groupId = opt.groupId, - users = opt.users, - requestData = { - usernames: users - }, - options = { - url: this.apiUrl + '/' + this.orgName + '/' + this.appName - + '/' + 'chatgroups' + '/' + groupId + '/' + 'invite', - type: 'POST', - data: JSON.stringify(requestData), - dataType: 'json', - headers: { - 'Authorization': 'Bearer ' + this.token, - 'Content-Type': 'application/json' - } - }; - options.success = opt.success || _utils.emptyfn; - options.error = opt.error || _utils.emptyfn; - WebIM.utils.ajax(options); - }; - - function _setText(valueDom, v) { - if ('textContent' in valueDom) { - valueDom.textContent = v; - } else if ('text' in valueDom) { - valueDom.text = v; - } else { - // Strophe.info('_setText 4 ----------'); - // valueDom.innerHTML = v; - } - } + // Clamp excess bits + this.clamp(); + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } + this.sigBytes += thatSigBytes; - var WebIM = window.WebIM || {}; - WebIM.connection = connection; - WebIM.utils = _utils; - WebIM.statusCode = _code; - WebIM.message = _msg.message; - WebIM.doQuery = function (str, suc, fail) { - if (typeof window.cefQuery === 'undefined') { - return; - } - window.cefQuery({ - request: str, - persistent: false, - onSuccess: suc, - onFailure: fail - } - ); - }; + // Chainable + return this; + }, - /**************************** debug ****************************/ - function logMessage(message) { - // 获取Resource - var data = message.data; - if (data.indexOf('') > 0) { - var start = data.indexOf(''), - end = data.indexOf(''), - data = data.substring(start + 5, end); - stropheConn.setJid(data); - } - WebIM && WebIM.config.isDebug && console.log(WebIM.utils.ts() + '[recv] ', message.data); - } + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; - if (WebIM && WebIM.config.isDebug) { - Strophe.Connection.prototype.rawOutput = function (data) { - console.log('%c ' + WebIM.utils.ts() + '[send] ' + data, "background-color: #e2f7da"); - } - } + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, - if (WebIM && WebIM.config && WebIM.config.isSandBox) { - WebIM.config.xmppURL = WebIM.config.xmppURL.replace('.easemob.', '-sandbox.easemob.'); - WebIM.config.apiURL = WebIM.config.apiURL.replace('.easemob.', '-sdb.easemob.'); - } + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + return clone; + }, - module.exports = WebIM; + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; - if (false) { - module.hot.accept(); - } + var r = (function (m_w) { + var m_w = m_w; + var m_z = 0x3ade68b1; + var mask = 0xffffffff; -/***/ }), -/* 2 */ -/***/ (function(module, exports) { + return function () { + m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; + m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; + var result = ((m_z << 0x10) + m_w) & mask; + result /= 0x100000000; + result += 0.5; + return result * (Math.random() > .5 ? 1 : -1); + } + }); - ; - (function () { + for (var i = 0, rcache; i < nBytes; i += 4) { + var _r = r((rcache || Math.random()) * 0x100000000); - exports.code = { - WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0, - WEBIM_CONNCTION_OPEN_ERROR: 1, - WEBIM_CONNCTION_AUTH_ERROR: 2, - WEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3, - WEBIM_CONNCTION_ATTACH_ERROR: 4, - WEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5, - WEBIM_CONNCTION_REOPEN_ERROR: 6, - WEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7, //7: client-side network offline (net::ERR_INTERNET_DISCONNECTED) - WEBIM_CONNCTION_SERVER_ERROR: 8, //8: offline by multi login - WEBIM_CONNCTION_IQ_ERROR: 9, + rcache = _r() * 0x3ade67b7; + words.push((_r() * 0x100000000) | 0); + } - WEBIM_CONNCTION_PING_ERROR: 10, - WEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11, - WEBIM_CONNCTION_GETROSTER_ERROR: 12, - WEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13, - WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14, - WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15, - WEBIM_CONNCTION_DISCONNECTED: 16, //16: server-side close the websocket connection - WEBIM_CONNCTION_AJAX_ERROR: 17, - WEBIM_CONNCTION_JOINROOM_ERROR: 18, - WEBIM_CONNCTION_GETROOM_ERROR: 19, + return new WordArray.init(words, nBytes); + } + }); - WEBIM_CONNCTION_GETROOMINFO_ERROR: 20, - WEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21, - WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22, - WEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23, - WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24, - WEBIM_CONNCTION_JOINCHATROOM_ERROR: 25, - WEBIM_CONNCTION_QUITCHATROOM_ERROR: 26, - WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27, - WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28, - WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29, + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; - WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30, - WEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31, //31: 处理下行消息出错 try/catch抛出异常 - WEBIM_CONNCTION_CLIENT_OFFLINE: 32, //32: client offline - WEBIM_CONNCTION_CLIENT_LOGOUT: 33, //33: client logout - WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34, // 34: Over amount of the tabs a user opened in the same browser - WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35, - WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36, - WEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37, - WEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38, - WEBIM_CONNECTION_CLOSED: 39, + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } - WEBIM_UPLOADFILE_BROWSER_ERROR: 100, - WEBIM_UPLOADFILE_ERROR: 101, - WEBIM_UPLOADFILE_NO_LOGIN: 102, - WEBIM_UPLOADFILE_NO_FILE: 103, + return hexChars.join(''); + }, + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; - WEBIM_DOWNLOADFILE_ERROR: 200, - WEBIM_DOWNLOADFILE_NO_LOGIN: 201, - WEBIM_DOWNLOADFILE_BROWSER_ERROR: 202, + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + return new WordArray.init(words, hexStrLength / 2); + } + }; - WEBIM_MESSAGE_REC_TEXT: 300, - WEBIM_MESSAGE_REC_TEXT_ERROR: 301, - WEBIM_MESSAGE_REC_EMOTION: 302, - WEBIM_MESSAGE_REC_PHOTO: 303, - WEBIM_MESSAGE_REC_AUDIO: 304, - WEBIM_MESSAGE_REC_AUDIO_FILE: 305, - WEBIM_MESSAGE_REC_VEDIO: 306, - WEBIM_MESSAGE_REC_VEDIO_FILE: 307, - WEBIM_MESSAGE_REC_FILE: 308, - WEBIM_MESSAGE_SED_TEXT: 309, - WEBIM_MESSAGE_SED_EMOTION: 310, - WEBIM_MESSAGE_SED_PHOTO: 311, - WEBIM_MESSAGE_SED_AUDIO: 312, - WEBIM_MESSAGE_SED_AUDIO_FILE: 313, - WEBIM_MESSAGE_SED_VEDIO: 314, - WEBIM_MESSAGE_SED_VEDIO_FILE: 315, - WEBIM_MESSAGE_SED_FILE: 316, - WEBIM_MESSAGE_SED_ERROR: 317, - - - STATUS_INIT: 400, - STATUS_DOLOGIN_USERGRID: 401, - STATUS_DOLOGIN_IM: 402, - STATUS_OPENED: 403, - STATUS_CLOSING: 404, - STATUS_CLOSED: 405, - STATUS_ERROR: 406 - }; - }()); + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { + return latin1Chars.join(''); + }, - ; - (function () { + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; - var EMPTYFN = function () { - }; - var _code = __webpack_require__(2).code; - var WEBIM_FILESIZE_LIMIT = 10485760; + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } - var _createStandardXHR = function () { - try { - return new window.XMLHttpRequest(); - } catch (e) { - return false; - } - }; + return new WordArray.init(words, latin1StrLength); + } + }; - var _createActiveXHR = function () { - try { - return new window.ActiveXObject('Microsoft.XMLHTTP'); - } catch (e) { - return false; - } - }; + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, - var _xmlrequest = function (crossDomain) { - crossDomain = crossDomain || true; - var temp = _createStandardXHR() || _createActiveXHR(); + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; - if ('withCredentials' in temp) { - return temp; - } - if (!crossDomain) { - return temp; - } - if (typeof window.XDomainRequest === 'undefined') { - return temp; - } - var xhr = new XDomainRequest(); - xhr.readyState = 0; - xhr.status = 100; - xhr.onreadystatechange = EMPTYFN; - xhr.onload = function () { - xhr.readyState = 4; - xhr.status = 200; + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, - var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); - xmlDoc.async = 'false'; - xmlDoc.loadXML(xhr.responseText); - xhr.responseXML = xmlDoc; - xhr.response = xhr.responseText; - xhr.onreadystatechange(); - }; - xhr.ontimeout = xhr.onerror = function () { - xhr.readyState = 4; - xhr.status = 500; - xhr.onreadystatechange(); - }; - return xhr; - }; + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } - var _hasFlash = (function () { - if ('ActiveXObject' in window) { - try { - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); - } catch (ex) { - return 0; - } - } else { - if (navigator.plugins && navigator.plugins.length > 0) { - return navigator.plugins['Shockwave Flash']; - } - } - return 0; - }()); + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, - var _tmpUtilXHR = _xmlrequest(), - _hasFormData = typeof FormData !== 'undefined', - _hasBlob = typeof Blob !== 'undefined', - _isCanSetRequestHeader = _tmpUtilXHR.setRequestHeader || false, - _hasOverrideMimeType = _tmpUtilXHR.overrideMimeType || false, - _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData, - _isCanUploadFile = _isCanUploadFileAsync || _hasFlash, - _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType); + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; - if (!Object.keys) { - Object.keys = (function () { - 'use strict'; - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), - dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ], - dontEnumsLength = dontEnums.length; + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } - return function (obj) { - if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { - throw new TypeError('Object.keys called on non-object'); - } + // Count words ready + var nWordsReady = nBlocksReady * blockSize; - var result = [], prop, i; + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - return result; - }; - }()); - } - - var utils = { - hasFormData: _hasFormData, + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } - hasBlob: _hasBlob, + // Remove processed words + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } - emptyfn: EMPTYFN, + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, - isCanSetRequestHeader: _isCanSetRequestHeader, + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); - hasOverrideMimeType: _hasOverrideMimeType, + return clone; + }, - isCanUploadFileAsync: _isCanUploadFileAsync, + _minBufferSize: 0 + }); - isCanUploadFile: _isCanUploadFile, + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), - isCanDownLoadFile: _isCanDownLoadFile, + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); - isSupportWss: (function () { - var notSupportList = [ - //1: QQ browser X5 core - /MQQBrowser[\/]5([.]\d+)?\sTBS/ + // Set initial values + this.reset(); + }, - //2: etc. - //... - ]; + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); - if (!window.WebSocket) { - return false; - } + // Perform concrete-hasher logic + this._doReset(); + }, - var ua = window.navigator.userAgent; - for (var i = 0, l = notSupportList.length; i < l; i++) { - if (notSupportList[i].test(ua)) { - return false; - } - } - return true; - }()), + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); - getIEVersion: (function () { - var ua = navigator.userAgent, matches, tridentMap = {'4': 8, '5': 9, '6': 10, '7': 11}; + // Update the hash + this._process(); - matches = ua.match(/MSIE (\d+)/i); + // Chainable + return this; + }, - if (matches && matches[1]) { - return +matches[1]; - } - matches = ua.match(/Trident\/(\d+)/i); - if (matches && matches[1]) { - return tridentMap[matches[1]] || null; - } - return null; - }()), + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + // Perform concrete-hasher logic + var hash = this._doFinalize(); - stringify: function (json) { - if (typeof JSON !== 'undefined' && JSON.stringify) { - return JSON.stringify(json); - } else { - var s = '', - arr = []; + return hash; + }, - var iterate = function (json) { - var isArr = false; + blockSize: 512/32, - if (Object.prototype.toString.call(json) === '[object Array]') { - arr.push(']', '['); - isArr = true; - } else if (Object.prototype.toString.call(json) === '[object Object]') { - arr.push('}', '{'); - } + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, - for (var o in json) { - if (Object.prototype.toString.call(json[o]) === '[object Null]') { - json[o] = 'null'; - } else if (Object.prototype.toString.call(json[o]) === '[object Undefined]') { - json[o] = 'undefined'; - } + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); - if (json[o] && typeof json[o] === 'object') { - s += ',' + (isArr ? '' : '"' + o + '":' + (isArr ? '"' : '')) + iterate(json[o]) + ''; - } else { - s += ',"' + (isArr ? '' : o + '":"') + json[o] + '"'; - } - } + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; - if (s != '') { - s = s.slice(1); - } + return C; + }(Math)); - return arr.pop() + s + arr.pop(); - }; - return iterate(json); - } - }, - login: function (options) { - var options = options || {}; - var suc = options.success || EMPTYFN; - var err = options.error || EMPTYFN; - var appKey = options.appKey || ''; - var devInfos = appKey.split('#'); - if (devInfos.length !== 2) { - err({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } + return CryptoJS; - var orgName = devInfos[0]; - var appName = devInfos[1]; - var https = https || options.https; - var user = options.user || ''; - var pwd = options.pwd || ''; + })); - var apiUrl = options.apiUrl; +/***/ }, - var loginJson = { - grant_type: 'password', - username: user, - password: pwd, - timestamp: +new Date() - }; - var loginfo = utils.stringify(loginJson); +/***/ 213: +/***/ function(module, exports, __webpack_require__) { - var options = { - url: apiUrl + '/' + orgName + '/' + appName + '/token', - dataType: 'json', - data: loginfo, - success: suc, - error: err - }; - return utils.ajax(options); - }, + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - getFileUrl: function (fileInputId) { - var uri = { - url: '', - filename: '', - filetype: '', - data: '' - }; + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; - var fileObj = typeof fileInputId === 'string' ? document.getElementById(fileInputId) : fileInputId; + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; - if (!utils.isCanUploadFileAsync || !fileObj) { - return uri; - } - try { - if (window.URL.createObjectURL) { - var fileItems = fileObj.files; - if (fileItems.length > 0) { - var u = fileItems.item(0); - uri.data = u; - uri.url = window.URL.createObjectURL(u); - uri.filename = u.name || ''; - } - } else { // IE - var u = document.getElementById(fileInputId).value; - uri.url = u; - var pos1 = u.lastIndexOf('/'); - var pos2 = u.lastIndexOf('\\'); - var pos = Math.max(pos1, pos2); - if (pos < 0) - uri.filename = u; - else - uri.filename = u.substring(pos + 1); - } - var index = uri.filename.lastIndexOf('.'); - if (index != -1) { - uri.filetype = uri.filename.substring(index + 1).toLowerCase(); - } - return uri; + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } - } catch (e) { - throw e; - } - }, + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; - getFileSize: function (file) { - var fileSize = this.getFileLength(file); - if (fileSize > 10000000) { - return false; - } - var kb = Math.round(fileSize / 1000); - if (kb < 1000) { - fileSize = kb + ' KB'; - } else if (kb >= 1000) { - var mb = kb / 1000; - if (mb < 1000) { - fileSize = mb.toFixed(1) + ' MB'; - } else { - var gb = mb / 1000; - fileSize = gb.toFixed(1) + ' GB'; - } - } - return fileSize; - }, + // return X64Word.create(high, low); + // }, - getFileLength: function (file) { - var fileLength = 0; - if (file) { - if (file.files) { - if (file.files.length > 0) { - fileLength = file.files[0].size; - } - } else if (file.select && 'ActiveXObject' in window) { - file.select(); - var fileobject = new ActiveXObject('Scripting.FileSystemObject'); - var file = fileobject.GetFile(file.value); - fileLength = file.Size; - } - } - return fileLength; - }, + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; - hasFlash: _hasFlash, + // return X64Word.create(high, low); + // }, - trim: function (str) { + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; - str = typeof str === 'string' ? str : ''; + // return X64Word.create(high, low); + // }, - return str.trim - ? str.trim() - : str.replace(/^\s|\s$/g, ''); - }, + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; - parseEmoji: function (msg) { - if (typeof WebIM.Emoji === 'undefined' || typeof WebIM.Emoji.map === 'undefined') { - return msg; - } else { - var emoji = WebIM.Emoji, - reg = null; + // return X64Word.create(high, low); + // }, - for (var face in emoji.map) { - if (emoji.map.hasOwnProperty(face)) { - while (msg.indexOf(face) > -1) { - msg = msg.replace(face, ''); - } - } - } - return msg; - } - }, + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } - parseLink: function (msg) { + // return X64Word.create(high, low); + // }, - var reg = /(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-/=]*/gm; + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } - msg = msg.replace(reg, function (v) { + // return X64Word.create(high, low); + // }, - var prefix = /^https?/gm.test(v); + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, - return "" - + v - + ""; + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, - }); + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; - return msg; + // return X64Word.create(high, low); + // } + }); - }, + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; - parseJSON: function (data) { + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, - if (window.JSON && window.JSON.parse) { - return window.JSON.parse(data + ''); - } + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; - var requireNonComma, - depth = null, - str = utils.trim(data + ''); + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } - return str && !utils.trim( - str.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g - , function (token, comma, open, close) { + return X32WordArray.create(x32Words, this.sigBytes); + }, - if (requireNonComma && comma) { - depth = 0; - } + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); - if (depth === 0) { - return token; - } + // Clone "words" array + var words = clone.words = this.words.slice(0); - requireNonComma = open || comma; - depth += !close - !open; - return ''; - }) - ) - ? (Function('return ' + str))() - : (Function('Invalid JSON: ' + data))(); - }, + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } - parseUploadResponse: function (response) { - return response.indexOf('callback') > -1 ? //lte ie9 - response.slice(9, -1) : response; - }, + return clone; + } + }); + }()); - parseDownloadResponse: function (response) { - return ((response && response.type && response.type === 'application/json') - || 0 > Object.prototype.toString.call(response).indexOf('Blob')) - ? this.url + '?token=' : window.URL.createObjectURL(response); - }, - uploadFile: function (options) { - var options = options || {}; - options.onFileUploadProgress = options.onFileUploadProgress || EMPTYFN; - options.onFileUploadComplete = options.onFileUploadComplete || EMPTYFN; - options.onFileUploadError = options.onFileUploadError || EMPTYFN; - options.onFileUploadCanceled = options.onFileUploadCanceled || EMPTYFN; + return CryptoJS; - var acc = options.accessToken || this.context.accessToken; - if (!acc) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_NO_LOGIN - , id: options.id - }); - return; - } + })); - var orgName, appName, devInfos; - var appKey = options.appKey || this.context.appKey || ''; +/***/ }, - if (appKey) { - devInfos = appKey.split('#'); - orgName = devInfos[0]; - appName = devInfos[1]; - } +/***/ 214: +/***/ function(module, exports, __webpack_require__) { - if (!orgName && !appName) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR - , id: options.id - }); - return; - } + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - var apiUrl = options.apiUrl; - var uploadUrl = apiUrl + '/' + orgName + '/' + appName + '/chatfiles'; + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } - if (!utils.isCanUploadFileAsync) { - if (utils.hasFlash && typeof options.flashUpload === 'function') { - options.flashUpload && options.flashUpload(uploadUrl, options); - } else { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_BROWSER_ERROR - , id: options.id - }); - } - return; - } + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; - var fileSize = options.file.data ? options.file.data.size : undefined; - if (fileSize > WEBIM_FILESIZE_LIMIT) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR - , id: options.id - }); - return; - } else if (fileSize <= 0) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR - , id: options.id - }); - return; - } + // Reference original init + var superInit = WordArray.init; - var xhr = utils.xmlrequest(); - var onError = function (e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - }; - if (xhr.upload) { - xhr.upload.addEventListener('progress', options.onFileUploadProgress, false); - } - if (xhr.addEventListener) { - xhr.addEventListener('abort', options.onFileUploadCanceled, false); - xhr.addEventListener('load', function (e) { - try { - var json = utils.parseJSON(xhr.responseText); - try { - options.onFileUploadComplete(json); - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR - , data: e - }); - } - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - }, false); - xhr.addEventListener('error', onError, false); - } else if (xhr.onreadystatechange) { - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (ajax.status === 200) { - try { - var json = utils.parseJSON(xhr.responseText); - options.onFileUploadComplete(json); - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - } else { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - } else { - xhr.abort(); - options.onFileUploadCanceled(); - } - } - } - - xhr.open('POST', uploadUrl); + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } - xhr.setRequestHeader('restrict-access', 'true'); - xhr.setRequestHeader('Accept', '*/*');// Android QQ browser has some problem with this attribute. - xhr.setRequestHeader('Authorization', 'Bearer ' + acc); + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } - var formData = new FormData(); - formData.append('file', options.file.data); - // fix: ie8 status error - window.XDomainRequest && (xhr.readyState = 2) - xhr.send(formData); - }, + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } - download: function (options) { - options.onFileDownloadComplete = options.onFileDownloadComplete || EMPTYFN; - options.onFileDownloadError = options.onFileDownloadError || EMPTYFN; + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; - var accessToken = options.accessToken || this.context.accessToken; - if (!accessToken) { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_NO_LOGIN, - id: options.id - }); - return; - } + subInit.prototype = WordArray; + }()); - var onError = function (e) { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - }; - if (!utils.isCanDownLoadFile) { - options.onFileDownloadComplete(); - return; - } - var xhr = utils.xmlrequest(); - if ('addEventListener' in xhr) { - xhr.addEventListener('load', function (e) { - options.onFileDownloadComplete(xhr.response, xhr); - }, false); - xhr.addEventListener('error', onError, false); - } else if ('onreadystatechange' in xhr) { - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (ajax.status === 200) { - options.onFileDownloadComplete(xhr.response, xhr); - } else { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - } - } else { - xhr.abort(); - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - } - } - } + return CryptoJS.lib.WordArray; - var method = options.method || 'GET'; - var resType = options.responseType || 'blob'; - var mimeType = options.mimeType || 'text/plain; charset=x-user-defined'; - xhr.open(method, options.url); - if (typeof Blob !== 'undefined') { - xhr.responseType = resType; - } else { - xhr.overrideMimeType(mimeType); - } + })); - var innerHeaer = { - 'X-Requested-With': 'XMLHttpRequest', - 'Accept': 'application/octet-stream', - 'share-secret': options.secret, - 'Authorization': 'Bearer ' + accessToken - }; - var headers = options.headers || {}; - for (var key in headers) { - innerHeaer[key] = headers[key]; - } - for (var key in innerHeaer) { - if (innerHeaer[key]) { - xhr.setRequestHeader(key, innerHeaer[key]); - } - } - // fix: ie8 status error - window.XDomainRequest && (xhr.readyState = 2) - xhr.send(null); - }, +/***/ }, - parseTextMessage: function (message, faces) { - if (typeof message !== 'string') { - return; - } +/***/ 215: +/***/ function(module, exports, __webpack_require__) { - if (Object.prototype.toString.call(faces) !== '[object Object]') { - return { - isemoji: false, - body: [ - { - type: 'txt', - data: message - } - ] - }; - } + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - var receiveMsg = message; - var emessage = []; - var expr = /\[[^[\]]{2,3}\]/mg; - var emoji = receiveMsg.match(expr); + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; - if (!emoji || emoji.length < 1) { - return { - isemoji: false, - body: [ - { - type: 'txt', - data: message - } - ] - }; - } - var isemoji = false; - for (var i = 0; i < emoji.length; i++) { - var tmsg = receiveMsg.substring(0, receiveMsg.indexOf(emoji[i])), - existEmoji = WebIM.Emoji.map[emoji[i]]; + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; - if (tmsg) { - emessage.push({ - type: 'txt', - data: tmsg - }); - } - if (!existEmoji) { - emessage.push({ - type: 'txt', - data: emoji[i] - }); - continue; - } - var emojiStr = WebIM.Emoji.map ? WebIM.Emoji.path + existEmoji : null; + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } - if (emojiStr) { - isemoji = true; - emessage.push({ - type: 'emoji', - data: emojiStr - }); - } else { - emessage.push({ - type: 'txt', - data: emoji[i] - }); - } - var restMsgIndex = receiveMsg.indexOf(emoji[i]) + emoji[i].length; - receiveMsg = receiveMsg.substring(restMsgIndex); - } - if (receiveMsg) { - emessage.push({ - type: 'txt', - data: receiveMsg - }); - } - if (isemoji) { - return { - isemoji: isemoji, - body: emessage - }; - } - return { - isemoji: false, - body: [ - { - type: 'txt', - data: message - } - ] - }; - }, + return utf16Chars.join(''); + }, - parseUri: function () { - var pattern = /([^\?|&])\w+=([^&]+)/g; - var uri = {}; - if (window.location.search) { - var args = window.location.search.match(pattern); - for (var i in args) { - var str = args[i]; - var eq = str.indexOf('='); - var key = str.substr(0, eq); - var value = str.substr(eq + 1); - uri[key] = value; - } - } - return uri; - }, + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; - parseHrefHash: function () { - var pattern = /([^\#|&])\w+=([^&]+)/g; - var uri = {}; - if (window.location.hash) { - var args = window.location.hash.match(pattern); - for (var i in args) { - var str = args[i]; - var eq = str.indexOf('='); - var key = str.substr(0, eq); - var value = str.substr(eq + 1); - uri[key] = value; - } - } - return uri; - }, + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } - xmlrequest: _xmlrequest, + return WordArray.create(words, utf16StrLength * 2); + } + }; + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; - getXmlFirstChild: function (data, tagName) { - var children = data.getElementsByTagName(tagName); - if (children.length == 0) { - return null; - } else { - return children[0]; - } - }, - ajax: function (options) { - var dataType = options.dataType || 'text'; - var suc = options.success || EMPTYFN; - var error = options.error || EMPTYFN; - var xhr = utils.xmlrequest(); + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - var status = xhr.status || 0; - if (status === 200) { - try { - switch (dataType) { - case 'text': - suc(xhr.responseText); - return; - case 'json': - var json = utils.parseJSON(xhr.responseText); - suc(json, xhr); - return; - case 'xml': - if (xhr.responseXML && xhr.responseXML.documentElement) { - suc(xhr.responseXML.documentElement, xhr); - } else { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - } - return; - } - suc(xhr.response || xhr.responseText, xhr); - } catch (e) { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: e - }); - } - return; - } else { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - return; - } - } - if (xhr.readyState === 0) { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - } - }; + return utf16Chars.join(''); + }, - if (options.responseType) { - if (xhr.responseType) { - xhr.responseType = options.responseType; - } - } - if (options.mimeType) { - if (utils.hasOverrideMimeType) { - xhr.overrideMimeType(options.mimeType); - } - } + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; - var type = options.type || 'POST', - data = options.data || null, - tempData = ''; + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } - if (type.toLowerCase() === 'get' && data) { - for (var o in data) { - if (data.hasOwnProperty(o)) { - tempData += o + '=' + data[o] + '&'; - } - } - tempData = tempData ? tempData.slice(0, -1) : tempData; - options.url += (options.url.indexOf('?') > 0 ? '&' : '?') + (tempData ? tempData + '&' : tempData) + '_v=' + new Date().getTime(); - data = null; - tempData = null; - } - xhr.open(type, options.url, utils.isCanSetRequestHeader); + return WordArray.create(words, utf16StrLength * 2); + } + }; - if (utils.isCanSetRequestHeader) { - var headers = options.headers || {}; - for (var key in headers) { - if (headers.hasOwnProperty(key)) { - xhr.setRequestHeader(key, headers[key]); - } - } - } - // fix: ie8 status error - window.XDomainRequest && (xhr.readyState = 2) - xhr.send(data); - return xhr; - }, - ts: function () { - var d = new Date(); - var Hours = d.getHours(); //获取当前小时数(0-23) - var Minutes = d.getMinutes(); //获取当前分钟数(0-59) - var Seconds = d.getSeconds(); //获取当前秒数(0-59) - var Milliseconds = d.getMilliseconds(); //获取当前毫秒 - return (Hours < 10 ? "0" + Hours : Hours) + ':' + (Minutes < 10 ? "0" + Minutes : Minutes) + ':' + (Seconds < 10 ? "0" + Seconds : Seconds) + ':' + Milliseconds + ' '; - }, + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); - getObjectKey: function (obj, val) { - for (var key in obj) { - if (obj[key] == val) { - return key; - } - } - return ''; - }, - sprintf: function () { - var arg = arguments, - str = arg[0] || '', - i, len; - for (i = 1, len = arg.length; i < len; i++) { - str = str.replace(/%s/, arg[i]); - } - return str; - }, + return CryptoJS.enc.Utf16; - setCookie: function (name, value, days) { - var cookie = name + '=' + encodeURIComponent(value); - if (typeof days == 'number') { - cookie += '; max-age: ' + (days * 60 * 60 * 24); - } - document.cookie = cookie; - }, + })); - getCookie: function () { - var allCookie = {}; - var all = document.cookie; - if (all === "") { - return allCookie; - } - var list = all.split("; "); - for (var i = 0; i < list.length; i++) { - var cookie = list[i]; - var p = cookie.indexOf('='); - var name = cookie.substring(0, p); - var value = cookie.substring(p + 1); - value = decodeURIComponent(value); - allCookie[name] = value; - } - return allCookie; - } - }; +/***/ }, +/***/ 216: +/***/ function(module, exports, __webpack_require__) { - exports.utils = utils; - }()); + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; - var CryptoJS = __webpack_require__(5); - ;(function () { - 'use strict'; + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; - var _utils = __webpack_require__(3).utils; - var Message = function (type, id) { - if (!this instanceof Message) { - return new Message(type); - } + // Clamp excess bits + wordArray.clamp(); - this._msg = {}; + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - if (typeof Message[type] === 'function') { - Message[type].prototype.setGroup = this.setGroup; - this._msg = new Message[type](id); - } - return this._msg; - } - Message.prototype.setGroup = function (group) { - this.body.group = group; - } + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - /* - * Read Message - */ - Message.read = function (id) { - this.id = id; - this.type = 'read'; - }; + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } - Message.read.prototype.set = function (opt) { - this.body = { - ackId: opt.id - , to: opt.to - } - }; + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } - /* - * deliver message - */ - Message.delivery = function (id) { - this.id = id; - this.type = 'delivery'; - }; + return base64Chars.join(''); + }, - Message.delivery.prototype.set = function (opt) { - this.body = { - bodyId: opt.id - , to: opt.to - }; - }; + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; - /* - * text message - */ - Message.txt = function (id) { - this.id = id; - this.type = 'txt'; - this.body = {}; - }; - Message.txt.prototype.set = function (opt) { - this.value = opt.msg; - this.body = { - id: this.id - , to: opt.to - , msg: this.value - , type: this.type - , roomType: opt.roomType - , ext: opt.ext || {} - , success: opt.success - , fail: opt.fail - }; + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } - !opt.roomType && delete this.body.roomType; + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } - }; + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); - /* - * cmd message - */ - Message.cmd = function (id) { - this.id = id; - this.type = 'cmd'; - this.body = {}; - }; - Message.cmd.prototype.set = function (opt) { - this.value = ''; + }, - this.body = { - to: opt.to - , action: opt.action - , msg: this.value - , type: this.type - , roomType: opt.roomType - , ext: opt.ext || {} - , success: opt.success - }; - !opt.roomType && delete this.body.roomType; - }; + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; - /* - * loc message - */ - Message.location = function (id) { - this.id = id; - this.type = 'loc'; - this.body = {}; - }; - Message.location.prototype.set = function (opt) { - this.body = { - to: opt.to - , type: this.type - , roomType: opt.roomType - , addr: opt.addr - , lat: opt.lat - , lng: opt.lng - , ext: opt.ext || {} - }; - }; + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); - /* - * img message - */ - Message.img = function (id) { - this.id = id; - this.type = 'img'; - this.body = {}; - }; - Message.img.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - this.value = opt.file; + return CryptoJS.enc.Base64; - this.body = { - id: this.id, - file: this.value, - apiUrl: opt.apiUrl, - to: opt.to, - type: this.type, - ext: opt.ext || {}, - roomType: opt.roomType, - onFileUploadError: opt.onFileUploadError, - onFileUploadComplete: opt.onFileUploadComplete, - success: opt.success, - fail: opt.fail, - flashUpload: opt.flashUpload, - width: opt.width, - height: opt.height, - body: opt.body, - uploadError: opt.uploadError, - uploadComplete: opt.uploadComplete - }; + })); - !opt.roomType && delete this.body.roomType; - }; +/***/ }, - /* - * audio message - */ - Message.audio = function (id) { - this.id = id; - this.type = 'audio'; - this.body = {}; - }; - Message.audio.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); +/***/ 217: +/***/ function(module, exports, __webpack_require__) { - this.value = opt.file; - this.filename = opt.filename || this.value.filename; + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - this.body = { - id: this.id - , file: this.value - , filename: this.filename - , apiUrl: opt.apiUrl - , to: opt.to - , type: this.type - , ext: opt.ext || {} - , length: opt.length || 0 - , roomType: opt.roomType - , file_length: opt.file_length - , onFileUploadError: opt.onFileUploadError - , onFileUploadComplete: opt.onFileUploadComplete - , success: opt.success - , fail: opt.fail - , flashUpload: opt.flashUpload - , body: opt.body - }; - !opt.roomType && delete this.body.roomType; - }; + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; - /* - * file message - */ - Message.file = function (id) { - this.id = id; - this.type = 'file'; - this.body = {}; - }; - Message.file.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); + // Constants table + var T = []; - this.value = opt.file; - this.filename = opt.filename || this.value.filename; + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); - this.body = { - id: this.id - , file: this.value - , filename: this.filename - , apiUrl: opt.apiUrl - , to: opt.to - , type: this.type - , ext: opt.ext || {} - , roomType: opt.roomType - , onFileUploadError: opt.onFileUploadError - , onFileUploadComplete: opt.onFileUploadComplete - , success: opt.success - , fail: opt.fail - , flashUpload: opt.flashUpload - , body: opt.body - }; - !opt.roomType && delete this.body.roomType; - }; + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, - /* - * video message - */ - Message.video = function (id) { + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; - }; - Message.video.prototype.set = function (opt) { + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } - }; + // Shortcuts + var H = this._hash.words; - var _Message = function (message) { + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; - if (!this instanceof _Message) { - return new _Message(message, conn); - } + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; - this.msg = message; - }; + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); - _Message.prototype.send = function (conn) { - var me = this; + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); - var _send = function (message) { + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); - message.ext = message.ext || {}; - message.ext.weichat = message.ext.weichat || {}; - message.ext.weichat.originType = message.ext.weichat.originType || 'webim'; + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); - var dom; - var json = { - from: conn.context.userId || '' - , to: message.to - , bodies: [message.body] - , ext: message.ext || {} - }; - var jsonstr = _utils.stringify(json); - dom = $msg({ - type: message.group || 'chat' - , to: message.toJid - , id: message.id - , xmlns: 'jabber:client' - }).c('body').t(jsonstr); + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, - if (message.roomType) { - dom.up().c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); - } - if (message.bodyId) { - dom = $msg({ - from: conn.context.jid || '' - , to: message.toJid - , id: message.id - , xmlns: 'jabber:client' - }).c('body').t(message.bodyId); - var delivery = { - xmlns: 'urn:xmpp:receipts' - , id: message.bodyId - }; - dom.up().c('delivery', delivery); - } - if (message.ackId) { + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; - if (conn.context.jid.indexOf(message.toJid) >= 0) { - return; - } - dom = $msg({ - from: conn.context.jid || '' - , to: message.toJid - , id: message.id - , xmlns: 'jabber:client' - }).c('body').t(message.ackId); - var read = { - xmlns: 'urn:xmpp:receipts' - , id: message.ackId - }; - dom.up().c('acked', read); - } + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; - setTimeout(function () { - if (typeof _msgHash !== 'undefined' && _msgHash[message.id]) { - _msgHash[message.id].msg.fail instanceof Function - && _msgHash[message.id].msg.fail(message.id); - } - }, 60000); - conn.sendCommand(dom.tree(), message.id); - }; + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); - if (me.msg.file) { - if (me.msg.body && me.msg.body.url) {// Only send msg - _send(me.msg); - return; - } - var _tmpComplete = me.msg.onFileUploadComplete; - var _complete = function (data) { - if (data.entities[0]['file-metadata']) { - var file_len = data.entities[0]['file-metadata']['content-length']; - // me.msg.file_length = file_len; - me.msg.filetype = data.entities[0]['file-metadata']['content-type']; - if (file_len > 204800) { - me.msg.thumbnail = true; - } - } + data.sigBytes = (dataWords.length + 1) * 4; - me.msg.body = { - type: me.msg.type || 'file' - , - url: ((location.protocol != 'https:' && conn.isHttpDNS) ? (conn.apiUrl + data.uri.substr(data.uri.indexOf("/", 9))) : data.uri) + '/' + data.entities[0]['uuid'] - , secret: data.entities[0]['share-secret'] - , filename: me.msg.file.filename || me.msg.filename - , size: { - width: me.msg.width || 0 - , height: me.msg.height || 0 - } - , length: me.msg.length || 0 - , file_length: me.msg.ext.file_length || 0 - , filetype: me.msg.filetype - } - _send(me.msg); - _tmpComplete instanceof Function && _tmpComplete(data, me.msg.id); - }; + // Hash final blocks + this._process(); - me.msg.onFileUploadComplete = _complete; - _utils.uploadFile.call(conn, me.msg); - } else { - me.msg.body = { - type: me.msg.type === 'chat' ? 'txt' : me.msg.type - , msg: me.msg.msg - }; - if (me.msg.type === 'cmd') { - me.msg.body.action = me.msg.action; - } else if (me.msg.type === 'loc') { - me.msg.body.addr = me.msg.addr; - me.msg.body.lat = me.msg.lat; - me.msg.body.lng = me.msg.lng; - } + // Shortcuts + var hash = this._hash; + var H = hash.words; - _send(me.msg); - } - }; + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; - exports._msg = _Message; - exports.message = Message; - }()); + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + // Return final computed hash + return hash; + }, -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(8), __webpack_require__(9), __webpack_require__(10), __webpack_require__(11), __webpack_require__(12), __webpack_require__(13), __webpack_require__(14), __webpack_require__(15), __webpack_require__(16), __webpack_require__(17), __webpack_require__(18), __webpack_require__(19), __webpack_require__(20), __webpack_require__(21), __webpack_require__(22), __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(26), __webpack_require__(27), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory); - } - else { - // Global (browser) - root.CryptoJS = factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); - return CryptoJS; + + return CryptoJS.MD5; })); -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 218: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(); + module.exports = exports = factory(__webpack_require__(212)); } else if (typeof define === "function" && define.amd) { // AMD - define([], factory); + define(["./core"], factory); } else { // Global (browser) - root.CryptoJS = factory(); + factory(root.CryptoJS); } - }(this, function () { + }(this, function (CryptoJS) { - /** - * CryptoJS core components. - */ - var CryptoJS = CryptoJS || (function (Math, undefined) { - /* - * Local polyfil of Object.create + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. */ - var create = Object.create || (function () { - function F() {}; + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, - return function (obj) { - var subtype; + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; - F.prototype = obj; + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; - subtype = new F(); + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } - F.prototype = null; + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } - return subtype; - }; - }()) + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } - /** - * CryptoJS namespace. - */ - var C = {}; + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); /** - * Library namespace. + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); */ - var C_lib = C.lib = {}; + C.SHA1 = Hasher._createHelper(SHA1); /** - * Base object for prototypal inheritance. + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); */ - var Base = C_lib.Base = (function () { - - - return { - /** - * Creates a new object that inherits from this object. - * - * @param {Object} overrides Properties to copy into the new object. - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * field: 'value', - * - * method: function () { - * } - * }); - */ - extend: function (overrides) { - // Spawn - var subtype = create(this); + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); - // Augment - if (overrides) { - subtype.mixIn(overrides); - } - // Create default initializer - if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { - subtype.init = function () { - subtype.$super.init.apply(this, arguments); - }; - } + return CryptoJS.SHA1; - // Initializer's prototype is the subtype object - subtype.init.prototype = subtype; + })); - // Reference supertype - subtype.$super = this; +/***/ }, - return subtype; - }, +/***/ 219: +/***/ function(module, exports, __webpack_require__) { - /** - * Extends this object and runs the init method. - * Arguments to create() will be passed to init(). - * - * @return {Object} The new object. - * - * @static - * - * @example - * - * var instance = MyType.create(); - */ - create: function () { - var instance = this.extend(); - instance.init.apply(instance, arguments); + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - return instance; - }, + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; - /** - * Initializes a newly created object. - * Override this method to add some logic when your objects are created. - * - * @example - * - * var MyType = CryptoJS.lib.Base.extend({ - * init: function () { - * // ... - * } - * }); - */ - init: function () { - }, + // Initialization and round constants tables + var H = []; + var K = []; - /** - * Copies properties into this object. - * - * @param {Object} properties The properties to mix in. - * - * @example - * - * MyType.mixIn({ - * field: 'value' - * }); - */ - mixIn: function (properties) { - for (var propertyName in properties) { - if (properties.hasOwnProperty(propertyName)) { - this[propertyName] = properties[propertyName]; - } + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; } + } - // IE won't copy toString using the loop above - if (properties.hasOwnProperty('toString')) { - this.toString = properties.toString; + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); } - }, + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = instance.clone(); - */ - clone: function () { - return this.init.prototype.extend(this); + nPrime++; } - }; + + n++; + } }()); + // Reusable object + var W = []; + /** - * An array of 32-bit words. - * - * @property {Array} words The array of 32-bit words. - * @property {number} sigBytes The number of significant bytes in this word array. + * SHA-256 hash algorithm. */ - var WordArray = C_lib.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of 32-bit words. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.create(); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); - * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 4; - } + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); }, - /** - * Converts this word array to a string. - * - * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex - * - * @return {string} The stringified word array. - * - * @example - * - * var string = wordArray + ''; - * var string = wordArray.toString(); - * var string = wordArray.toString(CryptoJS.enc.Utf8); - */ - toString: function (encoder) { - return (encoder || Hex).stringify(this); - }, + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; - /** - * Concatenates a word array to this word array. - * - * @param {WordArray} wordArray The word array to append. - * - * @return {WordArray} This word array. - * - * @example - * - * wordArray1.concat(wordArray2); - */ - concat: function (wordArray) { - // Shortcuts - var thisWords = this.words; - var thatWords = wordArray.words; - var thisSigBytes = this.sigBytes; - var thatSigBytes = wordArray.sigBytes; + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; - // Clamp excess bits - this.clamp(); + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); - // Concat - if (thisSigBytes % 4) { - // Copy one byte at a time - for (var i = 0; i < thatSigBytes; i++) { - var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var i = 0; i < thatSigBytes; i += 4) { - thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; } - this.sigBytes += thatSigBytes; - // Chainable - return this; + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; }, - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { + _doFinalize: function () { // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, + var data = this._data; + var dataWords = data.words; - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; - var r = (function (m_w) { - var m_w = m_w; - var m_z = 0x3ade68b1; - var mask = 0xffffffff; + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; - return function () { - m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; - m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; - var result = ((m_z << 0x10) + m_w) & mask; - result /= 0x100000000; - result += 0.5; - return result * (Math.random() > .5 ? 1 : -1); - } - }); + // Hash final blocks + this._process(); - for (var i = 0, rcache; i < nBytes; i += 4) { - var _r = r((rcache || Math.random()) * 0x100000000); + // Return final computed hash + return this._hash; + }, - rcache = _r() * 0x3ade67b7; - words.push((_r() * 0x100000000) | 0); - } + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); - return new WordArray.init(words, nBytes); + return clone; } }); /** - * Encoder namespace. + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); */ - var C_enc = C.enc = {}; + C.SHA256 = Hasher._createHelper(SHA256); /** - * Hex encoding strategy. + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - return hexChars.join(''); - }, + return CryptoJS.SHA256; - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; + })); - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } +/***/ }, - return new WordArray.init(words, hexStrLength / 2); - } - }; +/***/ 220: +/***/ function(module, exports, __webpack_require__) { - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(219)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./sha256"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; - return latin1Chars.join(''); + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); }, - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } + hash.sigBytes -= 4; - return new WordArray.init(words, latin1StrLength); + return hash; } - }; + }); /** - * UTF-8 encoding strategy. + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; + C.SHA224 = SHA256._createHelper(SHA224); /** - * Abstract buffered block algorithm template. + * Shortcut function to the HMAC's object interface. * - * The property blockSize must be implemented in a concrete subtype. + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, + return CryptoJS.SHA224; - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; + })); - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } +/***/ }, - // Count words ready - var nWordsReady = nBlocksReady * blockSize; +/***/ 221: +/***/ function(module, exports, __webpack_require__) { - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(213)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./x64-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; - // Remove processed words - var processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); - return clone; + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); }, - _minBufferSize: 0 - }); + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; - // Perform concrete-hasher logic - this._doReset(); - }, + // Rounds + for (var i = 0; i < 80; i++) { + // Shortcut + var Wi = W[i]; - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); + // Extend message + if (i < 16) { + var Wih = Wi.high = M[offset + i * 2] | 0; + var Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); - // Update the hash - this._process(); + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); - // Chainable - return this; - }, + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; - // Perform concrete-hasher logic - var hash = this._doFinalize(); + var Wil = gamma0l + Wi7l; + var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + var Wil = Wil + gamma1l; + var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + var Wil = Wil + Wi16l; + var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); - return hash; - }, + Wi.high = Wih; + Wi.low = Wil; + } - blockSize: 512/32, + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - return C; - }(Math)); + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } - return CryptoJS; + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, - })); + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; - ;(function (root, factory) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + return CryptoJS.SHA512; + + })); + +/***/ }, + +/***/ 222: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(213), __webpack_require__(221)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./x64-core", "./sha512"], factory); } else { // Global (browser) @@ -6504,385 +5167,413 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function (undefined) { + (function () { // Shortcuts var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; /** - * x64 namespace. + * SHA-384 hash algorithm. */ - var C_x64 = C.x64 = {}; + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); /** - * A 64-bit word. + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); */ - var X64Word = C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } + C.SHA384 = SHA512._createHelper(SHA384); - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); - // return X64Word.create(high, low); - // }, - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; + return CryptoJS.SHA384; - // return X64Word.create(high, low); - // }, + })); - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; +/***/ }, - // return X64Word.create(high, low); - // }, +/***/ 223: +/***/ function(module, exports, __webpack_require__) { - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(213)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./x64-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // return X64Word.create(high, low); - // }, + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; - // return X64Word.create(high, low); - // }, + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } - // return X64Word.create(high, low); - // }, + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } - // return X64Word.create(high, low); - // } - }); + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. + * SHA-3 hash algorithm. */ - var X64WordArray = C_x64.WordArray = Base.extend({ + var SHA3 = C_algo.SHA3 = Hasher.extend({ /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); + * Configuration options. * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 */ - init: function (words, sigBytes) { - words = this.words = words || []; + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), - if (sigBytes != undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; }, - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { + _doProcessBlock: function (M, offset) { // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; - // Clone "words" array - var words = clone.words = this.words.slice(0); + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; } - return clone; - } - }); - }()); - - - return CryptoJS; - - })); + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; - ;(function (root, factory) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } - (function () { - // Check if typed arrays are supported - if (typeof ArrayBuffer != 'function') { - return; - } + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; + // Rotate lanes + if (rhoOffset < 32) { + var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } - // Reference original init - var superInit = WordArray.init; + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } - // Augment WordArray.init to handle typed arrays - var subInit = WordArray.init = function (typedArray) { - // Convert buffers to uint8 - if (typedArray instanceof ArrayBuffer) { - typedArray = new Uint8Array(typedArray); - } + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; - // Convert other array views to uint8 - if ( - typedArray instanceof Int8Array || - (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || - typedArray instanceof Int16Array || - typedArray instanceof Uint16Array || - typedArray instanceof Int32Array || - typedArray instanceof Uint32Array || - typedArray instanceof Float32Array || - typedArray instanceof Float64Array - ) { - typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); - } + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - // Handle Uint8Array - if (typedArray instanceof Uint8Array) { - // Shortcut - var typedArrayByteLength = typedArray.byteLength; + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } - // Extract bytes - var words = []; - for (var i = 0; i < typedArrayByteLength; i++) { - words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low;; } + }, - // Initialize this word array - superInit.call(this, words, typedArrayByteLength); - } else { - // Else call normal init - superInit.apply(this, arguments); + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; } - }; + }); - subInit.prototype = WordArray; - }()); + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); - return CryptoJS.lib.WordArray; + return CryptoJS.SHA3; })); -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 224: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212)); } else if (typeof define === "function" && define.amd) { // AMD @@ -6894,293 +5585,421 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function () { + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; - var C_enc = C.enc; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.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]); + var _zr = WordArray.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]); + var _sl = WordArray.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 ]); + var _sr = WordArray.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 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); /** - * UTF-16 BE encoding strategy. + * RIPEMD160 hash algorithm. */ - var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { - /** - * Converts a word array to a UTF-16 BE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 BE string. - * - * @static - * - * @example - * - * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; - utf16Chars.push(String.fromCharCode(codePoint)); - } + _doProcessBlock: function (M, offset) { - return utf16Chars.join(''); - }, + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; - /** - * Converts a UTF-16 BE string to a word array. - * - * @param {string} utf16Str The UTF-16 BE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); - */ - parse: function (utf16Str) { + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } // Shortcut - var utf16StrLength = utf16Str.length; + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, - return WordArray.create(words, utf16StrLength * 2); - } - }; + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); - /** - * UTF-16 LE encoding strategy. - */ - C_enc.Utf16LE = { - /** - * Converts a word array to a UTF-16 LE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 LE string. - * - * @static - * - * @example - * - * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); - */ - stringify: function (wordArray) { // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; + var hash = this._hash; + var H = hash.words; - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); - utf16Chars.push(String.fromCharCode(codePoint)); + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); } - return utf16Chars.join(''); + // Return final computed hash + return hash; }, - /** - * Converts a UTF-16 LE string to a word array. - * - * @param {string} utf16Str The UTF-16 LE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); - } + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); - return WordArray.create(words, utf16StrLength * 2); + return clone; } - }; + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); - function swapEndian(word) { - return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); } - }()); + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } - return CryptoJS.enc.Utf16; + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } - })); + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); - ;(function (root, factory) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + } + + function rotl(x,n) { + return (x<>>(32-n)); + } - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; /** - * Base64 encoding strategy. + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); */ - var Base64 = C_enc.Base64 = { + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + return CryptoJS.RIPEMD160; + + })); + +/***/ }, + +/***/ 225: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. + * Initializes a newly created HMAC. * - * @static + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. * * @example * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); */ - stringify: function (wordArray) { + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; - // Clamp excess bits - wordArray.clamp(); + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + // Clamp excess bits + key.clamp(); - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; - return base64Chars.join(''); + // Set initial values + this.reset(); }, /** - * Converts a Base64 string to a word array. + * Resets this HMAC to its initial state. * - * @param {string} base64Str The Base64 string. + * @example * - * @return {WordArray} The word array. + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. * - * @static + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. * * @example * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + // Chainable + return this; }, - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + return hmac; + } + }); + }()); - return CryptoJS.enc.Base64; })); -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, - ;(function (root, factory) { +/***/ 226: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(218), __webpack_require__(225)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./sha1", "./hmac"], factory); } else { // Global (browser) @@ -7188,272 +6007,150 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function (Math) { + (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; + var Base = C_lib.Base; var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; /** - * MD5 hash algorithm. + * Password-Based Key Derivation Function 2 algorithm. */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working varialbes - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); - _doFinalize: function () { // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); - data.sigBytes = (dataWords.length + 1) * 4; + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; - // Hash final blocks - this._process(); + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); - // Shortcuts - var hash = this._hash; - var H = hash.words; + // Shortcut + var intermediateWords = intermediate.words; - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + derivedKey.concat(block); + blockIndexWords[0]++; } + derivedKey.sigBytes = keySize * 4; - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; + return derivedKey; } }); - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - /** - * Shortcut function to the hasher's object interface. + * Computes the Password-Based Key Derivation Function 2. * - * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. * - * @return {WordArray} The hash. + * @return {WordArray} The derived key. * * @static * * @example * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); - return CryptoJS.MD5; + return CryptoJS.PBKDF2; })); -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, - ;(function (root, factory) { +/***/ 227: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(218), __webpack_require__(225)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./sha1", "./hmac"], factory); } else { // Global (browser) @@ -7465,150 +6162,133 @@ return /******/ (function(modules) { // webpackBootstrap // Shortcuts var C = CryptoJS; var C_lib = C.lib; + var Base = C_lib.Base; var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; var C_algo = C.algo; - - // Reusable object - var W = []; + var MD5 = C_algo.MD5; /** - * SHA-1 hash algorithm. + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html */ - var SHA1 = C_algo.SHA1 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476, - 0xc3d2e1f0 - ]); + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); }, - _doProcessBlock: function (M, offset) { + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - // Computation - for (var i = 0; i < 80; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = (n << 1) | (n >>> 31); - } - - var t = ((a << 5) | (a >>> 27)) + e + W[i]; - if (i < 20) { - t += ((b & c) | (~b & d)) + 0x5a827999; - } else if (i < 40) { - t += (b ^ c ^ d) + 0x6ed9eba1; - } else if (i < 60) { - t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; - } else /* if (i < 80) */ { - t += (b ^ c ^ d) - 0x359d3e2a; - } + var cfg = this.cfg; - e = d; - d = c; - c = (b << 30) | (b >>> 2); - b = a; - a = t; - } + // Init hasher + var hasher = cfg.hasher.create(); - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - }, + // Initial values + var derivedKey = WordArray.create(); - _doFinalize: function () { // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; - // Hash final blocks - this._process(); + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + var block = hasher.update(password).finalize(salt); + hasher.reset(); - // Return final computed hash - return this._hash; - }, + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; - return clone; + return derivedKey; } }); /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA1('message'); - * var hash = CryptoJS.SHA1(wordArray); - */ - C.SHA1 = Hasher._createHelper(SHA1); - - /** - * Shortcut function to the HMAC's object interface. + * Derives a key from a password. * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. * - * @return {WordArray} The HMAC. + * @return {WordArray} The derived key. * * @static * * @example * - * var hmac = CryptoJS.HmacSHA1(message, key); + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); */ - C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; }()); - return CryptoJS.SHA1; + return CryptoJS.EvpKDF; })); -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, - ;(function (root, factory) { +/***/ 228: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(227)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./evpkdf"], factory); } else { // Global (browser) @@ -7616,1032 +6296,969 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function (Math) { + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; + var Base = C_lib.Base; var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; - // Initialization and round constants tables - var H = []; - var K = []; - - // Compute constants - (function () { - function isPrime(n) { - var sqrtN = Math.sqrt(n); - for (var factor = 2; factor <= sqrtN; factor++) { - if (!(n % factor)) { - return false; - } - } + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), - return true; - } + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, - function getFractionalBits(n) { - return ((n - (n | 0)) * 0x100000000) | 0; - } + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, - var n = 2; - var nPrime = 0; - while (nPrime < 64) { - if (isPrime(n)) { - if (nPrime < 8) { - H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); - } - K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); - nPrime++; - } + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; - n++; - } - }()); + // Set initial values + this.reset(); + }, - // Reusable object - var W = []; + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); - /** - * SHA-256 hash algorithm. - */ - var SHA256 = C_algo.SHA256 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init(H.slice(0)); + // Perform concrete-cipher logic + this._doReset(); }, - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - var f = H[5]; - var g = H[6]; - var h = H[7]; + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); - // Computation - for (var i = 0; i < 64; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var gamma0x = W[i - 15]; - var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ - ((gamma0x << 14) | (gamma0x >>> 18)) ^ - (gamma0x >>> 3); + // Process available blocks + return this._process(); + }, - var gamma1x = W[i - 2]; - var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ - ((gamma1x << 13) | (gamma1x >>> 19)) ^ - (gamma1x >>> 10); + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } - W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; - } + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); - var ch = (e & f) ^ (~e & g); - var maj = (a & b) ^ (a & c) ^ (b & c); + return finalProcessedData; + }, - var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); - var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + keySize: 128/32, - var t1 = h + sigma1 + ch + K[i] + W[i]; - var t2 = sigma0 + maj; + ivSize: 128/32, - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } + _ENC_XFORM_MODE: 1, - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - H[5] = (H[5] + f) | 0; - H[6] = (H[6] + g) | 0; - H[7] = (H[7] + h) | 0; - }, + _DEC_XFORM_MODE: 2, - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); - // Hash final blocks - this._process(); + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); - // Return final computed hash - return this._hash; + return finalProcessedBlocks; }, - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } + blockSize: 1 }); /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA256('message'); - * var hash = CryptoJS.SHA256(wordArray); + * Mode namespace. */ - C.SHA256 = Hasher._createHelper(SHA256); + var C_mode = C.mode = {}; /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA256(message, key); + * Abstract base block cipher mode template. */ - C.HmacSHA256 = Hasher._createHmacHelper(SHA256); - }(Math)); + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, - return CryptoJS.SHA256; + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); - })); + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(13)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./sha256"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA256 = C_algo.SHA256; + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); - /** - * SHA-224 hash algorithm. - */ - var SHA224 = C_algo.SHA224 = SHA256.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - ]); - }, + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; - _doFinalize: function () { - var hash = SHA256._doFinalize.call(this); + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); - hash.sigBytes -= 4; + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); - return hash; + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + var block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + var block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } } - }); + + return CBC; + }()); /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA224('message'); - * var hash = CryptoJS.SHA224(wordArray); + * Padding namespace. */ - C.SHA224 = SHA256._createHelper(SHA224); + var C_pad = C.pad = {}; /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA224(message, key); + * PKCS #5/7 padding strategy. */ - C.HmacSHA224 = SHA256._createHmacHelper(SHA224); - }()); + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - return CryptoJS.SHA224; + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; - })); + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { + // Add padding + data.concat(padding); + }, - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(7)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./x64-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - - function X64Word_create() { - return X64Word.create.apply(X64Word, arguments); - } - - // Constants - var K = [ - X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), - X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), - X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), - X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), - X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), - X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), - X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), - X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), - X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), - X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), - X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), - X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), - X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), - X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), - X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), - X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), - X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), - X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), - X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), - X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), - X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), - X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), - X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), - X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), - X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), - X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), - X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), - X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), - X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), - X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), - X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), - X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), - X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), - X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), - X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), - X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), - X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), - X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), - X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), - X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) - ]; + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - // Reusable objects - var W = []; - (function () { - for (var i = 0; i < 80; i++) { - W[i] = X64Word_create(); + // Remove padding + data.sigBytes -= nPaddingBytes; } - }()); + }; /** - * SHA-512 hash algorithm. + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) */ - var SHA512 = C_algo.SHA512 = Hasher.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), - new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), - new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), - new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var H = this._hash.words; - - var H0 = H[0]; - var H1 = H[1]; - var H2 = H[2]; - var H3 = H[3]; - var H4 = H[4]; - var H5 = H[5]; - var H6 = H[6]; - var H7 = H[7]; + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), - var H0h = H0.high; - var H0l = H0.low; - var H1h = H1.high; - var H1l = H1.low; - var H2h = H2.high; - var H2l = H2.low; - var H3h = H3.high; - var H3l = H3.low; - var H4h = H4.high; - var H4l = H4.low; - var H5h = H5.high; - var H5l = H5.low; - var H6h = H6.high; - var H6l = H6.low; - var H7h = H7.high; - var H7l = H7.low; + reset: function () { + // Reset cipher + Cipher.reset.call(this); - // Working variables - var ah = H0h; - var al = H0l; - var bh = H1h; - var bl = H1l; - var ch = H2h; - var cl = H2l; - var dh = H3h; - var dl = H3l; - var eh = H4h; - var el = H4l; - var fh = H5h; - var fl = H5l; - var gh = H6h; - var gl = H6l; - var hh = H7h; - var hl = H7l; + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; - // Rounds - for (var i = 0; i < 80; i++) { - // Shortcut - var Wi = W[i]; + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + var modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + var modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } - // Extend message - if (i < 16) { - var Wih = Wi.high = M[offset + i * 2] | 0; - var Wil = Wi.low = M[offset + i * 2 + 1] | 0; - } else { - // Gamma0 - var gamma0x = W[i - 15]; - var gamma0xh = gamma0x.high; - var gamma0xl = gamma0x.low; - var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); - var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, - // Gamma1 - var gamma1x = W[i - 2]; - var gamma1xh = gamma1x.high; - var gamma1xl = gamma1x.low; - var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); - var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, - // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] - var Wi7 = W[i - 7]; - var Wi7h = Wi7.high; - var Wi7l = Wi7.low; + _doFinalize: function () { + // Shortcut + var padding = this.cfg.padding; - var Wi16 = W[i - 16]; - var Wi16h = Wi16.high; - var Wi16l = Wi16.low; + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); - var Wil = gamma0l + Wi7l; - var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); - var Wil = Wil + gamma1l; - var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); - var Wil = Wil + Wi16l; - var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + // Process final blocks + var finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + var finalProcessedBlocks = this._process(!!'flush'); - Wi.high = Wih; - Wi.low = Wil; - } + // Unpad data + padding.unpad(finalProcessedBlocks); + } - var chh = (eh & fh) ^ (~eh & gh); - var chl = (el & fl) ^ (~el & gl); - var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); - var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + return finalProcessedBlocks; + }, - var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); - var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); - var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); - var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + blockSize: 128/32 + }); - // t1 = h + sigma1 + ch + K[i] + W[i] - var Ki = K[i]; - var Kih = Ki.high; - var Kil = Ki.low; - - var t1l = hl + sigma1l; - var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); - var t1l = t1l + chl; - var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); - var t1l = t1l + Kil; - var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); - var t1l = t1l + Wil; - var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - - // t2 = sigma0 + maj - var t2l = sigma0l + majl; - var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); - - // Update working variables - hh = gh; - hl = gl; - gh = fh; - gl = fl; - fh = eh; - fl = el; - el = (dl + t1l) | 0; - eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; - dh = ch; - dl = cl; - ch = bh; - cl = bl; - bh = ah; - bl = al; - al = (t1l + t2l) | 0; - ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; - } - - // Intermediate hash value - H0l = H0.low = (H0l + al); - H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); - H1l = H1.low = (H1l + bl); - H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); - H2l = H2.low = (H2l + cl); - H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); - H3l = H3.low = (H3l + dl); - H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); - H4l = H4.low = (H4l + el); - H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); - H5l = H5.low = (H5l + fl); - H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); - H6l = H6.low = (H6l + gl); - H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); - H7l = H7.low = (H7l + hl); - H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Convert hash to 32-bit word array before returning - var hash = this._hash.toX32(); - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); }, - blockSize: 1024/32 + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } }); /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA512('message'); - * var hash = CryptoJS.SHA512(wordArray); + * Format namespace. */ - C.SHA512 = Hasher._createHelper(SHA512); + var C_format = C.format = {}; /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA512(message, key); + * OpenSSL formatting strategy. */ - C.HmacSHA512 = Hasher._createHmacHelper(SHA512); - }()); + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + // Format + if (salt) { + var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + var wordArray = ciphertext; + } - return CryptoJS.SHA512; + return wordArray.toString(Base64); + }, - })); + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { + // Shortcut + var ciphertextWords = ciphertext.words; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(15)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./x64-core", "./sha512"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + var salt = WordArray.create(ciphertextWords.slice(2, 4)); - (function () { - // Shortcuts - var C = CryptoJS; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - var SHA512 = C_algo.SHA512; + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; /** - * SHA-384 hash algorithm. + * A cipher wrapper that returns ciphertext as a serializable cipher params object. */ - var SHA384 = C_algo.SHA384 = SHA512.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), - new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), - new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), - new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) - ]); - }, - - _doFinalize: function () { - var hash = SHA512._doFinalize.call(this); - - hash.sigBytes -= 16; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA384('message'); - * var hash = CryptoJS.SHA384(wordArray); - */ - C.SHA384 = SHA512._createHelper(SHA384); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA384(message, key); - */ - C.HmacSHA384 = SHA512._createHmacHelper(SHA384); - }()); - + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), - return CryptoJS.SHA384; + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); - })); + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { + // Shortcut + var cipherCfg = encryptor.cfg; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(7)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./x64-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } + return plaintext; + }, - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; } } + }); - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); } - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); } - }()); + }; /** - * SHA-3 hash algorithm. + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ /** * Configuration options. * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL */ - cfg: Hasher.cfg.extend({ - outputLength: 512 + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf }), - _doReset: function () { - var state = this._state = [] - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; + // Add IV to config + cfg.iv = derivedParams.iv; - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } + // Mix in derived params + ciphertext.mixIn(derivedParams); - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } + return ciphertext; + }, - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); - // Rotate lanes - if (rhoOffset < 32) { - var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } + // Add IV to config + cfg.iv = derivedParams.iv; - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; + return plaintext; + } + }); + }()); - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } + })); - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low;; - } - }, +/***/ }, - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; +/***/ 229: +/***/ function(module, exports, __webpack_require__) { - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // Hash final blocks - this._process(); + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; + var cipher = this._cipher; + var blockSize = cipher.blockSize; - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); - clone: function () { - var clone = Hasher.clone.call(this); + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; + // This block becomes the previous block + this._prevBlock = thisBlock; } }); - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + // Shortcut + var iv = this._iv; - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); + // Generate keystream + if (iv) { + var keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + var keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } - return CryptoJS.SHA3; + return CFB; + }()); + + + return CryptoJS.mode.CFB; })); -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, - ;(function (root, factory) { +/***/ 230: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./cipher-core"], factory); } else { // Global (browser) @@ -8649,271 +7266,185 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - /** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var _zl = WordArray.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]); - var _zr = WordArray.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]); - var _sl = WordArray.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 ]); - var _sr = WordArray.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 ]); - - var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); - var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); - - /** - * RIPEMD160 hash algorithm. - */ - var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ - _doReset: function () { - this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); - }, + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); - _doProcessBlock: function (M, offset) { + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); - // Swap - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); + // Remove IV for subsequent blocks + this._iv = undefined; } - // Shortcut - var H = this._hash.words; - var hl = _hl.words; - var hr = _hr.words; - var zl = _zl.words; - var zr = _zr.words; - var sl = _sl.words; - var sr = _sr.words; - - // Working variables - var al, bl, cl, dl, el; - var ar, br, cr, dr, er; + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); - ar = al = H[0]; - br = bl = H[1]; - cr = cl = H[2]; - dr = dl = H[3]; - er = el = H[4]; - // Computation - var t; - for (var i = 0; i < 80; i += 1) { - t = (al + M[offset+zl[i]])|0; - if (i<16){ - t += f1(bl,cl,dl) + hl[0]; - } else if (i<32) { - t += f2(bl,cl,dl) + hl[1]; - } else if (i<48) { - t += f3(bl,cl,dl) + hl[2]; - } else if (i<64) { - t += f4(bl,cl,dl) + hl[3]; - } else {// if (i<80) { - t += f5(bl,cl,dl) + hl[4]; - } - t = t|0; - t = rotl(t,sl[i]); - t = (t+el)|0; - al = el; - el = dl; - dl = rotl(cl, 10); - cl = bl; - bl = t; + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 - t = (ar + M[offset+zr[i]])|0; - if (i<16){ - t += f5(br,cr,dr) + hr[0]; - } else if (i<32) { - t += f4(br,cr,dr) + hr[1]; - } else if (i<48) { - t += f3(br,cr,dr) + hr[2]; - } else if (i<64) { - t += f2(br,cr,dr) + hr[3]; - } else {// if (i<80) { - t += f1(br,cr,dr) + hr[4]; - } - t = t|0; - t = rotl(t,sr[i]) ; - t = (t+er)|0; - ar = er; - er = dr; - dr = rotl(cr, 10); - cr = br; - br = t; + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; } - // Intermediate hash value - t = (H[1] + cl + dr)|0; - H[1] = (H[2] + dl + er)|0; - H[2] = (H[3] + el + ar)|0; - H[3] = (H[4] + al + br)|0; - H[4] = (H[0] + bl + cr)|0; - H[0] = t; - }, + } + }); - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; + CTR.Decryptor = Encryptor; - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; + return CTR; + }()); - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | - (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) - ); - data.sigBytes = (dataWords.length + 1) * 4; - // Hash final blocks - this._process(); + return CryptoJS.mode.CTR; - // Shortcuts - var hash = this._hash; - var H = hash.words; + })); - // Swap endian - for (var i = 0; i < 5; i++) { - // Shortcut - var H_i = H[i]; +/***/ }, - // Swap - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } +/***/ 231: +/***/ function(module, exports, __webpack_require__) { - // Return final computed hash - return hash; - }, + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - return clone; - } - }); + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } - function f1(x, y, z) { - return ((x) ^ (y) ^ (z)); + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } - } + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } - function f2(x, y, z) { - return (((x)&(y)) | ((~x)&(z))); - } + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; - function f3(x, y, z) { - return (((x) | (~(y))) ^ (z)); - } + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); - function f4(x, y, z) { - return (((x) & (z)) | ((y)&(~(z)))); - } + // Remove IV for subsequent blocks + this._iv = undefined; + } - function f5(x, y, z) { - return ((x) ^ ((y) |(~(z)))); + incCounter(counter); - } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); - function rotl(x,n) { - return (x<>>(32-n)); - } + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + CTRGladman.Decryptor = Encryptor; - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.RIPEMD160('message'); - * var hash = CryptoJS.RIPEMD160(wordArray); - */ - C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + return CTRGladman; + }()); - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacRIPEMD160(message, key); - */ - C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); - }(Math)); - return CryptoJS.RIPEMD160; + + return CryptoJS.mode.CTRGladman; })); -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, - ;(function (root, factory) { +/***/ 232: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core"], factory); + define(["./core", "./cipher-core"], factory); } else { // Global (browser) @@ -8921,147 +7452,105 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var C_algo = C.algo; + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); - /** - * HMAC algorithm. - */ - var HMAC = C_algo.HMAC = Base.extend({ - /** - * Initializes a newly created HMAC. - * - * @param {Hasher} hasher The hash algorithm to use. - * @param {WordArray|string} key The secret key. - * - * @example - * - * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); - */ - init: function (hasher, key) { - // Init hasher - hasher = this._hasher = new hasher.init(); + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; - // Convert string to WordArray, else assume WordArray already - if (typeof key == 'string') { - key = Utf8.parse(key); - } + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); - // Shortcuts - var hasherBlockSize = hasher.blockSize; - var hasherBlockSizeBytes = hasherBlockSize * 4; + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); - // Allow arbitrary length keys - if (key.sigBytes > hasherBlockSizeBytes) { - key = hasher.finalize(key); + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; } + } + }); - // Clamp excess bits - key.clamp(); + OFB.Decryptor = Encryptor; - // Clone key for inner and outer pads - var oKey = this._oKey = key.clone(); - var iKey = this._iKey = key.clone(); + return OFB; + }()); - // Shortcuts - var oKeyWords = oKey.words; - var iKeyWords = iKey.words; - // XOR keys with pad constants - for (var i = 0; i < hasherBlockSize; i++) { - oKeyWords[i] ^= 0x5c5c5c5c; - iKeyWords[i] ^= 0x36363636; - } - oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + return CryptoJS.mode.OFB; - // Set initial values - this.reset(); - }, + })); - /** - * Resets this HMAC to its initial state. - * - * @example - * - * hmacHasher.reset(); - */ - reset: function () { - // Shortcut - var hasher = this._hasher; +/***/ }, - // Reset - hasher.reset(); - hasher.update(this._iKey); - }, +/***/ 233: +/***/ function(module, exports, __webpack_require__) { - /** - * Updates this HMAC with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {HMAC} This HMAC instance. - * - * @example - * - * hmacHasher.update('message'); - * hmacHasher.update(wordArray); - */ - update: function (messageUpdate) { - this._hasher.update(messageUpdate); - - // Chainable - return this; - }, + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - /** - * Finalizes the HMAC computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The HMAC. - * - * @example - * - * var hmac = hmacHasher.finalize(); - * var hmac = hmacHasher.finalize('message'); - * var hmac = hmacHasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Shortcut - var hasher = this._hasher; + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); - // Compute HMAC - var innerHash = hasher.finalize(messageUpdate); - hasher.reset(); - var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); - return hmac; + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); } }); + + return ECB; }()); + return CryptoJS.mode.ECB; + })); -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 234: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./sha1", "./hmac"], factory); + define(["./core", "./cipher-core"], factory); } else { // Global (browser) @@ -9069,149 +7558,104 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: SHA1, - iterations: 1 - }), + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); + return CryptoJS.pad.Ansix923; - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; + })); - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); +/***/ }, - // Shortcut - var intermediateWords = intermediate.words; +/***/ 235: +/***/ function(module, exports, __webpack_require__) { - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; - return derivedKey; - } - }); + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - return CryptoJS.PBKDF2; + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + return CryptoJS.pad.Iso10126; })); -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 236: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./sha1", "./hmac"], factory); + define(["./core", "./cipher-core"], factory); } else { // Global (browser) @@ -9219,136 +7663,96 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var MD5 = C_algo.MD5; + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); - /** - * This key derivation function is meant to conform with EVP_BytesToKey. - * www.openssl.org/docs/crypto/EVP_BytesToKey.html - */ - var EvpKDF = C_algo.EvpKDF = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hash algorithm to use. Default: MD5 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: MD5, - iterations: 1 - }), + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.EvpKDF.create(); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; - // Init hasher - var hasher = cfg.hasher.create(); - // Initial values - var derivedKey = WordArray.create(); + return CryptoJS.pad.Iso97971; - // Shortcuts - var derivedKeyWords = derivedKey.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; + })); - // Generate key - while (derivedKeyWords.length < keySize) { - if (block) { - hasher.update(block); - } - var block = hasher.update(password).finalize(salt); - hasher.reset(); +/***/ }, - // Iterations - for (var i = 1; i < iterations; i++) { - block = hasher.finalize(block); - hasher.reset(); - } +/***/ 237: +/***/ function(module, exports, __webpack_require__) { - derivedKey.concat(block); - } - derivedKey.sigBytes = keySize * 4; + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - return derivedKey; - } - }); + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.EvpKDF(password, salt); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.EvpKDF = function (password, salt, cfg) { - return EvpKDF.create(cfg).compute(password, salt); - }; - }()); + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + unpad: function (data) { + // Shortcut + var dataWords = data.words; - return CryptoJS.EvpKDF; + // Unpad + var i = data.sigBytes - 1; + while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + i--; + } + data.sigBytes = i + 1; + } + }; + + + return CryptoJS.pad.ZeroPadding; })); -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 238: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(21)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./evpkdf"], factory); + define(["./core", "./cipher-core"], factory); } else { // Global (browser) @@ -9357,966 +7761,1120 @@ return /******/ (function(modules) { // webpackBootstrap }(this, function (CryptoJS) { /** - * Cipher core components. + * A noop padding strategy. */ - CryptoJS.lib.Cipher || (function (undefined) { + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + return CryptoJS.pad.NoPadding; + + })); + +/***/ }, + +/***/ 239: +/***/ function(module, exports, __webpack_require__) { + + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { + + (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var CipherParams = C_lib.CipherParams; var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var Base64 = C_enc.Base64; - var C_algo = C.algo; - var EvpKDF = C_algo.EvpKDF; - - /** - * Abstract base cipher template. - * - * @property {number} keySize This cipher's key size. Default: 4 (128 bits) - * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) - * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. - * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. - */ - var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - * - * @property {WordArray} iv The IV to use for this operation. - */ - cfg: Base.extend(), + var Hex = C_enc.Hex; + var C_format = C.format; + var HexFormatter = C_format.Hex = { /** - * Creates this cipher in encryption mode. + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. + * @param {CipherParams} cipherParams The cipher params object. * - * @return {Cipher} A cipher instance. + * @return {string} The hexadecimally encoded string. * * @static * * @example * - * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); */ - createEncryptor: function (key, cfg) { - return this.create(this._ENC_XFORM_MODE, key, cfg); + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); }, /** - * Creates this cipher in decryption mode. + * Converts a hexadecimally encoded ciphertext string to a cipher params object. * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. + * @param {string} input The hexadecimally encoded string. * - * @return {Cipher} A cipher instance. + * @return {CipherParams} The cipher params object. * * @static * * @example * - * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + * var cipherParams = CryptoJS.format.Hex.parse(hexString); */ - createDecryptor: function (key, cfg) { - return this.create(this._DEC_XFORM_MODE, key, cfg); - }, + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); - /** - * Initializes a newly created cipher. - * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @example - * - * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); - */ - init: function (xformMode, key, cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - // Store transform mode and key - this._xformMode = xformMode; - this._key = key; + return CryptoJS.format.Hex; - // Set initial values - this.reset(); - }, + })); - /** - * Resets this cipher to its initial state. - * - * @example - * - * cipher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); +/***/ }, - // Perform concrete-cipher logic - this._doReset(); - }, +/***/ 240: +/***/ function(module, exports, __webpack_require__) { - /** - * Adds data to be encrypted or decrypted. - * - * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. - * - * @return {WordArray} The data after processing. - * - * @example - * - * var encrypted = cipher.process('data'); - * var encrypted = cipher.process(wordArray); - */ - process: function (dataUpdate) { - // Append - this._append(dataUpdate); + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(216), __webpack_require__(217), __webpack_require__(227), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - // Process available blocks - return this._process(); - }, + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; - /** - * Finalizes the encryption or decryption process. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. - * - * @return {WordArray} The data after final processing. - * - * @example - * - * var encrypted = cipher.finalize(); - * var encrypted = cipher.finalize('data'); - * var encrypted = cipher.finalize(wordArray); - */ - finalize: function (dataUpdate) { - // Final data update - if (dataUpdate) { - this._append(dataUpdate); + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; } + } - // Perform concrete-cipher logic - var finalProcessedData = this._doFinalize(); + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; - return finalProcessedData; - }, + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; - keySize: 128/32, + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; - ivSize: 128/32, + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; - _ENC_XFORM_MODE: 1, + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); - _DEC_XFORM_MODE: 2, + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; - /** - * Creates shortcut functions to a cipher's object interface. - * - * @param {Cipher} cipher The cipher to create a helper for. - * - * @return {Object} An object with encrypt and decrypt shortcut functions. - * - * @static - * - * @example - * - * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); - */ - _createHelper: (function () { - function selectCipherStrategy(key) { - if (typeof key == 'string') { - return PasswordBasedCipher; + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; } else { - return SerializableCipher; + var t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; } } - return function (cipher) { - return { - encrypt: function (message, key, cfg) { - return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); - }, + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; - decrypt: function (ciphertext, key, cfg) { - return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); - } - }; - }; - }()) - }); + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } - /** - * Abstract base stream cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) - */ - var StreamCipher = C_lib.StreamCipher = Cipher.extend({ - _doFinalize: function () { - // Process partial blocks - var finalProcessedBlocks = this._process(!!'flush'); + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, - return finalProcessedBlocks; + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); }, - blockSize: 1 - }); + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; - /** - * Mode namespace. - */ - var C_mode = C.mode = {}; - - /** - * Abstract base block cipher mode template. - */ - var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ - /** - * Creates this mode for encryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); - */ - createEncryptor: function (cipher, iv) { - return this.Encryptor.create(cipher, iv); - }, + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); - /** - * Creates this mode for decryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); - */ - createDecryptor: function (cipher, iv) { - return this.Decryptor.create(cipher, iv); + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; }, - /** - * Initializes a newly created mode. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @example - * - * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); - */ - init: function (cipher, iv) { - this._cipher = cipher; - this._iv = iv; - } - }); + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; - /** - * Cipher Block Chaining mode. - */ - var CBC = C_mode.CBC = (function () { - /** - * Abstract base CBC mode. - */ - var CBC = BlockCipherMode.extend(); + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; - /** - * CBC encryptor. - */ - CBC.Encryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; + // Key schedule row counter + var ksRow = 4; - // XOR and encrypt - xorBlock.call(this, words, offset, blockSize); - cipher.encryptBlock(words, offset); + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; } - }); - /** - * CBC decryptor. - */ - CBC.Decryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, - // Decrypt and XOR - cipher.decryptBlock(words, offset); - xorBlock.call(this, words, offset, blockSize); + keySize: 256/32 + }); - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); - function xorBlock(words, offset, blockSize) { - // Shortcut - var iv = this._iv; - // Choose mixing block - if (iv) { - var block = iv; + return CryptoJS.AES; - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var block = this._prevBlock; - } + })); - // XOR blocks - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= block[i]; - } - } +/***/ }, - return CBC; - }()); +/***/ 241: +/***/ function(module, exports, __webpack_require__) { - /** - * Padding namespace. - */ - var C_pad = C.pad = {}; + ;(function (root, factory, undef) { + if (true) { + // CommonJS + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(216), __webpack_require__(217), __webpack_require__(227), __webpack_require__(228)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } + }(this, function (CryptoJS) { - /** - * PKCS #5/7 padding strategy. - */ - var Pkcs7 = C_pad.Pkcs7 = { - /** - * Pads data using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to pad. - * @param {number} blockSize The multiple that the data should be padded to. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.pad(wordArray, 4); - */ - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + // Permuted Choice 1 constants + var PC1 = [ + 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 + ]; - // Create padding word - var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + // Permuted Choice 2 constants + var PC2 = [ + 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 + ]; - // Create padding - var paddingWords = []; - for (var i = 0; i < nPaddingBytes; i += 4) { - paddingWords.push(paddingWord); - } - var padding = WordArray.create(paddingWords, nPaddingBytes); - - // Add padding - data.concat(padding); - }, - - /** - * Unpads data that had been padded using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to unpad. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.unpad(wordArray); - */ - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - /** - * Abstract base block cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) - */ - var BlockCipher = C_lib.BlockCipher = Cipher.extend({ - /** - * Configuration options. - * - * @property {Mode} mode The block mode to use. Default: CBC - * @property {Padding} padding The padding strategy to use. Default: Pkcs7 - */ - cfg: Cipher.cfg.extend({ - mode: CBC, - padding: Pkcs7 - }), - - reset: function () { - // Reset cipher - Cipher.reset.call(this); - - // Shortcuts - var cfg = this.cfg; - var iv = cfg.iv; - var mode = cfg.mode; - - // Reset block mode - if (this._xformMode == this._ENC_XFORM_MODE) { - var modeCreator = mode.createEncryptor; - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - var modeCreator = mode.createDecryptor; - // Keep at least one block in the buffer for unpadding - this._minBufferSize = 1; - } - - if (this._mode && this._mode.__creator == modeCreator) { - this._mode.init(this, iv && iv.words); - } else { - this._mode = modeCreator.call(mode, this, iv && iv.words); - this._mode.__creator = modeCreator; - } - }, + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; - _doProcessBlock: function (words, offset) { - this._mode.processBlock(words, offset); + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 }, - - _doFinalize: function () { - // Shortcut - var padding = this.cfg.padding; - - // Finalize - if (this._xformMode == this._ENC_XFORM_MODE) { - // Pad data - padding.pad(this._data, this.blockSize); - - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - // Process final blocks - var finalProcessedBlocks = this._process(!!'flush'); - - // Unpad data - padding.unpad(finalProcessedBlocks); - } - - return finalProcessedBlocks; + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 }, - - blockSize: 128/32 - }); - - /** - * A collection of cipher parameters. - * - * @property {WordArray} ciphertext The raw ciphertext. - * @property {WordArray} key The key to this ciphertext. - * @property {WordArray} iv The IV used in the ciphering operation. - * @property {WordArray} salt The salt used with a key derivation function. - * @property {Cipher} algorithm The cipher algorithm. - * @property {Mode} mode The block mode used in the ciphering operation. - * @property {Padding} padding The padding scheme used in the ciphering operation. - * @property {number} blockSize The block size of the cipher. - * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. - */ - var CipherParams = C_lib.CipherParams = Base.extend({ - /** - * Initializes a newly created cipher params object. - * - * @param {Object} cipherParams An object with any of the possible cipher parameters. - * - * @example - * - * var cipherParams = CryptoJS.lib.CipherParams.create({ - * ciphertext: ciphertextWordArray, - * key: keyWordArray, - * iv: ivWordArray, - * salt: saltWordArray, - * algorithm: CryptoJS.algo.AES, - * mode: CryptoJS.mode.CBC, - * padding: CryptoJS.pad.PKCS7, - * blockSize: 4, - * formatter: CryptoJS.format.OpenSSL - * }); - */ - init: function (cipherParams) { - this.mixIn(cipherParams); + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 }, - - /** - * Converts this cipher params object to a string. - * - * @param {Format} formatter (Optional) The formatting strategy to use. - * - * @return {string} The stringified cipher params. - * - * @throws Error If neither the formatter nor the default formatter is set. - * - * @example - * - * var string = cipherParams + ''; - * var string = cipherParams.toString(); - * var string = cipherParams.toString(CryptoJS.format.OpenSSL); - */ - toString: function (formatter) { - return (formatter || this.formatter).stringify(this); - } - }); - - /** - * Format namespace. - */ - var C_format = C.format = {}; - - /** - * OpenSSL formatting strategy. - */ - var OpenSSLFormatter = C_format.OpenSSL = { - /** - * Converts a cipher params object to an OpenSSL-compatible string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The OpenSSL-compatible string. - * - * @static - * - * @example - * - * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); - */ - stringify: function (cipherParams) { - // Shortcuts - var ciphertext = cipherParams.ciphertext; - var salt = cipherParams.salt; - - // Format - if (salt) { - var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); - } else { - var wordArray = ciphertext; - } - - return wordArray.toString(Base64); + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 }, - - /** - * Converts an OpenSSL-compatible string to a cipher params object. - * - * @param {string} openSSLStr The OpenSSL-compatible string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); - */ - parse: function (openSSLStr) { - // Parse base64 - var ciphertext = Base64.parse(openSSLStr); - - // Shortcut - var ciphertextWords = ciphertext.words; - - // Test for salt - if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { - // Extract salt - var salt = WordArray.create(ciphertextWords.slice(2, 4)); - - // Remove salt from ciphertext - ciphertextWords.splice(0, 4); - ciphertext.sigBytes -= 16; - } - - return CipherParams.create({ ciphertext: ciphertext, salt: salt }); - } - }; - - /** - * A cipher wrapper that returns ciphertext as a serializable cipher params object. - */ - var SerializableCipher = C_lib.SerializableCipher = Base.extend({ - /** - * Configuration options. - * - * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL - */ - cfg: Base.extend({ - format: OpenSSLFormatter - }), - - /** - * Encrypts a message. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Encrypt - var encryptor = cipher.createEncryptor(key, cfg); - var ciphertext = encryptor.finalize(message); - - // Shortcut - var cipherCfg = encryptor.cfg; - - // Create and return serializable cipher params - return CipherParams.create({ - ciphertext: ciphertext, - key: key, - iv: cipherCfg.iv, - algorithm: cipher, - mode: cipherCfg.mode, - padding: cipherCfg.padding, - blockSize: cipher.blockSize, - formatter: cfg.format - }); + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 }, - - /** - * Decrypts serialized ciphertext. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Decrypt - var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - - return plaintext; + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; - /** - * Converts serialized ciphertext to CipherParams, - * else assumed CipherParams already and returns ciphertext unchanged. - * - * @param {CipherParams|string} ciphertext The ciphertext. - * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. - * - * @return {CipherParams} The unserialized ciphertext. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); - */ - _parse: function (ciphertext, format) { - if (typeof ciphertext == 'string') { - return format.parse(ciphertext, this); - } else { - return ciphertext; - } - } - }); - - /** - * Key derivation function namespace. - */ - var C_kdf = C.kdf = {}; - - /** - * OpenSSL key derivation function. - */ - var OpenSSLKdf = C_kdf.OpenSSL = { - /** - * Derives a key and IV from a password. - * - * @param {string} password The password to derive from. - * @param {number} keySize The size in words of the key to generate. - * @param {number} ivSize The size in words of the IV to generate. - * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. - * - * @return {CipherParams} A cipher params object with the key, IV, and salt. - * - * @static - * - * @example - * - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); - */ - execute: function (password, keySize, ivSize, salt) { - // Generate random salt - if (!salt) { - salt = WordArray.random(64/8); - } - - // Derive key and IV - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - - // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; - - // Return params - return CipherParams.create({ key: key, iv: iv, salt: salt }); - } - }; - - /** - * A serializable cipher wrapper that derives the key from a password, - * and returns ciphertext as a serializable cipher params object. - */ - var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ - /** - * Configuration options. - * - * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL - */ - cfg: SerializableCipher.cfg.extend({ - kdf: OpenSSLKdf - }), - - /** - * Encrypts a message using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; - // Add IV to config - cfg.iv = derivedParams.iv; + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } - // Encrypt - var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; - // Mix in derived params - ciphertext.mixIn(derivedParams); + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; - return ciphertext; - }, + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); - /** - * Decrypts serialized ciphertext using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, - // Add IV to config - cfg.iv = derivedParams.iv; + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, - // Decrypt - var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, - return plaintext; - } - }); - }()); + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); - })); + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; - /** - * Cipher Feedback block mode. - */ - CryptoJS.mode.CFB = (function () { - var CFB = CryptoJS.lib.BlockCipherMode.extend(); + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); - CFB.Encryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + keySize: 64/32, - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } + ivSize: 64/32, + + blockSize: 64/32 }); - CFB.Decryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; - function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { - // Shortcut - var iv = this._iv; + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); + this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); + this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); + }, - // Generate keystream - if (iv) { - var keystream = iv.slice(0); + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - var keystream = this._prevBlock; - } - cipher.encryptBlock(keystream, 0); + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } + keySize: 192/32, - return CFB; + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); }()); - return CryptoJS.mode.CFB; + return CryptoJS.TripleDES; })); -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 242: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(216), __webpack_require__(217), __webpack_require__(227), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./cipher-core"], factory); + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); } else { // Global (browser) @@ -10324,183 +8882,144 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - /** - * Counter block mode. - */ - CryptoJS.mode.CTR = (function () { - var CTR = CryptoJS.lib.BlockCipherMode.extend(); + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; - var Encryptor = CTR.Encryptor = CTR.extend({ - processBlock: function (words, offset) { + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; - // Remove IV for subsequent blocks - this._iv = undefined; + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; } - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - // Increment counter - counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; } - } - }); - CTR.Decryptor = Encryptor; + // Counters + this._i = this._j = 0; + }, - return CTR; - }()); + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + keySize: 256/32, - return CryptoJS.mode.CTR; + ivSize: 0 + }); - })); + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { - - /** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - */ - CryptoJS.mode.CTRGladman = (function () { - var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - - function incWord(word) - { - if (((word >> 24) & 0xff) === 0xff) { //overflow - var b1 = (word >> 16)&0xff; - var b2 = (word >> 8)&0xff; - var b3 = word & 0xff; - - if (b1 === 0xff) // overflow b1 - { - b1 = 0; - if (b2 === 0xff) - { - b2 = 0; - if (b3 === 0xff) - { - b3 = 0; - } - else - { - ++b3; - } - } - else - { - ++b2; - } - } - else - { - ++b1; - } - - word = 0; - word += (b1 << 16); - word += (b2 << 8); - word += b3; - } - else - { - word += (0x01 << 24); - } - return word; - } + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; - function incCounter(counter) - { - if ((counter[0] = incWord(counter[0])) === 0) - { - // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 - counter[1] = incWord(counter[1]); - } - return counter; - } + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } - var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; + // Update counters + this._i = i; + this._j = j; - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); + return keystreamWord; + } - // Remove IV for subsequent blocks - this._iv = undefined; - } + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); - incCounter(counter); + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); + _doReset: function () { + RC4._doReset.call(this); - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); } } }); - CTRGladman.Decryptor = Encryptor; - - return CTRGladman; + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); }()); - - - return CryptoJS.mode.CTRGladman; + return CryptoJS.RC4; })); -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 243: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(216), __webpack_require__(217), __webpack_require__(227), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./cipher-core"], factory); + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); } else { // Global (browser) @@ -10508,157 +9027,197 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - /** - * Output Feedback block mode. - */ - CryptoJS.mode.OFB = (function () { - var OFB = CryptoJS.lib.BlockCipherMode.extend(); + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; - var Encryptor = OFB.Encryptor = OFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var keystream = this._keystream; + // Reusable objects + var S = []; + var C_ = []; + var G = []; - // Generate keystream - if (iv) { - keystream = this._keystream = iv.slice(0); + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; - // Remove IV for subsequent blocks - this._iv = undefined; + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); } - cipher.encryptBlock(keystream, 0); - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; - OFB.Decryptor = Encryptor; + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; - return OFB; - }()); + // Carry bit + this._b = 0; + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } - return CryptoJS.mode.OFB; + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } - })); + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; - /** - * Electronic Codebook block mode. - */ - CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; - return ECB; - }()); + // Iterate the system + nextState.call(this); + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - return CryptoJS.mode.ECB; + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - })); + // Encrypt + M[offset + i] ^= S[i]; + } + }, -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { + blockSize: 128/32, - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + ivSize: 64/32 + }); - /** - * ANSI X.923 padding strategy. - */ - CryptoJS.pad.AnsiX923 = { - pad: function (data, blockSize) { + function nextState() { // Shortcuts - var dataSigBytes = data.sigBytes; - var blockSizeBytes = blockSize * 4; + var X = this._X; + var C = this._C; - // Count padding bytes - var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } - // Compute last byte position - var lastBytePos = dataSigBytes + nPaddingBytes - 1; + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - // Pad - data.clamp(); - data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); - data.sigBytes += nPaddingBytes; - }, + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; - // Remove padding - data.sigBytes -= nPaddingBytes; + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } - }; + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); - return CryptoJS.pad.Ansix923; + return CryptoJS.Rabbit; })); -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }, + +/***/ 244: +/***/ function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); + module.exports = exports = factory(__webpack_require__(212), __webpack_require__(216), __webpack_require__(217), __webpack_require__(227), __webpack_require__(228)); } else if (typeof define === "function" && define.amd) { // AMD - define(["./core", "./cipher-core"], factory); + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); } else { // Global (browser) @@ -10666,3497 +9225,4808 @@ return /******/ (function(modules) { // webpackBootstrap } }(this, function (CryptoJS) { - /** - * ISO 10126 padding strategy. - */ - CryptoJS.pad.Iso10126 = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + // Reusable objects + var S = []; + var C_ = []; + var G = []; - // Pad - data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). - concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); - }, + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + // Carry bit + this._b = 0; - return CryptoJS.pad.Iso10126; + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } - })); + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); - /** - * ISO/IEC 9797-1 Padding Method 2. - */ - CryptoJS.pad.Iso97971 = { - pad: function (data, blockSize) { - // Add 0x80 byte - data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; - // Zero pad the rest - CryptoJS.pad.ZeroPadding.pad(data, blockSize); - }, + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, - unpad: function (data) { - // Remove zero padding - CryptoJS.pad.ZeroPadding.unpad(data); + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; - // Remove one more byte -- the 0x80 byte - data.sigBytes--; - } - }; + // Iterate the system + nextState.call(this); + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - return CryptoJS.pad.Iso97971; - - })); - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Encrypt + M[offset + i] ^= S[i]; + } + }, - /** - * Zero padding strategy. - */ - CryptoJS.pad.ZeroPadding = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; + blockSize: 128/32, - // Pad - data.clamp(); - data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); - }, + ivSize: 64/32 + }); - unpad: function (data) { - // Shortcut - var dataWords = data.words; + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; - // Unpad - var i = data.sigBytes - 1; - while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { - i--; + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; } - data.sigBytes = i + 1; - } - }; - - return CryptoJS.pad.ZeroPadding; + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - })); + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - /** - * A noop padding strategy. - */ - CryptoJS.pad.NoPadding = { - pad: function () { - }, + // High XOR low + G[i] = gh ^ gl; + } - unpad: function () { + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } - }; + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); - return CryptoJS.pad.NoPadding; - })); + return CryptoJS.RabbitLegacy; -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { + })); - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { +/***/ }, - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var CipherParams = C_lib.CipherParams; - var C_enc = C.enc; - var Hex = C_enc.Hex; - var C_format = C.format; +/***/ 247: +/***/ function(module, exports, __webpack_require__) { - var HexFormatter = C_format.Hex = { - /** - * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The hexadecimally encoded string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.format.Hex.stringify(cipherParams); - */ - stringify: function (cipherParams) { - return cipherParams.ciphertext.toString(Hex); - }, + 'use strict'; - /** - * Converts a hexadecimally encoded ciphertext string to a cipher params object. - * - * @param {string} input The hexadecimally encoded string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.Hex.parse(hexString); - */ - parse: function (input) { - var ciphertext = Hex.parse(input); - return CipherParams.create({ ciphertext: ciphertext }); - } - }; - }()); + module.exports = __webpack_require__(248); +/***/ }, - return CryptoJS.format.Hex; +/***/ 248: +/***/ function(module, exports, __webpack_require__) { - })); + 'use strict'; -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + var _version = '1.4.2'; + var _code = __webpack_require__(207).code; + var _utils = __webpack_require__(206).utils; + var _msg = __webpack_require__(249); + var _message = _msg._msg; + var _msgHash = {}; + var Queue = __webpack_require__(250).Queue; + var CryptoJS = __webpack_require__(211); + var _ = __webpack_require__(183); + var stropheConn = null; - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; + window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - // Lookup tables - var SBOX = []; - var INV_SBOX = []; - var SUB_MIX_0 = []; - var SUB_MIX_1 = []; - var SUB_MIX_2 = []; - var SUB_MIX_3 = []; - var INV_SUB_MIX_0 = []; - var INV_SUB_MIX_1 = []; - var INV_SUB_MIX_2 = []; - var INV_SUB_MIX_3 = []; + if (window.XDomainRequest) { + // not support ie8 send is not a function , canot + // case send is object, doesn't has a attr of call + // XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send; + // XDomainRequest.prototype.send = function () { + // XDomainRequest.prototype.oldsend.call(this, arguments); + // this.readyState = 2; + // }; + } - // Compute lookup tables - (function () { - // Compute double table - var d = []; - for (var i = 0; i < 256; i++) { - if (i < 128) { - d[i] = i << 1; - } else { - d[i] = (i << 1) ^ 0x11b; - } - } + Strophe.Request.prototype._newXHR = function () { + var xhr = _utils.xmlrequest(true); + if (xhr.overrideMimeType) { + xhr.overrideMimeType('text/xml'); + } + // use Function.bind() to prepend ourselves as an argument + xhr.onreadystatechange = this.func.bind(null, this); + return xhr; + }; - // Walk GF(2^8) - var x = 0; - var xi = 0; - for (var i = 0; i < 256; i++) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; - SBOX[x] = sx; - INV_SBOX[sx] = x; - - // Compute multiplication - var x2 = d[x]; - var x4 = d[x2]; - var x8 = d[x4]; - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100); - SUB_MIX_0[x] = (t << 24) | (t >>> 8); - SUB_MIX_1[x] = (t << 16) | (t >>> 16); - SUB_MIX_2[x] = (t << 8) | (t >>> 24); - SUB_MIX_3[x] = t; + Strophe.Websocket.prototype._closeSocket = function () { + if (this.socket) { + var me = this; + setTimeout(function () { + try { + me.socket.close(); + } catch (e) {} + }, 0); + } else { + this.socket = null; + } + }; - // Compute inv sub bytes, inv mix columns tables - var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); - INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); - INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); - INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); - INV_SUB_MIX_3[sx] = t; + /** + * + * Strophe.Websocket has a bug while logout: + * 1.send: is ok; + * 2.send: will cause a problem,log as follows: + * WebSocket connection to 'ws://im-api.easemob.com/ws/' failed: Data frame received after close_connect @ strophe.js:5292connect @ strophe.js:2491_login @ websdk-1.1.2.js:278suc @ websdk-1.1.2.js:636xhr.onreadystatechange @ websdk-1.1.2.js:2582 + * 3 "Websocket error [object Event]" + * _changeConnectStatus + * onError Object {type: 7, msg: "The WebSocket connection could not be established or was disconnected.", reconnect: true} + * + * this will trigger socket.onError, therefore _doDisconnect again. + * Fix it by overide _onMessage + */ + Strophe.Websocket.prototype._onMessage = function (message) { + logMessage(message + // 获取Resource + );var data = message.data; + if (data.indexOf('') > 0) { + var start = data.indexOf(''), + end = data.indexOf(''), + data = data.substring(start + 5, end); + stropheConn.setJid(data); + } - // Compute next counter - if (!x) { - x = xi = 1; - } else { - x = x2 ^ d[d[d[x8 ^ x2]]]; - xi ^= d[d[xi]]; - } - } - }()); + var elem, data; + // check for closing stream + // var close = ''; + // if (message.data === close) { + // this._conn.rawInput(close); + // this._conn.xmlInput(message); + // if (!this._conn.disconnecting) { + // this._conn._doDisconnect(); + // } + // return; + // + // send and receive close xml: + // so we can't judge whether message.data equals close by === simply. + if (message.data.indexOf(" from server"); + // } + } + return; + } else if (message.data.search(" tag before we close the connection + return; + } + this._conn._dataRecv(elem, message.data); + }; - // Shortcuts - var key = this._keyPriorReset = this._key; - var keyWords = key.words; - var keySize = key.sigBytes / 4; + var _listenNetwork = function _listenNetwork(onlineCallback, offlineCallback) { - // Compute number of rounds - var nRounds = this._nRounds = keySize + 6; + if (window.addEventListener) { + window.addEventListener('online', onlineCallback); + window.addEventListener('offline', offlineCallback); + } else if (window.attachEvent) { + if (document.body) { + document.body.attachEvent('ononline', onlineCallback); + document.body.attachEvent('onoffline', offlineCallback); + } else { + window.attachEvent('load', function () { + document.body.attachEvent('ononline', onlineCallback); + document.body.attachEvent('onoffline', offlineCallback); + }); + } + } else { + /*var onlineTmp = window.ononline; + var offlineTmp = window.onoffline; + window.attachEvent('ononline', function () { + try { + typeof onlineTmp === 'function' && onlineTmp(); + } catch ( e ) {} + onlineCallback(); + }); + window.attachEvent('onoffline', function () { + try { + typeof offlineTmp === 'function' && offlineTmp(); + } catch ( e ) {} + offlineCallback(); + });*/ + } + }; - // Compute number of key schedule rows - var ksRows = (nRounds + 1) * 4; + var _parseRoom = function _parseRoom(result) { + var rooms = []; + var items = result.getElementsByTagName('item'); + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var roomJid = item.getAttribute('jid'); + var tmp = roomJid.split('@')[0]; + var room = { + jid: roomJid, + name: item.getAttribute('name'), + roomId: tmp.split('_')[1] + }; + rooms.push(room); + } + } + return rooms; + }; - // Compute key schedule - var keySchedule = this._keySchedule = []; - for (var ksRow = 0; ksRow < ksRows; ksRow++) { - if (ksRow < keySize) { - keySchedule[ksRow] = keyWords[ksRow]; - } else { - var t = keySchedule[ksRow - 1]; + var _parseRoomOccupants = function _parseRoomOccupants(result) { + var occupants = []; + var items = result.getElementsByTagName('item'); + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var room = { + jid: item.getAttribute('jid'), + name: item.getAttribute('name') + }; + occupants.push(room); + } + } + return occupants; + }; - if (!(ksRow % keySize)) { - // Rot word - t = (t << 8) | (t >>> 24); + var _parseResponseMessage = function _parseResponseMessage(msginfo) { + var parseMsgData = { errorMsg: true, data: [] }; - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + var msgBodies = msginfo.getElementsByTagName('body'); + if (msgBodies) { + for (var i = 0; i < msgBodies.length; i++) { + var msgBody = msgBodies[i]; + var childNodes = msgBody.childNodes; + if (childNodes && childNodes.length > 0) { + var childNode = msgBody.childNodes[0]; + if (childNode.nodeType == Strophe.ElementType.TEXT) { + var jsondata = childNode.wholeText || childNode.nodeValue; + jsondata = jsondata.replace('\n', '
'); + try { + var data = eval('(' + jsondata + ')'); + parseMsgData.errorMsg = false; + parseMsgData.data = [data]; + } catch (e) {} + } + } + } - // Mix Rcon - t ^= RCON[(ksRow / keySize) | 0] << 24; - } else if (keySize > 6 && ksRow % keySize == 4) { - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - } + var delayTags = msginfo.getElementsByTagName('delay'); + if (delayTags && delayTags.length > 0) { + var delayTag = delayTags[0]; + var delayMsgTime = delayTag.getAttribute('stamp'); + if (delayMsgTime) { + parseMsgData.delayTimeStamp = delayMsgTime; + } + } + } else { + var childrens = msginfo.childNodes; + if (childrens && childrens.length > 0) { + var child = msginfo.childNodes[0]; + if (child.nodeType == Strophe.ElementType.TEXT) { + try { + var data = eval('(' + child.nodeValue + ')'); + parseMsgData.errorMsg = false; + parseMsgData.data = [data]; + } catch (e) {} + } + } + } + return parseMsgData; + }; - keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; - } - } + var _parseNameFromJidFn = function _parseNameFromJidFn(jid, domain) { + domain = domain || ''; + var tempstr = jid; + var findex = tempstr.indexOf('_'); - // Compute inv key schedule - var invKeySchedule = this._invKeySchedule = []; - for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { - var ksRow = ksRows - invKsRow; - - if (invKsRow % 4) { - var t = keySchedule[ksRow]; - } else { - var t = keySchedule[ksRow - 4]; - } - - if (invKsRow < 4 || ksRow <= 4) { - invKeySchedule[invKsRow] = t; - } else { - invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ - INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; - } - } - }, + if (findex !== -1) { + tempstr = tempstr.substring(findex + 1); + } + var atindex = tempstr.indexOf('@' + domain); + if (atindex !== -1) { + tempstr = tempstr.substring(0, atindex); + } + return tempstr; + }; - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); - }, + var _parseFriend = function _parseFriend(queryTag, conn, from) { + var rouster = []; + var items = queryTag.getElementsByTagName('item'); + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var jid = item.getAttribute('jid'); + if (!jid) { + continue; + } + var subscription = item.getAttribute('subscription'); + var friend = { + subscription: subscription, + jid: jid + }; + var ask = item.getAttribute('ask'); + if (ask) { + friend.ask = ask; + } + var name = item.getAttribute('name'); + if (name) { + friend.name = name; + } else { + var n = _parseNameFromJidFn(jid); + friend.name = n; + } + var groups = []; + Strophe.forEachChild(item, 'group', function (group) { + groups.push(Strophe.getText(group)); + }); + friend.groups = groups; + rouster.push(friend); + // B同意之后 -> B订阅A + // fix: 含有ask标示的好友代表已经发送过反向订阅消息,不需要再次发送。 + if (conn && subscription == 'from' && !ask) { + conn.subscribe({ + toJid: jid, + message: "[resp:true]" + }); + } - decryptBlock: function (M, offset) { - // Swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; + if (conn && subscription == 'to') { + conn.subscribed({ + toJid: jid + }); + } + } + } + return rouster; + }; - this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + var _login = function _login(options, conn) { + var accessToken = options.access_token || ''; + if (accessToken == '') { + var loginfo = _utils.stringify(options); + conn.onError({ + type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, + data: options + }); + return; + } + conn.context.accessToken = options.access_token; + conn.context.accessTokenExpires = options.expires_in; + if (conn.isOpening() && conn.context.stropheConn) { + stropheConn = conn.context.stropheConn; + } else if (conn.isOpened() && conn.context.stropheConn) { + // return; + stropheConn = conn.getStrophe(); + } else { + stropheConn = conn.getStrophe(); + } + var callback = function callback(status, msg) { + _loginCallback(status, msg, conn); + }; - // Inv swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - }, + conn.context.stropheConn = stropheConn; + if (conn.route) { + stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold, conn.route); + } else { + stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold); + } + }; - _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { - // Shortcut - var nRounds = this._nRounds; + var _parseMessageType = function _parseMessageType(msginfo) { + var receiveinfo = msginfo.getElementsByTagName('received'), + inviteinfo = msginfo.getElementsByTagName('invite'), + deliveryinfo = msginfo.getElementsByTagName('delivery'), + acked = msginfo.getElementsByTagName('acked'), + error = msginfo.getElementsByTagName('error'), + msgtype = 'normal'; + if (receiveinfo && receiveinfo.length > 0 && receiveinfo[0].namespaceURI === 'urn:xmpp:receipts') { - // Get input, add round key - var s0 = M[offset] ^ keySchedule[0]; - var s1 = M[offset + 1] ^ keySchedule[1]; - var s2 = M[offset + 2] ^ keySchedule[2]; - var s3 = M[offset + 3] ^ keySchedule[3]; + msgtype = 'received'; + } else if (inviteinfo && inviteinfo.length > 0) { - // Key schedule row counter - var ksRow = 4; + msgtype = 'invite'; + } else if (deliveryinfo && deliveryinfo.length > 0) { - // Rounds - for (var round = 1; round < nRounds; round++) { - // Shift rows, sub bytes, mix columns, add round key - var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; - var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; - var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; - var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + msgtype = 'delivery'; // 消息送达 + } else if (acked && acked.length) { - // Update state - s0 = t0; - s1 = t1; - s2 = t2; - s3 = t3; - } + msgtype = 'acked'; // 消息已读 + } else if (error && error.length) { - // Shift rows, sub bytes, add round key - var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; - var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; - var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; - var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + var errorItem = error[0], + userMuted = errorItem.getElementsByTagName('user-muted'); - // Set output - M[offset] = t0; - M[offset + 1] = t1; - M[offset + 2] = t2; - M[offset + 3] = t3; - }, + if (userMuted && userMuted.length) { - keySize: 256/32 - }); + msgtype = 'userMuted'; + } + } + return msgtype; + }; - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); - */ - C.AES = BlockCipher._createHelper(AES); - }()); + var _handleMessageQueue = function _handleMessageQueue(conn) { + for (var i in _msgHash) { + if (_msgHash.hasOwnProperty(i)) { + _msgHash[i].send(conn); + } + } + }; + var _loginCallback = function _loginCallback(status, msg, conn) { + var conflict, error; - return CryptoJS.AES; + if (msg === 'conflict') { + conflict = true; + } - })); + if (status == Strophe.Status.CONNFAIL) { + //client offline, ping/pong timeout, server quit, server offline + error = { + type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, + msg: msg, + reconnect: true + }; -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { + conflict && (error.conflict = true); + conn.onError(error); + } else if (status == Strophe.Status.ATTACHED || status == Strophe.Status.CONNECTED) { + // client should limit the speed of sending ack messages up to 5/s + conn.autoReconnectNumTotal = 0; + conn.intervalId = setInterval(function () { + conn.handelSendQueue(); + }, 200); + var handleMessage = function handleMessage(msginfo) { + var delivery = msginfo.getElementsByTagName('delivery'); + var acked = msginfo.getElementsByTagName('acked'); + if (delivery.length) { + conn.handleDeliveredMessage(msginfo); + return true; + } + if (acked.length) { + conn.handleAckedMessage(msginfo); + return true; + } + var type = _parseMessageType(msginfo); + switch (type) { + case "received": + conn.handleReceivedMessage(msginfo); + return true; + case "invite": + conn.handleInviteMessage(msginfo); + return true; + case "delivery": + conn.handleDeliveredMessage(msginfo); + return true; + case "acked": + conn.handleAckedMessage(msginfo); + return true; + case "userMuted": + conn.handleMutedMessage(msginfo); + return true; + default: + conn.handleMessage(msginfo); + return true; + } + }; + var handlePresence = function handlePresence(msginfo) { + conn.handlePresence(msginfo); + return true; + }; + var handlePing = function handlePing(msginfo) { + conn.handlePing(msginfo); + return true; + }; + var handleIqRoster = function handleIqRoster(msginfo) { + conn.handleIqRoster(msginfo); + return true; + }; + var handleIqPrivacy = function handleIqPrivacy(msginfo) { + conn.handleIqPrivacy(msginfo); + return true; + }; + var handleIq = function handleIq(msginfo) { + conn.handleIq(msginfo); + return true; + }; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + conn.addHandler(handleMessage, null, 'message', null, null, null); + conn.addHandler(handlePresence, null, 'presence', null, null, null); + conn.addHandler(handlePing, 'urn:xmpp:ping', 'iq', 'get', null, null); + conn.addHandler(handleIqRoster, 'jabber:iq:roster', 'iq', 'set', null, null); + conn.addHandler(handleIqPrivacy, 'jabber:iq:privacy', 'iq', 'set', null, null); + conn.addHandler(handleIq, null, 'iq', null, null, null); - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; + conn.registerConfrIQHandler && conn.registerConfrIQHandler(); - // Permuted Choice 1 constants - var PC1 = [ - 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 - ]; + conn.context.status = _code.STATUS_OPENED; - // Permuted Choice 2 constants - var PC2 = [ - 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 - ]; + var supportRecMessage = [_code.WEBIM_MESSAGE_REC_TEXT, _code.WEBIM_MESSAGE_REC_EMOJI]; - // Cumulative bit shift constants - var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + if (_utils.isCanDownLoadFile) { + supportRecMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); + supportRecMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); + } + var supportSedMessage = [_code.WEBIM_MESSAGE_SED_TEXT]; + if (_utils.isCanUploadFile) { + supportSedMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); + supportSedMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); + } + conn.notifyVersion(); + conn.retry && _handleMessageQueue(conn); + conn.heartBeat(); + conn.isAutoLogin && conn.setPresence(); - // SBOXes and round permutation constants - var SBOX_P = [ - { - 0x0: 0x808200, - 0x10000000: 0x8000, - 0x20000000: 0x808002, - 0x30000000: 0x2, - 0x40000000: 0x200, - 0x50000000: 0x808202, - 0x60000000: 0x800202, - 0x70000000: 0x800000, - 0x80000000: 0x202, - 0x90000000: 0x800200, - 0xa0000000: 0x8200, - 0xb0000000: 0x808000, - 0xc0000000: 0x8002, - 0xd0000000: 0x800002, - 0xe0000000: 0x0, - 0xf0000000: 0x8202, - 0x8000000: 0x0, - 0x18000000: 0x808202, - 0x28000000: 0x8202, - 0x38000000: 0x8000, - 0x48000000: 0x808200, - 0x58000000: 0x200, - 0x68000000: 0x808002, - 0x78000000: 0x2, - 0x88000000: 0x800200, - 0x98000000: 0x8200, - 0xa8000000: 0x808000, - 0xb8000000: 0x800202, - 0xc8000000: 0x800002, - 0xd8000000: 0x8002, - 0xe8000000: 0x202, - 0xf8000000: 0x800000, - 0x1: 0x8000, - 0x10000001: 0x2, - 0x20000001: 0x808200, - 0x30000001: 0x800000, - 0x40000001: 0x808002, - 0x50000001: 0x8200, - 0x60000001: 0x200, - 0x70000001: 0x800202, - 0x80000001: 0x808202, - 0x90000001: 0x808000, - 0xa0000001: 0x800002, - 0xb0000001: 0x8202, - 0xc0000001: 0x202, - 0xd0000001: 0x800200, - 0xe0000001: 0x8002, - 0xf0000001: 0x0, - 0x8000001: 0x808202, - 0x18000001: 0x808000, - 0x28000001: 0x800000, - 0x38000001: 0x200, - 0x48000001: 0x8000, - 0x58000001: 0x800002, - 0x68000001: 0x2, - 0x78000001: 0x8202, - 0x88000001: 0x8002, - 0x98000001: 0x800202, - 0xa8000001: 0x202, - 0xb8000001: 0x808200, - 0xc8000001: 0x800200, - 0xd8000001: 0x0, - 0xe8000001: 0x8200, - 0xf8000001: 0x808002 - }, - { - 0x0: 0x40084010, - 0x1000000: 0x4000, - 0x2000000: 0x80000, - 0x3000000: 0x40080010, - 0x4000000: 0x40000010, - 0x5000000: 0x40084000, - 0x6000000: 0x40004000, - 0x7000000: 0x10, - 0x8000000: 0x84000, - 0x9000000: 0x40004010, - 0xa000000: 0x40000000, - 0xb000000: 0x84010, - 0xc000000: 0x80010, - 0xd000000: 0x0, - 0xe000000: 0x4010, - 0xf000000: 0x40080000, - 0x800000: 0x40004000, - 0x1800000: 0x84010, - 0x2800000: 0x10, - 0x3800000: 0x40004010, - 0x4800000: 0x40084010, - 0x5800000: 0x40000000, - 0x6800000: 0x80000, - 0x7800000: 0x40080010, - 0x8800000: 0x80010, - 0x9800000: 0x0, - 0xa800000: 0x4000, - 0xb800000: 0x40080000, - 0xc800000: 0x40000010, - 0xd800000: 0x84000, - 0xe800000: 0x40084000, - 0xf800000: 0x4010, - 0x10000000: 0x0, - 0x11000000: 0x40080010, - 0x12000000: 0x40004010, - 0x13000000: 0x40084000, - 0x14000000: 0x40080000, - 0x15000000: 0x10, - 0x16000000: 0x84010, - 0x17000000: 0x4000, - 0x18000000: 0x4010, - 0x19000000: 0x80000, - 0x1a000000: 0x80010, - 0x1b000000: 0x40000010, - 0x1c000000: 0x84000, - 0x1d000000: 0x40004000, - 0x1e000000: 0x40000000, - 0x1f000000: 0x40084010, - 0x10800000: 0x84010, - 0x11800000: 0x80000, - 0x12800000: 0x40080000, - 0x13800000: 0x4000, - 0x14800000: 0x40004000, - 0x15800000: 0x40084010, - 0x16800000: 0x10, - 0x17800000: 0x40000000, - 0x18800000: 0x40084000, - 0x19800000: 0x40000010, - 0x1a800000: 0x40004010, - 0x1b800000: 0x80010, - 0x1c800000: 0x0, - 0x1d800000: 0x4010, - 0x1e800000: 0x40080010, - 0x1f800000: 0x84000 - }, - { - 0x0: 0x104, - 0x100000: 0x0, - 0x200000: 0x4000100, - 0x300000: 0x10104, - 0x400000: 0x10004, - 0x500000: 0x4000004, - 0x600000: 0x4010104, - 0x700000: 0x4010000, - 0x800000: 0x4000000, - 0x900000: 0x4010100, - 0xa00000: 0x10100, - 0xb00000: 0x4010004, - 0xc00000: 0x4000104, - 0xd00000: 0x10000, - 0xe00000: 0x4, - 0xf00000: 0x100, - 0x80000: 0x4010100, - 0x180000: 0x4010004, - 0x280000: 0x0, - 0x380000: 0x4000100, - 0x480000: 0x4000004, - 0x580000: 0x10000, - 0x680000: 0x10004, - 0x780000: 0x104, - 0x880000: 0x4, - 0x980000: 0x100, - 0xa80000: 0x4010000, - 0xb80000: 0x10104, - 0xc80000: 0x10100, - 0xd80000: 0x4000104, - 0xe80000: 0x4010104, - 0xf80000: 0x4000000, - 0x1000000: 0x4010100, - 0x1100000: 0x10004, - 0x1200000: 0x10000, - 0x1300000: 0x4000100, - 0x1400000: 0x100, - 0x1500000: 0x4010104, - 0x1600000: 0x4000004, - 0x1700000: 0x0, - 0x1800000: 0x4000104, - 0x1900000: 0x4000000, - 0x1a00000: 0x4, - 0x1b00000: 0x10100, - 0x1c00000: 0x4010000, - 0x1d00000: 0x104, - 0x1e00000: 0x10104, - 0x1f00000: 0x4010004, - 0x1080000: 0x4000000, - 0x1180000: 0x104, - 0x1280000: 0x4010100, - 0x1380000: 0x0, - 0x1480000: 0x10004, - 0x1580000: 0x4000100, - 0x1680000: 0x100, - 0x1780000: 0x4010004, - 0x1880000: 0x10000, - 0x1980000: 0x4010104, - 0x1a80000: 0x10104, - 0x1b80000: 0x4000004, - 0x1c80000: 0x4000104, - 0x1d80000: 0x4010000, - 0x1e80000: 0x4, - 0x1f80000: 0x10100 - }, - { - 0x0: 0x80401000, - 0x10000: 0x80001040, - 0x20000: 0x401040, - 0x30000: 0x80400000, - 0x40000: 0x0, - 0x50000: 0x401000, - 0x60000: 0x80000040, - 0x70000: 0x400040, - 0x80000: 0x80000000, - 0x90000: 0x400000, - 0xa0000: 0x40, - 0xb0000: 0x80001000, - 0xc0000: 0x80400040, - 0xd0000: 0x1040, - 0xe0000: 0x1000, - 0xf0000: 0x80401040, - 0x8000: 0x80001040, - 0x18000: 0x40, - 0x28000: 0x80400040, - 0x38000: 0x80001000, - 0x48000: 0x401000, - 0x58000: 0x80401040, - 0x68000: 0x0, - 0x78000: 0x80400000, - 0x88000: 0x1000, - 0x98000: 0x80401000, - 0xa8000: 0x400000, - 0xb8000: 0x1040, - 0xc8000: 0x80000000, - 0xd8000: 0x400040, - 0xe8000: 0x401040, - 0xf8000: 0x80000040, - 0x100000: 0x400040, - 0x110000: 0x401000, - 0x120000: 0x80000040, - 0x130000: 0x0, - 0x140000: 0x1040, - 0x150000: 0x80400040, - 0x160000: 0x80401000, - 0x170000: 0x80001040, - 0x180000: 0x80401040, - 0x190000: 0x80000000, - 0x1a0000: 0x80400000, - 0x1b0000: 0x401040, - 0x1c0000: 0x80001000, - 0x1d0000: 0x400000, - 0x1e0000: 0x40, - 0x1f0000: 0x1000, - 0x108000: 0x80400000, - 0x118000: 0x80401040, - 0x128000: 0x0, - 0x138000: 0x401000, - 0x148000: 0x400040, - 0x158000: 0x80000000, - 0x168000: 0x80001040, - 0x178000: 0x40, - 0x188000: 0x80000040, - 0x198000: 0x1000, - 0x1a8000: 0x80001000, - 0x1b8000: 0x80400040, - 0x1c8000: 0x1040, - 0x1d8000: 0x80401000, - 0x1e8000: 0x400000, - 0x1f8000: 0x401040 - }, - { - 0x0: 0x80, - 0x1000: 0x1040000, - 0x2000: 0x40000, - 0x3000: 0x20000000, - 0x4000: 0x20040080, - 0x5000: 0x1000080, - 0x6000: 0x21000080, - 0x7000: 0x40080, - 0x8000: 0x1000000, - 0x9000: 0x20040000, - 0xa000: 0x20000080, - 0xb000: 0x21040080, - 0xc000: 0x21040000, - 0xd000: 0x0, - 0xe000: 0x1040080, - 0xf000: 0x21000000, - 0x800: 0x1040080, - 0x1800: 0x21000080, - 0x2800: 0x80, - 0x3800: 0x1040000, - 0x4800: 0x40000, - 0x5800: 0x20040080, - 0x6800: 0x21040000, - 0x7800: 0x20000000, - 0x8800: 0x20040000, - 0x9800: 0x0, - 0xa800: 0x21040080, - 0xb800: 0x1000080, - 0xc800: 0x20000080, - 0xd800: 0x21000000, - 0xe800: 0x1000000, - 0xf800: 0x40080, - 0x10000: 0x40000, - 0x11000: 0x80, - 0x12000: 0x20000000, - 0x13000: 0x21000080, - 0x14000: 0x1000080, - 0x15000: 0x21040000, - 0x16000: 0x20040080, - 0x17000: 0x1000000, - 0x18000: 0x21040080, - 0x19000: 0x21000000, - 0x1a000: 0x1040000, - 0x1b000: 0x20040000, - 0x1c000: 0x40080, - 0x1d000: 0x20000080, - 0x1e000: 0x0, - 0x1f000: 0x1040080, - 0x10800: 0x21000080, - 0x11800: 0x1000000, - 0x12800: 0x1040000, - 0x13800: 0x20040080, - 0x14800: 0x20000000, - 0x15800: 0x1040080, - 0x16800: 0x80, - 0x17800: 0x21040000, - 0x18800: 0x40080, - 0x19800: 0x21040080, - 0x1a800: 0x0, - 0x1b800: 0x21000000, - 0x1c800: 0x1000080, - 0x1d800: 0x40000, - 0x1e800: 0x20040000, - 0x1f800: 0x20000080 - }, - { - 0x0: 0x10000008, - 0x100: 0x2000, - 0x200: 0x10200000, - 0x300: 0x10202008, - 0x400: 0x10002000, - 0x500: 0x200000, - 0x600: 0x200008, - 0x700: 0x10000000, - 0x800: 0x0, - 0x900: 0x10002008, - 0xa00: 0x202000, - 0xb00: 0x8, - 0xc00: 0x10200008, - 0xd00: 0x202008, - 0xe00: 0x2008, - 0xf00: 0x10202000, - 0x80: 0x10200000, - 0x180: 0x10202008, - 0x280: 0x8, - 0x380: 0x200000, - 0x480: 0x202008, - 0x580: 0x10000008, - 0x680: 0x10002000, - 0x780: 0x2008, - 0x880: 0x200008, - 0x980: 0x2000, - 0xa80: 0x10002008, - 0xb80: 0x10200008, - 0xc80: 0x0, - 0xd80: 0x10202000, - 0xe80: 0x202000, - 0xf80: 0x10000000, - 0x1000: 0x10002000, - 0x1100: 0x10200008, - 0x1200: 0x10202008, - 0x1300: 0x2008, - 0x1400: 0x200000, - 0x1500: 0x10000000, - 0x1600: 0x10000008, - 0x1700: 0x202000, - 0x1800: 0x202008, - 0x1900: 0x0, - 0x1a00: 0x8, - 0x1b00: 0x10200000, - 0x1c00: 0x2000, - 0x1d00: 0x10002008, - 0x1e00: 0x10202000, - 0x1f00: 0x200008, - 0x1080: 0x8, - 0x1180: 0x202000, - 0x1280: 0x200000, - 0x1380: 0x10000008, - 0x1480: 0x10002000, - 0x1580: 0x2008, - 0x1680: 0x10202008, - 0x1780: 0x10200000, - 0x1880: 0x10202000, - 0x1980: 0x10200008, - 0x1a80: 0x2000, - 0x1b80: 0x202008, - 0x1c80: 0x200008, - 0x1d80: 0x0, - 0x1e80: 0x10000000, - 0x1f80: 0x10002008 - }, - { - 0x0: 0x100000, - 0x10: 0x2000401, - 0x20: 0x400, - 0x30: 0x100401, - 0x40: 0x2100401, - 0x50: 0x0, - 0x60: 0x1, - 0x70: 0x2100001, - 0x80: 0x2000400, - 0x90: 0x100001, - 0xa0: 0x2000001, - 0xb0: 0x2100400, - 0xc0: 0x2100000, - 0xd0: 0x401, - 0xe0: 0x100400, - 0xf0: 0x2000000, - 0x8: 0x2100001, - 0x18: 0x0, - 0x28: 0x2000401, - 0x38: 0x2100400, - 0x48: 0x100000, - 0x58: 0x2000001, - 0x68: 0x2000000, - 0x78: 0x401, - 0x88: 0x100401, - 0x98: 0x2000400, - 0xa8: 0x2100000, - 0xb8: 0x100001, - 0xc8: 0x400, - 0xd8: 0x2100401, - 0xe8: 0x1, - 0xf8: 0x100400, - 0x100: 0x2000000, - 0x110: 0x100000, - 0x120: 0x2000401, - 0x130: 0x2100001, - 0x140: 0x100001, - 0x150: 0x2000400, - 0x160: 0x2100400, - 0x170: 0x100401, - 0x180: 0x401, - 0x190: 0x2100401, - 0x1a0: 0x100400, - 0x1b0: 0x1, - 0x1c0: 0x0, - 0x1d0: 0x2100000, - 0x1e0: 0x2000001, - 0x1f0: 0x400, - 0x108: 0x100400, - 0x118: 0x2000401, - 0x128: 0x2100001, - 0x138: 0x1, - 0x148: 0x2000000, - 0x158: 0x100000, - 0x168: 0x401, - 0x178: 0x2100400, - 0x188: 0x2000001, - 0x198: 0x2100000, - 0x1a8: 0x0, - 0x1b8: 0x2100401, - 0x1c8: 0x100401, - 0x1d8: 0x400, - 0x1e8: 0x2000400, - 0x1f8: 0x100001 - }, - { - 0x0: 0x8000820, - 0x1: 0x20000, - 0x2: 0x8000000, - 0x3: 0x20, - 0x4: 0x20020, - 0x5: 0x8020820, - 0x6: 0x8020800, - 0x7: 0x800, - 0x8: 0x8020000, - 0x9: 0x8000800, - 0xa: 0x20800, - 0xb: 0x8020020, - 0xc: 0x820, - 0xd: 0x0, - 0xe: 0x8000020, - 0xf: 0x20820, - 0x80000000: 0x800, - 0x80000001: 0x8020820, - 0x80000002: 0x8000820, - 0x80000003: 0x8000000, - 0x80000004: 0x8020000, - 0x80000005: 0x20800, - 0x80000006: 0x20820, - 0x80000007: 0x20, - 0x80000008: 0x8000020, - 0x80000009: 0x820, - 0x8000000a: 0x20020, - 0x8000000b: 0x8020800, - 0x8000000c: 0x0, - 0x8000000d: 0x8020020, - 0x8000000e: 0x8000800, - 0x8000000f: 0x20000, - 0x10: 0x20820, - 0x11: 0x8020800, - 0x12: 0x20, - 0x13: 0x800, - 0x14: 0x8000800, - 0x15: 0x8000020, - 0x16: 0x8020020, - 0x17: 0x20000, - 0x18: 0x0, - 0x19: 0x20020, - 0x1a: 0x8020000, - 0x1b: 0x8000820, - 0x1c: 0x8020820, - 0x1d: 0x20800, - 0x1e: 0x820, - 0x1f: 0x8000000, - 0x80000010: 0x20000, - 0x80000011: 0x800, - 0x80000012: 0x8020020, - 0x80000013: 0x20820, - 0x80000014: 0x20, - 0x80000015: 0x8020000, - 0x80000016: 0x8000000, - 0x80000017: 0x8000820, - 0x80000018: 0x8020820, - 0x80000019: 0x8000020, - 0x8000001a: 0x8000800, - 0x8000001b: 0x0, - 0x8000001c: 0x20800, - 0x8000001d: 0x820, - 0x8000001e: 0x20020, - 0x8000001f: 0x8020800 - } - ]; + try { + if (conn.unSendMsgArr.length > 0) { + for (var i in conn.unSendMsgArr) { + var dom = conn.unSendMsgArr[i]; + conn.sendCommand(dom); + delete conn.unSendMsgArr[i]; + } + } + } catch (e) { + console.error(e.message); + } + conn.offLineSendConnecting = false; + conn.logOut = false; + + conn.onOpened({ + canReceive: supportRecMessage, + canSend: supportSedMessage, + accessToken: conn.context.accessToken + }); + } else if (status == Strophe.Status.DISCONNECTING) { + if (conn.isOpened()) { + conn.stopHeartBeat(); + conn.context.status = _code.STATUS_CLOSING; + + error = { + type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, + msg: msg, + reconnect: true + }; + + conflict && (error.conflict = true); + conn.onError(error); + } + } else if (status == Strophe.Status.DISCONNECTED) { + if (conn.isOpened()) { + if (conn.autoReconnectNumTotal < conn.autoReconnectNumMax) { + conn.reconnect(); + return; + } else { + error = { + type: _code.WEBIM_CONNCTION_DISCONNECTED + }; + conn.onError(error); + } + } + conn.context.status = _code.STATUS_CLOSED; + conn.clear(); + conn.onClosed(); + } else if (status == Strophe.Status.AUTHFAIL) { + error = { + type: _code.WEBIM_CONNCTION_AUTH_ERROR + }; - // Masks that select the SBOX input - var SBOX_MASK = [ - 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, - 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f - ]; + conflict && (error.conflict = true); + conn.onError(error); + conn.clear(); + } else if (status == Strophe.Status.ERROR) { + conn.context.status = _code.STATUS_ERROR; + error = { + type: _code.WEBIM_CONNCTION_SERVER_ERROR + }; - /** - * DES block cipher algorithm. - */ - var DES = C_algo.DES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; + conflict && (error.conflict = true); + conn.onError(error); + } + conn.context.status_now = status; + }; - // Select 56 bits according to PC1 - var keyBits = []; - for (var i = 0; i < 56; i++) { - var keyBitPos = PC1[i] - 1; - keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; - } + var _getJid = function _getJid(options, conn) { + var jid = options.toJid || ''; - // Assemble 16 subkeys - var subKeys = this._subKeys = []; - for (var nSubKey = 0; nSubKey < 16; nSubKey++) { - // Create subkey - var subKey = subKeys[nSubKey] = []; + if (jid === '') { + var appKey = conn.context.appKey || ''; + var toJid = appKey + '_' + options.to + '@' + conn.domain; - // Shortcut - var bitShift = BIT_SHIFTS[nSubKey]; + if (options.resource) { + toJid = toJid + '/' + options.resource; + } + jid = toJid; + } + return jid; + }; - // Select 48 bits according to PC2 - for (var i = 0; i < 24; i++) { - // Select from the left 28 key bits - subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + var _getJidByName = function _getJidByName(name, conn) { + var options = { + to: name + }; + return _getJid(options, conn); + }; - // Select from the right 28 key bits - subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); - } + var _validCheck = function _validCheck(options, conn) { + options = options || {}; - // Since each subkey is applied to an expanded 32-bit input, - // the subkey can be broken into 8 values scaled to 32-bits, - // which allows the key to be used without expansion - subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); - for (var i = 1; i < 7; i++) { - subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); - } - subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); - } + if (options.user == '') { + conn.onError({ + type: _code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR + }); + return false; + } - // Compute inverse subkeys - var invSubKeys = this._invSubKeys = []; - for (var i = 0; i < 16; i++) { - invSubKeys[i] = subKeys[15 - i]; - } - }, + var user = options.user + '' || ''; + var appKey = options.appKey || ''; + var devInfos = appKey.split('#'); - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._subKeys); - }, + if (devInfos.length !== 2) { + conn.onError({ + type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR + }); + return false; + } + var orgName = devInfos[0]; + var appName = devInfos[1]; - decryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._invSubKeys); - }, + if (!orgName) { + conn.onError({ + type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR + }); + return false; + } + if (!appName) { + conn.onError({ + type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR + }); + return false; + } - _doCryptBlock: function (M, offset, subKeys) { - // Get input - this._lBlock = M[offset]; - this._rBlock = M[offset + 1]; + var jid = appKey + '_' + user.toLowerCase() + '@' + conn.domain, + resource = options.resource || 'webim'; - // Initial permutation - exchangeLR.call(this, 4, 0x0f0f0f0f); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeRL.call(this, 2, 0x33333333); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeLR.call(this, 1, 0x55555555); + if (conn.isMultiLoginSessions) { + resource += user + new Date().getTime() + Math.floor(Math.random().toFixed(6) * 1000000); + } + conn.context.jid = jid + '/' + resource; + conn.context.userId = user; + conn.context.appKey = appKey; + conn.context.appName = appName; + conn.context.orgName = orgName; - // Rounds - for (var round = 0; round < 16; round++) { - // Shortcuts - var subKey = subKeys[round]; - var lBlock = this._lBlock; - var rBlock = this._rBlock; + return true; + }; - // Feistel function - var f = 0; - for (var i = 0; i < 8; i++) { - f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; - } - this._lBlock = rBlock; - this._rBlock = lBlock ^ f; - } + var _getXmppUrl = function _getXmppUrl(baseUrl, https) { + if (/^(ws|http)s?:\/\/?/.test(baseUrl)) { + return baseUrl; + } - // Undo swap from last round - var t = this._lBlock; - this._lBlock = this._rBlock; - this._rBlock = t; + var url = { + prefix: 'http', + base: '://' + baseUrl, + suffix: '/http-bind/' + }; + + if (https && _utils.isSupportWss) { + url.prefix = 'wss'; + url.suffix = '/ws/'; + } else { + if (https) { + url.prefix = 'https'; + } else if (window.WebSocket) { + url.prefix = 'ws'; + url.suffix = '/ws/'; + } + } + + return url.prefix + url.base + url.suffix; + }; + + /** + * The connection class. + * @constructor + * @param {Object} options - + * @param {String} options.url - xmppURL for xmpp server + * @param {String} options.apiUrl - apiURL for restful API server + * @param {Boolean} options.isHttpDNS - while http:// protocol,use ip directly,instead of ServerName,avoiding DNS problem.default false + * @param {Boolean} options.isMultiLoginSessions - true: A visitor can sign in to multiple webpages and receive messages at all the webpages. false: A visitor can sign in to only one webpage and receive messages at the webpage. + * @param {Boolean} options.https - Whether use wss or not. + * @param {Number} options.heartBeatWait - after login, send empty message to xmpp server like heartBeat every 45s, to keep the ws connection alive. + * @param {Boolean} options.isAutoLogin - set presence after login + * @param {Number} options.autoReconnectNumMax - will auto connect the xmpp server autoReconnectNumMax times in background when client is offline. + * @param {Number} options.autoReconnectInterval - the interval seconds between each auto reconnectting. + * @param {Boolean} options.isWindowSDK - Whether for windows platform. default false. + * @param {Boolean} options.encrypt - whether encrypt text message and emoji message + * @param {Boolean} options.delivery - When a message arrived, whether the receiver send an ack message to the sender or not. + * @param {Number} options.pollingTime - + * @param {Number} options.maxRetries - + * @param {Boolean} options.hold - + * @param {String} options.route - + * @param {String} options.domain - + * @param {Boolean} options.inactivity - + * + * @returns {Class} a single instance of connection + */ + var connection = function connection(options) { + if (!this instanceof connection) { + return new connection(options); + } + + var options = options || {}; + + this.isHttpDNS = options.isHttpDNS || false; + this.isMultiLoginSessions = options.isMultiLoginSessions || false; + this.wait = options.wait || 30; + this.hold = options.hold || 1; + this.retry = options.retry || false; + this.https = options.https || location.protocol === 'https:'; + this.url = _getXmppUrl(options.url, this.https); + this.route = options.route || null; + this.domain = options.domain || 'easemob.com'; + this.inactivity = options.inactivity || 30; + this.heartBeatWait = options.heartBeatWait || 4500; + this.maxRetries = options.maxRetries || 5; + this.isAutoLogin = options.isAutoLogin === false ? false : true; + this.pollingTime = options.pollingTime || 800; + this.stropheConn = false; + this.autoReconnectNumMax = options.autoReconnectNumMax || 0; + this.autoReconnectNumTotal = 0; + this.autoReconnectInterval = options.autoReconnectInterval || 0; + this.context = { status: _code.STATUS_INIT }; + this.sendQueue = new Queue(); //instead of sending message immediately,cache them in this queue + this.intervalId = null; //clearInterval return value + this.apiUrl = options.apiUrl || ''; + this.isWindowSDK = options.isWindowSDK || false; + this.encrypt = options.encrypt || { encrypt: { type: 'none' } }; + this.delivery = options.delivery || false; + this.user = ''; + this.orgName = ''; + this.appName = ''; + this.token = ''; + this.unSendMsgArr = []; + this.offLineSendConnecting = false; + this.logOut = false; + + this.dnsArr = ['https://rs.easemob.com', 'https://rsbak.easemob.com', 'http://182.92.174.78', 'http://112.126.66.111']; //http dns server hosts + this.dnsIndex = 0; //the dns ip used in dnsArr currently + this.dnsTotal = this.dnsArr.length; //max number of getting dns retries + this.restHosts = null; //rest server ips + this.restIndex = 0; //the rest ip used in restHosts currently + this.restTotal = 0; //max number of getting rest token retries + this.xmppHosts = null; //xmpp server ips + this.xmppIndex = 0; //the xmpp ip used in xmppHosts currently + this.xmppTotal = 0; //max number of creating xmpp server connection(ws/bosh) retries - // Final permutation - exchangeLR.call(this, 1, 0x55555555); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeRL.call(this, 2, 0x33333333); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeLR.call(this, 4, 0x0f0f0f0f); + this.groupOption = {}; + }; - // Set output - M[offset] = this._lBlock; - M[offset + 1] = this._rBlock; - }, + connection.prototype.testInit = function (options) { + this.orgName = options.orgName; + this.appName = options.appName; + this.user = options.user; + this.token = options.token; + }; - keySize: 64/32, + /** + * 注册新用户 + * @param {options} options - + */ + connection.prototype.registerUser = function (options) { + if (location.protocol != 'https:' && this.isHttpDNS) { + this.dnsIndex = 0; + this.getHttpDNS(options, 'signup'); + } else { + this.signup(options); + } + }; - ivSize: 64/32, + /** + * 处理发送队列 + * @private + */ + connection.prototype.handelSendQueue = function () { + var options = this.sendQueue.pop(); + if (options !== null) { + this.sendReceiptsMessage(options); + } + }; - blockSize: 64/32 - }); + /** + * 注册监听函数 + * @param {options} options - + */ + connection.prototype.listen = function (options) { + this.onOpened = options.onOpened || _utils.emptyfn; + this.onClosed = options.onClosed || _utils.emptyfn; + this.onTextMessage = options.onTextMessage || _utils.emptyfn; + this.onEmojiMessage = options.onEmojiMessage || _utils.emptyfn; + this.onPictureMessage = options.onPictureMessage || _utils.emptyfn; + this.onAudioMessage = options.onAudioMessage || _utils.emptyfn; + this.onVideoMessage = options.onVideoMessage || _utils.emptyfn; + this.onFileMessage = options.onFileMessage || _utils.emptyfn; + this.onLocationMessage = options.onLocationMessage || _utils.emptyfn; + this.onCmdMessage = options.onCmdMessage || _utils.emptyfn; + this.onPresence = options.onPresence || _utils.emptyfn; + this.onRoster = options.onRoster || _utils.emptyfn; + this.onError = options.onError || _utils.emptyfn; + this.onReceivedMessage = options.onReceivedMessage || _utils.emptyfn; + this.onInviteMessage = options.onInviteMessage || _utils.emptyfn; + this.onDeliverdMessage = options.onDeliveredMessage || _utils.emptyfn; + this.onReadMessage = options.onReadMessage || _utils.emptyfn; + this.onMutedMessage = options.onMutedMessage || _utils.emptyfn; + this.onOffline = options.onOffline || _utils.emptyfn; + this.onOnline = options.onOnline || _utils.emptyfn; + this.onConfirmPop = options.onConfirmPop || _utils.emptyfn; + this.onCreateGroup = options.onCreateGroup || _utils.emptyfn; + //for WindowSDK start + this.onUpdateMyGroupList = options.onUpdateMyGroupList || _utils.emptyfn; + this.onUpdateMyRoster = options.onUpdateMyRoster || _utils.emptyfn; + //for WindowSDK end + this.onBlacklistUpdate = options.onBlacklistUpdate || _utils.emptyfn; - // Swap bits across the left and right words - function exchangeLR(offset, mask) { - var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; - this._rBlock ^= t; - this._lBlock ^= t << offset; - } + _listenNetwork(this.onOnline, this.onOffline); + }; - function exchangeRL(offset, mask) { - var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; - this._lBlock ^= t; - this._rBlock ^= t << offset; - } + /** + * 发送心跳 + * webrtc需要强制心跳,加个默认为false的参数 向下兼容 + * @param {Boolean} forcing - 是否强制发送 + * @private + */ + connection.prototype.heartBeat = function (forcing) { + if (forcing !== true) { + forcing = false; + } + var me = this; + //IE8: strophe auto switch from ws to BOSH, need heartbeat + var isNeed = !/^ws|wss/.test(me.url) || /mobile/.test(navigator.userAgent); - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); - */ - C.DES = BlockCipher._createHelper(DES); + if (this.heartBeatID || !forcing && !isNeed) { + return; + } - /** - * Triple-DES block cipher algorithm. - */ - var TripleDES = C_algo.TripleDES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; + var options = { + toJid: this.domain, + type: 'normal' + }; + this.heartBeatID = setInterval(function () { + // fix: do heartbeat only when websocket + _utils.isSupportWss && me.ping(options); + }, this.heartBeatWait); + }; - // Create DES instances - this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); - this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); - this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); - }, + /** + * @private + */ + connection.prototype.stopHeartBeat = function () { + if (typeof this.heartBeatID == "number") { + this.heartBeatID = clearInterval(this.heartBeatID); + } + }; - encryptBlock: function (M, offset) { - this._des1.encryptBlock(M, offset); - this._des2.decryptBlock(M, offset); - this._des3.encryptBlock(M, offset); - }, + /** + * 发送接收消息回执 + * @param {Object} options - + * @private + */ + connection.prototype.sendReceiptsMessage = function (options) { + var dom = $msg({ + from: this.context.jid || '', + to: this.domain, + id: options.id || '' + }).c('received', { + xmlns: 'urn:xmpp:receipts', + id: options.id || '' + }); + this.sendCommand(dom.tree()); + }; - decryptBlock: function (M, offset) { - this._des3.decryptBlock(M, offset); - this._des2.encryptBlock(M, offset); - this._des1.decryptBlock(M, offset); - }, + /** + * @private + */ + connection.prototype.cacheReceiptsMessage = function (options) { + this.sendQueue.push(options); + }; - keySize: 192/32, + /** + * @private + */ + connection.prototype.getStrophe = function () { + if (location.protocol != 'https:' && this.isHttpDNS) { + //TODO: try this.xmppTotal times on fail + var url = ''; + var host = this.xmppHosts[this.xmppIndex]; + var domain = _utils.getXmlFirstChild(host, 'domain'); + var ip = _utils.getXmlFirstChild(host, 'ip'); + if (ip) { + url = ip.textContent; + var port = _utils.getXmlFirstChild(host, 'port'); + if (port.textContent != '80') { + url += ':' + port.textContent; + } + } else { + url = domain.textContent; + } - ivSize: 64/32, + if (url != '') { + var parter = /(.+\/\/).+(\/.+)/; + this.url = this.url.replace(parter, "$1" + url + "$2"); + } + } - blockSize: 64/32 - }); + var stropheConn = new Strophe.Connection(this.url, { + inactivity: this.inactivity, + maxRetries: this.maxRetries, + pollingTime: this.pollingTime + }); + return stropheConn; + }; - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); - */ - C.TripleDES = BlockCipher._createHelper(TripleDES); - }()); + /** + * + * @param data + * @param tagName + * @private + */ + connection.prototype.getHostsByTag = function (data, tagName) { + var tag = _utils.getXmlFirstChild(data, tagName); + if (!tag) { + console.log(tagName + ' hosts error'); + return null; + } + var hosts = tag.getElementsByTagName('hosts'); + if (hosts.length == 0) { + console.log(tagName + ' hosts error2'); + return null; + } + return hosts[0].getElementsByTagName('host'); + }; + /** + * @private + */ + connection.prototype.getRestFromHttpDNS = function (options, type) { + if (this.restIndex > this.restTotal) { + console.log('rest hosts all tried,quit'); + return; + } + var url = ''; + var host = this.restHosts[this.restIndex]; + var domain = _utils.getXmlFirstChild(host, 'domain'); + var ip = _utils.getXmlFirstChild(host, 'ip'); + if (ip) { + var port = _utils.getXmlFirstChild(host, 'port'); + url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + ip.textContent + ':' + port.textContent; + } else { + url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + domain.textContent; + } - return CryptoJS.TripleDES; + if (url != '') { + this.apiUrl = url; + options.apiUrl = url; + } - })); + if (type == 'login') { + this.login(options); + } else { + this.signup(options); + } + }; -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * @private + */ + connection.prototype.getHttpDNS = function (options, type) { + if (this.restHosts) { + this.getRestFromHttpDNS(options, type); + return; + } + var self = this; + var suc = function suc(data, xhr) { + data = new DOMParser().parseFromString(data, "text/xml").documentElement; + //get rest ips + var restHosts = self.getHostsByTag(data, 'rest'); + if (!restHosts) { + console.log('rest hosts error3'); + return; + } + self.restHosts = restHosts; + self.restTotal = restHosts.length; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + //get xmpp ips + var xmppHosts = self.getHostsByTag(data, 'xmpp'); + if (!xmppHosts) { + console.log('xmpp hosts error3'); + return; + } + self.xmppHosts = xmppHosts; + self.xmppTotal = xmppHosts.length; - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; + self.getRestFromHttpDNS(options, type); + }; + var error = function error(res, xhr, msg) { - /** - * RC4 stream cipher algorithm. - */ - var RC4 = C_algo.RC4 = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - var keySigBytes = key.sigBytes; + console.log('getHttpDNS error', res, msg); + self.dnsIndex++; + if (self.dnsIndex < self.dnsTotal) { + self.getHttpDNS(options, type); + } + }; + var options2 = { + url: this.dnsArr[this.dnsIndex] + '/easemob/server.xml', + dataType: 'text', + type: 'GET', - // Init sbox - var S = this._S = []; - for (var i = 0; i < 256; i++) { - S[i] = i; - } + // url: 'http://www.easemob.com/easemob/server.xml', + // dataType: 'xml', + data: { app_key: encodeURIComponent(options.appKey) }, + success: suc || _utils.emptyfn, + error: error || _utils.emptyfn + }; + _utils.ajax(options2); + }; - // Key setup - for (var i = 0, j = 0; i < 256; i++) { - var keyByteIndex = i % keySigBytes; - var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + /** + * @private + */ + connection.prototype.signup = function (options) { + var self = this; + var orgName = options.orgName || ''; + var appName = options.appName || ''; + var appKey = options.appKey || ''; + var suc = options.success || EMPTYFN; + var err = options.error || EMPTYFN; - j = (j + S[i] + keyByte) % 256; + if (!orgName && !appName && appKey) { + var devInfos = appKey.split('#'); + if (devInfos.length === 2) { + orgName = devInfos[0]; + appName = devInfos[1]; + } + } + if (!orgName && !appName) { + err({ + type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR + }); + return; + } - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - } + var error = function error(res, xhr, msg) { + if (location.protocol != 'https:' && self.isHttpDNS) { + if (self.restIndex + 1 < self.restTotal) { + self.restIndex++; + self.getRestFromHttpDNS(options, 'signup'); + return; + } + } + self.clear(); + err(res); + }; + var https = options.https || https; + var apiUrl = options.apiUrl; + var restUrl = apiUrl + '/' + orgName + '/' + appName + '/users'; - // Counters - this._i = this._j = 0; - }, + var userjson = { + username: options.username, + password: options.password, + nickname: options.nickname || '' + }; - _doProcessBlock: function (M, offset) { - M[offset] ^= generateKeystreamWord.call(this); - }, + var userinfo = _utils.stringify(userjson); + var options2 = { + url: restUrl, + dataType: 'json', + data: userinfo, + success: suc, + error: error + }; + _utils.ajax(options2); + }; - keySize: 256/32, + /** + * 登录 + * @param {Object} options - + */ + connection.prototype.open = function (options) { + var appkey = options.appKey, + orgName = appkey.split('#')[0], + appName = appkey.split('#')[1]; + this.orgName = orgName; + this.appName = appName; + if (options.accessToken) { + this.token = options.accessToken; + } + if (options.xmppURL) { + this.url = _getXmppUrl(options.xmppURL, this.https); + } + if (location.protocol != 'https:' && this.isHttpDNS) { + this.dnsIndex = 0; + this.getHttpDNS(options, 'login'); + } else { + this.login(options); + } + }; - ivSize: 0 - }); + /** + * + * @param options + * @private + */ + connection.prototype.login = function (options) { + this.user = options.user; + var pass = _validCheck(options, this); - function generateKeystreamWord() { - // Shortcuts - var S = this._S; - var i = this._i; - var j = this._j; + if (!pass) { + return; + } - // Generate keystream word - var keystreamWord = 0; - for (var n = 0; n < 4; n++) { - i = (i + 1) % 256; - j = (j + S[i]) % 256; + var conn = this; - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; + if (conn.isOpened()) { + return; + } - keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); - } + if (options.accessToken) { + options.access_token = options.accessToken; + conn.context.restTokenData = options; + _login(options, conn); + } else { + var apiUrl = options.apiUrl; + var userId = this.context.userId; + var pwd = options.pwd || ''; + var appName = this.context.appName; + var orgName = this.context.orgName; - // Update counters - this._i = i; - this._j = j; + var suc = function suc(data, xhr) { + conn.context.status = _code.STATUS_DOLOGIN_IM; + conn.context.restTokenData = data; + if (options.success) options.success(data); + conn.token = data.access_token; + _login(data, conn); + }; + var error = function error(res, xhr, msg) { + if (options.error) options.error(); + if (location.protocol != 'https:' && conn.isHttpDNS) { + if (conn.restIndex + 1 < conn.restTotal) { + conn.restIndex++; + conn.getRestFromHttpDNS(options, 'login'); + return; + } + } + conn.clear(); + if (res.error && res.error_description) { + conn.onError({ + type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, + data: res, + xhr: xhr + }); + } else { + conn.onError({ + type: _code.WEBIM_CONNCTION_OPEN_ERROR, + data: res, + xhr: xhr + }); + } + }; - return keystreamWord; - } + this.context.status = _code.STATUS_DOLOGIN_USERGRID; - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); - */ - C.RC4 = StreamCipher._createHelper(RC4); + var loginJson = { + grant_type: 'password', + username: userId, + password: pwd, + timestamp: +new Date() + }; + var loginfo = _utils.stringify(loginJson); - /** - * Modified RC4 stream cipher algorithm. - */ - var RC4Drop = C_algo.RC4Drop = RC4.extend({ - /** - * Configuration options. - * - * @property {number} drop The number of keystream words to drop. Default 192 - */ - cfg: RC4.cfg.extend({ - drop: 192 - }), + var options2 = { + url: apiUrl + '/' + orgName + '/' + appName + '/token', + dataType: 'json', + data: loginfo, + success: suc || _utils.emptyfn, + error: error || _utils.emptyfn + }; + _utils.ajax(options2); + } + }; - _doReset: function () { - RC4._doReset.call(this); + /** + * attach to xmpp server for BOSH + * @private + */ + connection.prototype.attach = function (options) { + var pass = _validCheck(options, this); - // Drop - for (var i = this.cfg.drop; i > 0; i--) { - generateKeystreamWord.call(this); - } - } - }); + if (!pass) { + return; + } - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); - */ - C.RC4Drop = StreamCipher._createHelper(RC4Drop); - }()); + options = options || {}; + var accessToken = options.accessToken || ''; + if (accessToken == '') { + this.onError({ + type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR + }); + return; + } - return CryptoJS.RC4; + var sid = options.sid || ''; + if (sid === '') { + this.onError({ + type: _code.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR + }); + return; + } - })); + var rid = options.rid || ''; + if (rid === '') { + this.onError({ + type: _code.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR + }); + return; + } -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { + stropheConn = this.getStrophe(); - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + this.context.accessToken = accessToken; + this.context.stropheConn = stropheConn; + this.context.status = _code.STATUS_DOLOGIN_IM; - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; + var conn = this; + var callback = function callback(status, msg) { + _loginCallback(status, msg, conn); + }; - // Reusable objects - var S = []; - var C_ = []; - var G = []; + var jid = this.context.jid; + var wait = this.wait; + var hold = this.hold; + var wind = this.wind || 5; + stropheConn.attach(jid, sid, rid, callback, wait, hold, wind); + }; - /** - * Rabbit stream cipher algorithm - */ - var Rabbit = C_algo.Rabbit = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; + /** + * close connection + * @param {String} reason + */ + connection.prototype.close = function (reason) { + this.logOut = true; + this.stopHeartBeat(); - // Swap endian - for (var i = 0; i < 4; i++) { - K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | - (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); - } + var status = this.context.status; + if (status == _code.STATUS_INIT) { + return; + } - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; + if (this.isClosed() || this.isClosing()) { + return; + } - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; + this.context.status = _code.STATUS_CLOSING; + this.context.stropheConn.disconnect(reason); + }; - // Carry bit - this._b = 0; + /** + * @private + */ + connection.prototype.addHandler = function (handler, ns, name, type, id, from, options) { + this.context.stropheConn.addHandler(handler, ns, name, type, id, from, options); + }; - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } + /** + * @private + */ + connection.prototype.notifyVersion = function (suc, fail) { + var jid = stropheConn.getJid(); + this.context.jid = jid; + var dom = $iq({ + from: jid || '', + to: this.domain, + type: 'result' + }).c('query', { xmlns: 'jabber:iq:version' }).c('name').t('easemob').up().c('version').t(_version).up().c('os').t('webim'); - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } + var suc = suc || _utils.emptyfn; + var error = fail || this.onError; + var failFn = function failFn(ele) { + error({ + type: _code.WEBIM_CONNCTION_NOTIFYVERSION_ERROR, + data: ele + }); + }; + this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); + return; + }; - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; + /** + * handle all types of presence message + * @private + */ + connection.prototype.handlePresence = function (msginfo) { + console.log('Info: ', typeof msginfo === 'undefined' ? 'undefined' : _typeof(msginfo)); + if (this.isClosed()) { + return; + } + var from = msginfo.getAttribute('from') || ''; + var to = msginfo.getAttribute('to') || ''; + var type = msginfo.getAttribute('type') || ''; + var presence_type = msginfo.getAttribute('presence_type') || ''; + var fromUser = _parseNameFromJidFn(from); + var toUser = _parseNameFromJidFn(to); + var isCreate = false; + var isMemberJoin = false; + var isDecline = false; + var isApply = false; + var info = { + from: fromUser, + to: toUser, + fromJid: from, + toJid: to, + type: type, + chatroom: msginfo.getElementsByTagName('roomtype').length ? true : false + }; - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); + var showTags = msginfo.getElementsByTagName('show'); + if (showTags && showTags.length > 0) { + var showTag = showTags[0]; + info.show = Strophe.getText(showTag); + } + var statusTags = msginfo.getElementsByTagName('status'); + if (statusTags && statusTags.length > 0) { + var statusTag = statusTags[0]; + info.status = Strophe.getText(statusTag); + info.code = statusTag.getAttribute('code'); + } + + var priorityTags = msginfo.getElementsByTagName('priority'); + if (priorityTags && priorityTags.length > 0) { + var priorityTag = priorityTags[0]; + info.priority = Strophe.getText(priorityTag); + } - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; + var error = msginfo.getElementsByTagName('error'); + if (error && error.length > 0) { + var error = error[0]; + info.error = { + code: error.getAttribute('code') + }; + } - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, + var destroy = msginfo.getElementsByTagName('destroy'); + if (destroy && destroy.length > 0) { + var destroy = destroy[0]; + info.destroy = true; - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; + var reason = destroy.getElementsByTagName('reason'); + if (reason && reason.length > 0) { + info.reason = Strophe.getText(reason[0]); + } + } - // Iterate the system - nextState.call(this); + var members = msginfo.getElementsByTagName('item'); + if (members && members.length > 0) { + var member = members[0]; + var role = member.getAttribute('role'); + var jid = member.getAttribute('jid'); + var affiliation = member.getAttribute('affiliation'); + // dismissed by group + if (role == 'none' && jid) { + var kickedMember = _parseNameFromJidFn(jid); + var actor = member.getElementsByTagName('actor')[0]; + var actorNick = actor.getAttribute('nick'); + info.actor = actorNick; + info.kicked = kickedMember; + } + // Service Acknowledges Room Creation `createGroupACK` + if (role == 'moderator' && info.code == '201') { + if (affiliation === 'owner') { + info.type = 'createGroupACK'; + isCreate = true; + } + // else + // info.type = 'joinPublicGroupSuccess'; + } + } - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + var x = msginfo.getElementsByTagName('x'); + if (x && x.length > 0) { + // 加群申请 + var apply = x[0].getElementsByTagName('apply'); + // 加群成功 + var accept = x[0].getElementsByTagName('accept'); + // 同意加群后用户进群通知 + var item = x[0].getElementsByTagName('item'); + // 加群被拒绝 + var decline = x[0].getElementsByTagName('decline'); + // 被设为管理员 + var addAdmin = x[0].getElementsByTagName('add_admin'); + // 被取消管理员 + var removeAdmin = x[0].getElementsByTagName('remove_admin'); + // 被禁言 + var addMute = x[0].getElementsByTagName('add_mute'); + // 取消禁言 + var removeMute = x[0].getElementsByTagName('remove_mute'); - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + if (apply && apply.length > 0) { + isApply = true; + info.toNick = apply[0].getAttribute('toNick'); + info.type = 'joinGroupNotifications'; + var groupJid = apply[0].getAttribute('to'); + var gid = groupJid.split('@')[0].split('_'); + gid = gid[gid.length - 1]; + info.gid = gid; + } else if (accept && accept.length > 0) { + info.type = 'joinPublicGroupSuccess'; + } else if (item && item.length > 0) { + var affiliation = item[0].getAttribute('affiliation'), + role = item[0].getAttribute('role'); + if (affiliation == 'member' || role == 'participant') { + isMemberJoin = true; + info.mid = info.fromJid.split('/'); + info.mid = info.mid[info.mid.length - 1]; + info.type = 'memberJoinPublicGroupSuccess'; + var roomtype = msginfo.getElementsByTagName('roomtype'); + if (roomtype && roomtype.length > 0) { + var type = roomtype[0].getAttribute('type'); + if (type == 'chatroom') { + info.type = 'memberJoinChatRoomSuccess'; + } + } + } + } else if (decline && decline.length) { + isDecline = true; + var gid = decline[0].getAttribute("fromNick"); + var owner = _parseNameFromJidFn(decline[0].getAttribute("from")); + info.type = "joinPublicGroupDeclined"; + info.owner = owner; + info.gid = gid; + } else if (addAdmin && addAdmin.length > 0) { + var gid = _parseNameFromJidFn(addAdmin[0].getAttribute('mucjid')); + var owner = _parseNameFromJidFn(addAdmin[0].getAttribute('from')); + info.owner = owner; + info.gid = gid; + info.type = "addAdmin"; + } else if (removeAdmin && removeAdmin.length > 0) { + var gid = _parseNameFromJidFn(removeAdmin[0].getAttribute('mucjid')); + var owner = _parseNameFromJidFn(removeAdmin[0].getAttribute('from')); + info.owner = owner; + info.gid = gid; + info.type = "removeAdmin"; + } else if (addMute && addMute.length > 0) { + var gid = _parseNameFromJidFn(addMute[0].getAttribute('mucjid')); + var owner = _parseNameFromJidFn(addMute[0].getAttribute('from')); + info.owner = owner; + info.gid = gid; + info.type = "addMute"; + } else if (removeMute && removeMute.length > 0) { + var gid = _parseNameFromJidFn(removeMute[0].getAttribute('mucjid')); + var owner = _parseNameFromJidFn(removeMute[0].getAttribute('from')); + info.owner = owner; + info.gid = gid; + info.type = "removeMute"; + } + } - // Encrypt - M[offset + i] ^= S[i]; - } - }, + if (info.chatroom) { + // diff the + info.presence_type = presence_type; + info.original_type = info.type; + var reflectUser = from.slice(from.lastIndexOf('/') + 1); - blockSize: 128/32, + if (reflectUser === this.context.userId) { + if (info.type === '' && !info.code) { + info.type = 'joinChatRoomSuccess'; + } else if (presence_type === 'unavailable' || info.type === 'unavailable') { + if (!info.status) { + // logout successfully. + info.type = 'leaveChatRoom'; + } else if (info.code == 110) { + // logout or dismissied by admin. + info.type = 'leaveChatRoom'; + } else if (info.error && info.error.code == 406) { + // The chat room is full. + info.type = 'reachChatRoomCapacity'; + } + } + } + } else { + info.presence_type = presence_type; + info.original_type = type; - ivSize: 64/32 - }); + if (/subscribe/.test(info.type)) { + //subscribe | subscribed | unsubscribe | unsubscribed + } else if (type == "" && !info.status && !info.error && !isCreate && !isApply && !isMemberJoin && !isDecline) { + console.log(2222222, msginfo, info, isApply); + // info.type = 'joinPublicGroupSuccess'; + } else if (presence_type === 'unavailable' || type === 'unavailable') { + // There is no roomtype when a chat room is deleted. + if (info.destroy) { + // Group or Chat room Deleted. + info.type = 'deleteGroupChat'; + } else if (info.code == 307 || info.code == 321) { + // Dismissed by group. + var nick = msginfo.getAttribute('nick'); + if (!nick) info.type = 'leaveGroup';else info.type = 'removedFromGroup'; + } + } + } + this.onPresence(info, msginfo); + }; - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; + /** + * @private + */ + connection.prototype.handlePing = function (e) { + if (this.isClosed()) { + return; + } + var id = e.getAttribute('id'); + var from = e.getAttribute('from'); + var to = e.getAttribute('to'); + var dom = $iq({ + from: to, + to: from, + id: id, + type: 'result' + }); + this.sendCommand(dom.tree()); + }; - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } + /** + * @private + */ + connection.prototype.handleIq = function (iq) { + return true; + }; - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + /** + * @private + */ + connection.prototype.handleIqPrivacy = function (msginfo) { + var list = msginfo.getElementsByTagName('list'); + if (list.length == 0) { + return; + } + this.getBlacklist(); + }; - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; + /** + * @private + */ + connection.prototype.handleIqRoster = function (e) { + var id = e.getAttribute('id'); + var from = e.getAttribute('from') || ''; + var name = _parseNameFromJidFn(from); + var curJid = this.context.jid; + var curUser = this.context.userId; - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; + var iqresult = $iq({ type: 'result', id: id, from: curJid }); + this.sendCommand(iqresult.tree()); + + var msgBodies = e.getElementsByTagName('query'); + if (msgBodies && msgBodies.length > 0) { + var queryTag = msgBodies[0]; + var rouster = _parseFriend(queryTag, this, from); + this.onRoster(rouster); + } + return true; + }; - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + /** + * @private + */ + connection.prototype.handleMessage = function (msginfo) { + var self = this; + if (this.isClosed()) { + return; + } - // High XOR low - G[i] = gh ^ gl; - } + var id = msginfo.getAttribute('id') || ''; - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } + // cache ack into sendQueue first , handelSendQueue will do the send thing with the speed of 5/s + this.cacheReceiptsMessage({ + id: id + }); + var parseMsgData = _parseResponseMessage(msginfo); + if (parseMsgData.errorMsg) { + this.handlePresence(msginfo); + return; + } + // send error + var error = msginfo.getElementsByTagName('error'); + var errorCode = ''; + var errorText = ''; + var errorBool = false; + if (error.length > 0) { + errorBool = true; + errorCode = error[0].getAttribute('code'); + var textDOM = error[0].getElementsByTagName('text'); + errorText = textDOM[0].textContent || textDOM[0].text; + } - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); - * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); - */ - C.Rabbit = StreamCipher._createHelper(Rabbit); - }()); + var msgDatas = parseMsgData.data; + for (var i in msgDatas) { + if (!msgDatas.hasOwnProperty(i)) { + continue; + } + var msg = msgDatas[i]; + if (!msg.from || !msg.to) { + continue; + } + var from = (msg.from + '').toLowerCase(); + var too = (msg.to + '').toLowerCase(); + var extmsg = msg.ext || {}; + var chattype = ''; + var typeEl = msginfo.getElementsByTagName('roomtype'); + if (typeEl.length) { + chattype = typeEl[0].getAttribute('type') || 'chat'; + } else { + chattype = msginfo.getAttribute('type') || 'chat'; + } - return CryptoJS.Rabbit; + var msgBodies = msg.bodies; + if (!msgBodies || msgBodies.length == 0) { + continue; + } + var msgBody = msg.bodies[0]; + var type = msgBody.type; - })); + try { + switch (type) { + case 'txt': + var receiveMsg = msgBody.msg; + if (self.encrypt.type === 'base64') { + receiveMsg = atob(receiveMsg); + } else if (self.encrypt.type === 'aes') { + var key = CryptoJS.enc.Utf8.parse(self.encrypt.key); + var iv = CryptoJS.enc.Utf8.parse(self.encrypt.iv); + var mode = self.encrypt.mode.toLowerCase(); + var option = {}; + if (mode === 'cbc') { + option = { + iv: iv, + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7 + }; + } else if (mode === 'ebc') { + option = { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }; + } + var encryptedBase64Str = receiveMsg; + var decryptedData = CryptoJS.AES.decrypt(encryptedBase64Str, key, option); + var decryptedStr = decryptedData.toString(CryptoJS.enc.Utf8); + receiveMsg = decryptedStr; + } + var emojibody = _utils.parseTextMessage(receiveMsg, WebIM.Emoji); + if (emojibody.isemoji) { + var msg = { + id: id, + type: chattype, + from: from, + to: too, + delay: parseMsgData.delayTimeStamp, + data: emojibody.body, + ext: extmsg + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onEmojiMessage(msg); + } else { + var msg = { + id: id, + type: chattype, + from: from, + to: too, + delay: parseMsgData.delayTimeStamp, + data: receiveMsg, + ext: extmsg + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onTextMessage(msg); + } + break; + case 'img': + var rwidth = 0; + var rheight = 0; + if (msgBody.size) { + rwidth = msgBody.size.width; + rheight = msgBody.size.height; + } + var msg = { + id: id, + type: chattype, + from: from, + to: too, + + url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, + secret: msgBody.secret, + filename: msgBody.filename, + thumb: msgBody.thumb, + thumb_secret: msgBody.thumb_secret, + file_length: msgBody.file_length || '', + width: rwidth, + height: rheight, + filetype: msgBody.filetype || '', + accessToken: this.context.accessToken || '', + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onPictureMessage(msg); + break; + case 'audio': + var msg = { + id: id, + type: chattype, + from: from, + to: too, + + url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, + secret: msgBody.secret, + filename: msgBody.filename, + length: msgBody.length || '', + file_length: msgBody.file_length || '', + filetype: msgBody.filetype || '', + accessToken: this.context.accessToken || '', + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onAudioMessage(msg); + break; + case 'file': + var msg = { + id: id, + type: chattype, + from: from, + to: too, + + url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, + secret: msgBody.secret, + filename: msgBody.filename, + file_length: msgBody.file_length, + accessToken: this.context.accessToken || '', + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onFileMessage(msg); + break; + case 'loc': + var msg = { + id: id, + type: chattype, + from: from, + to: too, + addr: msgBody.addr, + lat: msgBody.lat, + lng: msgBody.lng, + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onLocationMessage(msg); + break; + case 'video': + var msg = { + id: id, + type: chattype, + from: from, + to: too, + + url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, + secret: msgBody.secret, + filename: msgBody.filename, + file_length: msgBody.file_length, + accessToken: this.context.accessToken || '', + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onVideoMessage(msg); + break; + case 'cmd': + var msg = { + id: id, + from: from, + to: too, + action: msgBody.action, + ext: extmsg, + delay: parseMsgData.delayTimeStamp + }; + !msg.delay && delete msg.delay; + msg.error = errorBool; + msg.errorText = errorText; + msg.errorCode = errorCode; + this.onCmdMessage(msg); + break; + } + ; + if (self.delivery) { + var msgId = self.getUniqueId(); + var bodyId = msg.id; + var deliverMessage = new WebIM.message('delivery', msgId); + deliverMessage.set({ + id: bodyId, + to: msg.from + }); + self.send(deliverMessage.body); + } + } catch (e) { + this.onError({ + type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, + data: e + }); + } + } + }; -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * @private + */ + connection.prototype.handleDeliveredMessage = function (message) { + var id = message.id; + var body = message.getElementsByTagName('body'); + var mid = 0; + if (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML; + var msg = { + mid: mid + }; + this.onDeliverdMessage(msg); + this.sendReceiptsMessage({ + id: id + }); + }; - ;(function (root, factory, undef) { - if (true) { - // CommonJS - module.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22)); - } - else if (typeof define === "function" && define.amd) { - // AMD - define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); - } - else { - // Global (browser) - factory(root.CryptoJS); - } - }(this, function (CryptoJS) { + /** + * @private + */ + connection.prototype.handleAckedMessage = function (message) { + var id = message.id; + var body = message.getElementsByTagName('body'); + var mid = 0; + if (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML; + var msg = { + mid: mid + }; + this.onReadMessage(msg); + this.sendReceiptsMessage({ + id: id + }); + }; - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; + /** + * @private + */ + connection.prototype.handleReceivedMessage = function (message) { + try { + var received = message.getElementsByTagName("received"); + var mid = received[0].getAttribute('mid'); + var body = message.getElementsByTagName("body"); + var id = body[0].innerHTML; + var msg = { + mid: mid, + id: id + }; + this.onReceivedMessage(msg); + } catch (e) { + this.onError({ + type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, + data: e + }); + } - // Reusable objects - var S = []; - var C_ = []; - var G = []; + var rcv = message.getElementsByTagName('received'), + id, + mid; - /** - * Rabbit stream cipher algorithm. - * - * This is a legacy version that neglected to convert the key to little-endian. - * This error doesn't affect the cipher's security, - * but it does affect its compatibility with other implementations. - */ - var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; + if (rcv.length > 0) { + if (rcv[0].childNodes && rcv[0].childNodes.length > 0) { + id = rcv[0].childNodes[0].nodeValue; + } else { + id = rcv[0].innerHTML || rcv[0].innerText; + } + mid = rcv[0].getAttribute('mid'); + } - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; + if (_msgHash[id]) { + try { + _msgHash[id].msg.success instanceof Function && _msgHash[id].msg.success(id, mid); + } catch (e) { + this.onError({ + type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, + data: e + }); + } + delete _msgHash[id]; + } + }; - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; + /** + * @private + */ + connection.prototype.handleInviteMessage = function (message) { + var form = null; + var invitemsg = message.getElementsByTagName('invite'); + var reasonDom = message.getElementsByTagName('reason')[0]; + var reasonMsg = reasonDom.textContent; + var id = message.getAttribute('id') || ''; + this.sendReceiptsMessage({ + id: id + }); - // Carry bit - this._b = 0; + if (invitemsg && invitemsg.length > 0) { + var fromJid = invitemsg[0].getAttribute('from'); + form = _parseNameFromJidFn(fromJid); + } + var xmsg = message.getElementsByTagName('x'); + var roomid = null; + if (xmsg && xmsg.length > 0) { + for (var i = 0; i < xmsg.length; i++) { + if ('jabber:x:conference' === xmsg[i].namespaceURI) { + var roomjid = xmsg[i].getAttribute('jid'); + roomid = _parseNameFromJidFn(roomjid); + } + } + } + this.onInviteMessage({ + type: 'invite', + from: form, + roomid: roomid, + reason: reasonMsg + }); + }; - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } + /** + * @private + */ + connection.prototype.handleMutedMessage = function (message) { + var id = message.id; + this.onMutedMessage({ + mid: id + }); + }; - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } + /** + * @private + */ + connection.prototype.sendCommand = function (dom, id) { + if (this.isOpened()) { + this.context.stropheConn.send(dom); + } else { + this.unSendMsgArr.push(dom); + if (!this.offLineSendConnecting && !this.logOut) { + this.offLineSendConnecting = true; + this.reconnect(); + } + this.onError({ + type: _code.WEBIM_CONNCTION_DISCONNECTED, + reconnect: true + }); + } + }; - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; + /** + * gen uuid with customized prefix + * @param {String} prefix + * @returns {string} + */ + connection.prototype.getUniqueId = function (prefix) { + // fix: too frequently msg sending will make same id + if (this.autoIncrement) { + this.autoIncrement++; + } else { + this.autoIncrement = 1; + } + var cdate = new Date(); + var offdate = new Date(2010, 1, 1); + var offset = cdate.getTime() - offdate.getTime(); + var hexd = parseFloat(offset).toString(16) + this.autoIncrement; - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); + if (typeof prefix === 'string' || typeof prefix === 'number') { + return prefix + '_' + hexd; + } else { + return 'WEBIM_' + hexd; + } + }; - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; + /** + * send message + * @param {Object} messageSource + */ + connection.prototype.send = function (messageSource) { + var self = this; + var message = messageSource; + if (message.type === 'txt') { + if (this.encrypt.type === 'base64') { + message = _.clone(messageSource); + message.msg = btoa(message.msg); + } else if (this.encrypt.type === 'aes') { + message = _.clone(messageSource); + var key = CryptoJS.enc.Utf8.parse(this.encrypt.key); + var iv = CryptoJS.enc.Utf8.parse(this.encrypt.iv); + var mode = this.encrypt.mode.toLowerCase(); + var option = {}; + if (mode === 'cbc') { + option = { + iv: iv, + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7 + }; + } else if (mode === 'ebc') { + option = { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }; + } + var encryptedData = CryptoJS.AES.encrypt(message.msg, key, option); - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, + message.msg = encryptedData.toString(); + } + } + if (this.isWindowSDK) { + WebIM.doQuery('{"type":"sendMessage","to":"' + message.to + '","message_type":"' + message.type + '","msg":"' + encodeURI(message.msg) + '","chatType":"' + message.chatType + '"}', function (response) {}, function (code, msg) { + var message = { + data: { + data: "send" + }, + type: _code.WEBIM_MESSAGE_SED_ERROR + }; + self.onError(message); + }); + } else { + if (Object.prototype.toString.call(message) === '[object Object]') { + var appKey = this.context.appKey || ''; + var toJid = appKey + '_' + message.to + '@' + this.domain; - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; + if (message.group) { + toJid = appKey + '_' + message.to + '@conference.' + this.domain; + } + if (message.resource) { + toJid = toJid + '/' + message.resource; + } - // Iterate the system - nextState.call(this); + message.toJid = toJid; + message.id = message.id || this.getUniqueId(); + _msgHash[message.id] = new _message(message); + _msgHash[message.id].send(this); + } else if (typeof message === 'string') { + _msgHash[message] && _msgHash[message].send(this); + } + } + }; - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + /** + * 添加联系人 + * @param {Object} options + * @deprecated + */ + connection.prototype.addRoster = function (options) { + var jid = _getJid(options, this); + var name = options.name || ''; + var groups = options.groups || ''; - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + var iq = $iq({ type: 'set' }); + iq.c('query', { xmlns: 'jabber:iq:roster' }); + iq.c('item', { jid: jid, name: name }); - // Encrypt - M[offset + i] ^= S[i]; - } - }, + if (groups) { + for (var i = 0; i < groups.length; i++) { + iq.c('group').t(groups[i]).up(); + } + } + var suc = options.success || _utils.emptyfn; + var error = options.error || _utils.emptyfn; + this.context.stropheConn.sendIQ(iq.tree(), suc, error); + }; - blockSize: 128/32, + /** + * 删除联系人 + * @param {Object} options + */ + connection.prototype.removeRoster = function (options) { + var jid = _getJid(options, this); + var iq = $iq({ type: 'set' }).c('query', { xmlns: 'jabber:iq:roster' }).c('item', { + jid: jid, + subscription: 'remove' + }); - ivSize: 64/32 - }); + var suc = options.success || _utils.emptyfn; + var error = options.error || _utils.emptyfn; + this.context.stropheConn.sendIQ(iq, suc, error); + }; - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; + /** + * 获取联系人 + * @param {Object} options + */ + connection.prototype.getRoster = function (options) { + var conn = this; + var dom = $iq({ + type: 'get' + }).c('query', { xmlns: 'jabber:iq:roster' }); - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } + var options = options || {}; + var suc = options.success || this.onRoster; + var completeFn = function completeFn(ele) { + var rouster = []; + var msgBodies = ele.getElementsByTagName('query'); + if (msgBodies && msgBodies.length > 0) { + var queryTag = msgBodies[0]; + rouster = _parseFriend(queryTag); + } + suc(rouster, ele); + }; + var error = options.error || this.onError; + var failFn = function failFn(ele) { + error({ + type: _code.WEBIM_CONNCTION_GETROSTER_ERROR, + data: ele + }); + }; + if (this.isOpened()) { + this.context.stropheConn.sendIQ(dom.tree(), completeFn, failFn); + } else { + error({ + type: _code.WEBIM_CONNCTION_DISCONNECTED + }); + } + }; - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + /** + * 订阅 + * @param {Object} options + */ + connection.prototype.subscribe = function (options) { + var jid = _getJid(options, this); + var pres = $pres({ to: jid, type: 'subscribe' }); + if (options.message) { + pres.c('status').t(options.message).up(); + } + if (options.nick) { + pres.c('nick', { 'xmlns': 'http://jabber.org/protocol/nick' }).t(options.nick); + } + this.sendCommand(pres.tree()); + }; - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; + /** + * 订阅成功 + * @param {Object} options + */ + connection.prototype.subscribed = function (options) { + var jid = _getJid(options, this); + var pres = $pres({ to: jid, type: 'subscribed' }); - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; + if (options.message) { + pres.c('status').t(options.message).up(); + } + this.sendCommand(pres.tree()); + }; - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + /** + * 取消订阅成功 + * @param {Object} options + * @deprecated + */ + connection.prototype.unsubscribe = function (options) { + var jid = _getJid(options, this); + var pres = $pres({ to: jid, type: 'unsubscribe' }); - // High XOR low - G[i] = gh ^ gl; - } + if (options.message) { + pres.c('status').t(options.message); + } + this.sendCommand(pres.tree()); + }; - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } + /** + * 取消订阅成功 + * @param {Object} options + */ + connection.prototype.unsubscribed = function (options) { + var jid = _getJid(options, this); + var pres = $pres({ to: jid, type: 'unsubscribed' }); - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); - */ - C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); - }()); + if (options.message) { + pres.c('status').t(options.message).up(); + } + this.sendCommand(pres.tree()); + }; + /** + * 加入公开群组 + * @param {Object} options + * @deprecated + */ + connection.prototype.joinPublicGroup = function (options) { + var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; + var room_nick = roomJid + '/' + this.context.userId; + var suc = options.success || _utils.emptyfn; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_JOINROOM_ERROR, + data: ele + }); + }; + var iq = $pres({ + from: this.context.jid, + to: room_nick + }).c('x', { xmlns: Strophe.NS.MUC }); - return CryptoJS.RabbitLegacy; + this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); + }; - })); + /** + * 获取聊天室列表 + * @param {Object} options + * @deprecated + */ + connection.prototype.listRooms = function (options) { + var iq = $iq({ + to: options.server || 'conference.' + this.domain, + from: this.context.jid, + type: 'get' + }).c('query', { xmlns: Strophe.NS.DISCO_ITEMS }); -/***/ }), -/* 39 */ -/***/ (function(module, exports) { + var suc = options.success || _utils.emptyfn; + var error = options.error || this.onError; + var completeFn = function completeFn(result) { + var rooms = []; + rooms = _parseRoom(result); + try { + suc(rooms); + } catch (e) { + error({ + type: _code.WEBIM_CONNCTION_GETROOM_ERROR, + data: e + }); + } + }; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_GETROOM_ERROR, + data: ele + }); + }; + this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); + }; - ;(function () { - function Array_h(length) { - this.array = length === undefined ? [] : new Array(length); - } + /** + * 获取聊天室成员列表 + * @param {Object} options + */ + connection.prototype.queryRoomMember = function (options) { + var domain = this.domain; + var members = []; + var iq = $iq({ + to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain, + type: 'get' + }).c('query', { xmlns: Strophe.NS.MUC + '#admin' }).c('item', { affiliation: 'member' }); - Array_h.prototype = { - /** - * 返回数组长度 - * - * @return {Number} length [数组长度] - */ - length: function () { - return this.array.length; - }, + var suc = options.success || _utils.emptyfn; + var completeFn = function completeFn(result) { + var items = result.getElementsByTagName('item'); - at: function (index) { - return this.array[index]; - }, + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mem = { + jid: item.getAttribute('jid'), + affiliation: 'member' + }; + members.push(mem); + } + } + suc(members); + }; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR, + data: ele + }); + }; + this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); + }; - set: function (index, obj) { - this.array[index] = obj; - }, + /** + * 获取聊天室信息 + * @param {Object} options + */ + connection.prototype.queryRoomInfo = function (options) { + var domain = this.domain; + var iq = $iq({ + to: this.context.appKey + '_' + options.roomId + '@conference.' + domain, + type: 'get' + }).c('query', { xmlns: Strophe.NS.DISCO_INFO }); - /** - * 向数组的末尾添加一个或多个元素,并返回新的长度。 - * - * @param {*} obj [description] - * @return {Number} length [新数组的长度] - */ - push: function (obj) { - return this.array.push(obj); - }, + var suc = options.success || _utils.emptyfn; + var members = []; - /** - * 返回数组中选定的元素 - * - * @param {Number} start [开始索引值] - * @param {Number} end [结束索引值] - * @return {Array} newArray [新的数组] - */ - slice: function (start, end) { - return this.array = this.array.slice(start, end); - }, + var completeFn = function completeFn(result) { + var settings = ''; + var features = result.getElementsByTagName('feature'); + if (features) { + settings = features[1].getAttribute('var') + '|' + features[3].getAttribute('var') + '|' + features[4].getAttribute('var'); + } + switch (settings) { + case 'muc_public|muc_membersonly|muc_notallowinvites': + settings = 'PUBLIC_JOIN_APPROVAL'; + break; + case 'muc_public|muc_open|muc_notallowinvites': + settings = 'PUBLIC_JOIN_OPEN'; + break; + case 'muc_hidden|muc_membersonly|muc_allowinvites': + settings = 'PRIVATE_MEMBER_INVITE'; + break; + case 'muc_hidden|muc_membersonly|muc_notallowinvites': + settings = 'PRIVATE_OWNER_INVITE'; + break; + } + var owner = ''; + var fields = result.getElementsByTagName('field'); + var fieldValues = {}; + if (fields) { + for (var i = 0; i < fields.length; i++) { + var field = fields[i]; + var fieldVar = field.getAttribute('var'); + var fieldSimplify = fieldVar.split('_')[1]; + switch (fieldVar) { + case 'muc#roominfo_occupants': + case 'muc#roominfo_maxusers': + case 'muc#roominfo_affiliations': + case 'muc#roominfo_description': + fieldValues[fieldSimplify] = field.textContent || field.text || ''; + break; + case 'muc#roominfo_owner': + var mem = { + jid: (field.textContent || field.text) + '@' + domain, + affiliation: 'owner' + }; + members.push(mem); + fieldValues[fieldSimplify] = field.textContent || field.text; + break; + } - concat: function (array) { - this.array = this.array.concat(array); - }, + // if (field.getAttribute('label') === 'owner') { + // var mem = { + // jid: (field.textContent || field.text) + '@' + domain + // , affiliation: 'owner' + // }; + // members.push(mem); + // break; + // } + } + fieldValues['name'] = result.getElementsByTagName('identity')[0].getAttribute('name'); + } + suc(settings, members, fieldValues); + }; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_GETROOMINFO_ERROR, + data: ele + }); + }; + this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); + }; - remove: function (index, count) { - count = count === undefined ? 1 : count; - this.array.splice(index, count); - }, + /** + * 获取聊天室管理员 + * @param {Object} options + * @deprecated + */ + connection.prototype.queryRoomOccupants = function (options) { + var suc = options.success || _utils.emptyfn; + var completeFn = function completeFn(result) { + var occupants = []; + occupants = _parseRoomOccupants(result); + suc(occupants); + }; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR, + data: ele + }); + }; + var attrs = { + xmlns: Strophe.NS.DISCO_ITEMS + }; + var info = $iq({ + from: this.context.jid, + to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain, + type: 'get' + }).c('query', attrs); + this.context.stropheConn.sendIQ(info.tree(), completeFn, errorFn); + }; - join: function (separator) { - return this.array.join(separator); - }, + /** + * + * @deprecated + * @private + */ + connection.prototype.setUserSig = function (desc) { + var dom = $pres({ xmlns: 'jabber:client' }); + desc = desc || ''; + dom.c('status').t(desc); + this.sendCommand(dom.tree()); + }; - clear: function () { - this.array.length = 0; + /** + * + * @private + */ + connection.prototype.setPresence = function (type, status) { + var dom = $pres({ xmlns: 'jabber:client' }); + if (type) { + if (status) { + dom.c('show').t(type); + dom.up().c('status').t(status); + } else { + dom.c('show').t(type); } - }; + } + this.sendCommand(dom.tree()); + }; - /** - * 先进先出队列 (First Input First Output) - * - * 一种先进先出的数据缓存器 - */ - var Queue = function () { - this._array_h = new Array_h(); - }; + /** + * @private + * + */ + connection.prototype.getPresence = function () { + var dom = $pres({ xmlns: 'jabber:client' }); + var conn = this; + this.sendCommand(dom.tree()); + }; - Queue.prototype = { - _index: 0, + /** + * @private + * + */ + connection.prototype.ping = function (options) { + var options = options || {}; + var jid = _getJid(options, this); - /** - * 排队 - * - * @param {Object} obj [description] - * @return {[type]} [description] - */ - push: function (obj) { - this._array_h.push(obj); - }, + var dom = $iq({ + from: this.context.jid || '', + to: jid, + type: 'get' + }).c('ping', { xmlns: 'urn:xmpp:ping' }); - /** - * 出队 - * - * @return {Object} [description] - */ - pop: function () { - var ret = null; - if (this._array_h.length()) { - ret = this._array_h.at(this._index); - if (++this._index * 2 >= this._array_h.length()) { - this._array_h.slice(this._index); - this._index = 0; - } - } - return ret; - }, + var suc = options.success || _utils.emptyfn; + var error = options.error || this.onError; + var failFn = function failFn(ele) { + error({ + type: _code.WEBIM_CONNCTION_PING_ERROR, + data: ele + }); + }; + if (this.isOpened()) { + this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); + } else { + error({ + type: _code.WEBIM_CONNCTION_DISCONNECTED + }); + } + return; + }; - /** - * 返回队列中头部(即最新添加的)的动态对象 - * - * @return {Object} [description] - */ - head: function () { - var ret = null, len = this._array_h.length(); - if (len) { - ret = this._array_h.at(len - 1); - } - return ret; - }, + /** + * @private + * + */ + connection.prototype.isOpened = function () { + return this.context.status == _code.STATUS_OPENED; + }; - /** - * 返回队列中尾部(即最早添加的)的动态对象 - * - * @return {Object} [description] - */ - tail: function () { - var ret = null, len = this._array_h.length(); - if (len) { - ret = this._array_h.at(this._index); - } - return ret; - }, + /** + * @private + * + */ + connection.prototype.isOpening = function () { + var status = this.context.status; + return status == _code.STATUS_DOLOGIN_USERGRID || status == _code.STATUS_DOLOGIN_IM; + }; - /** - * 返回数据队列长度 - * - * @return {Number} [description] - */ - length: function () { - return this._array_h.length() - this._index; - }, + /** + * @private + * + */ + connection.prototype.isClosing = function () { + return this.context.status == _code.STATUS_CLOSING; + }; - /** - * 队列是否为空 - * - * @return {Boolean} [description] - */ - empty: function () { - return (this._array_h.length() === 0); - }, + /** + * @private + * + */ + connection.prototype.isClosed = function () { + return this.context.status == _code.STATUS_CLOSED; + }; - clear: function () { - this._array_h.clear(); + /** + * @private + * + */ + connection.prototype.clear = function () { + var key = this.context.appKey; + if (this.errorType != _code.WEBIM_CONNCTION_DISCONNECTED) { + if (this.logOut) { + this.unSendMsgArr = []; + this.offLineSendConnecting = false; + this.context = { + status: _code.STATUS_INIT, + appKey: key + }; } - }; - exports.Queue = Queue; - }()); - + } + if (this.intervalId) { + clearInterval(this.intervalId); + } + this.restIndex = 0; + this.xmppIndex = 0; -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { + if (this.errorType == _code.WEBIM_CONNCTION_CLIENT_LOGOUT || this.errorType == -1) { + var message = { + data: { + data: "logout" + }, + type: _code.WEBIM_CONNCTION_CLIENT_LOGOUT + }; + this.onError(message); + } + }; - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3 - // http://underscorejs.org - // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - // Underscore may be freely distributed under the MIT license. + /** + * 获取聊天室列表 + * @param {Object} options + */ + connection.prototype.getChatRooms = function (options) { - (function() { + var conn = this, + token = options.accessToken || this.context.accessToken; - // Baseline setup - // -------------- + if (!_utils.isCanSetRequestHeader) { + conn.onError({ + type: _code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR + }); + return; + } - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; + if (token) { + var apiUrl = options.apiUrl; + var appName = this.context.appName; + var orgName = this.context.orgName; - // Save the previous value of the `_` variable. - var previousUnderscore = root._; + if (!appName || !orgName) { + conn.onError({ + type: _code.WEBIM_CONNCTION_AUTH_ERROR + }); + return; + } - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + var suc = function suc(data, xhr) { + typeof options.success === 'function' && options.success(data); + }; - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; + var error = function error(res, xhr, msg) { + if (res.error && res.error_description) { + conn.onError({ + type: _code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR, + msg: res.error_description, + data: res, + xhr: xhr + }); + } + }; - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind, - nativeCreate = Object.create; + var pageInfo = { + pagenum: parseInt(options.pagenum) || 1, + pagesize: parseInt(options.pagesize) || 20 + }; - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; + var opts = { + url: apiUrl + '/' + orgName + '/' + appName + '/chatrooms', + dataType: 'json', + type: 'GET', + headers: { 'Authorization': 'Bearer ' + token }, + data: pageInfo, + success: suc || _utils.emptyfn, + error: error || _utils.emptyfn + }; + _utils.ajax(opts); + } else { + conn.onError({ + type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR + }); + } + }; - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; + /** + * 加入聊天室 + * @param {Object} options + */ + connection.prototype.joinChatRoom = function (options) { + var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; + var room_nick = roomJid + '/' + this.context.userId; + var suc = options.success || _utils.emptyfn; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_JOINCHATROOM_ERROR, + data: ele + }); + }; - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (true) { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } + var iq = $pres({ + from: this.context.jid, + to: room_nick + }).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'member', role: 'participant' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' }); - // Current version. - _.VERSION = '1.8.3'; + this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); + }; - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var optimizeCb = function(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - case 2: return function(value, other) { - return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); + /** + * 退出聊天室 + * @param {Object} options + */ + connection.prototype.quitChatRoom = function (options) { + var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; + var room_nick = roomJid + '/' + this.context.userId; + var suc = options.success || _utils.emptyfn; + var err = options.error || _utils.emptyfn; + var errorFn = function errorFn(ele) { + err({ + type: _code.WEBIM_CONNCTION_QUITCHATROOM_ERROR, + data: ele + }); }; - }; + var iq = $pres({ + from: this.context.jid, + to: room_nick, + type: 'unavailable' + }).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'none', role: 'none' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' }); - // A mostly-internal function to generate callbacks that can be applied - // to each element in a collection, returning the desired result — either - // identity, an arbitrary callback, a property matcher, or a property accessor. - var cb = function(value, context, argCount) { - if (value == null) return _.identity; - if (_.isFunction(value)) return optimizeCb(value, context, argCount); - if (_.isObject(value)) return _.matcher(value); - return _.property(value); - }; - _.iteratee = function(value, context) { - return cb(value, context, Infinity); - }; + this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); + }; - // An internal function for creating assigner functions. - var createAssigner = function(keysFunc, undefinedOnly) { - return function(obj) { - var length = arguments.length; - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveInviteFromGroup = function (info) { + info = eval('(' + info + ')'); + var self = this; + var options = { + title: "Group invitation", + msg: info.user + " invites you to join into group:" + info.group_id, + agree: function agree() { + WebIM.doQuery('{"type":"acceptInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) {}, function (code, msg) { + var message = { + data: { + data: "acceptInvitationFromGroup error:" + msg + }, + type: _code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP + }; + self.onError(message); + }); + }, + reject: function reject() { + WebIM.doQuery('{"type":"declineInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) {}, function (code, msg) { + var message = { + data: { + data: "declineInvitationFromGroup error:" + msg + }, + type: _code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP + }; + self.onError(message); + }); } - } - return obj; }; - }; - // An internal function for creating a new object that inherits from another. - var baseCreate = function(prototype) { - if (!_.isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - }; + this.onConfirmPop(options); + }; - var property = function(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveInviteAcceptionFromGroup = function (info) { + info = eval('(' + info + ')'); + var options = { + title: "Group invitation response", + msg: info.user + " agreed to join into group:" + info.group_id, + agree: function agree() {} }; - }; + this.onConfirmPop(options); + }; - // Helper for collection methods to determine whether a collection - // should be iterated as an array or as an object - // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - var getLength = property('length'); - var isArrayLike = function(collection) { - var length = getLength(collection); - return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; - }; + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveInviteDeclineFromGroup = function (info) { + info = eval('(' + info + ')'); + var options = { + title: "Group invitation response", + msg: info.user + " rejected to join into group:" + info.group_id, + agree: function agree() {} + }; + this.onConfirmPop(options); + }; - // Collection Functions - // -------------------- + /** + * for windowSDK + * @private + * + */ + connection.prototype._onAutoAcceptInvitationFromGroup = function (info) { + info = eval('(' + info + ')'); + var options = { + title: "Group invitation", + msg: "You had joined into the group:" + info.group_name + " automatically.Inviter:" + info.user, + agree: function agree() {} + }; + this.onConfirmPop(options); + }; - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - _.each = _.forEach = function(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var keys = _.keys(obj); - for (i = 0, length = keys.length; i < length; i++) { - iteratee(obj[keys[i]], keys[i], obj); - } - } - return obj; - }; + /** + * for windowSDK + * @private + * + */ + connection.prototype._onLeaveGroup = function (info) { + info = eval('(' + info + ')'); + var options = { + title: "Group notification", + msg: "You have been out of the group:" + info.group_id + ".Reason:" + info.msg, + agree: function agree() {} + }; + this.onConfirmPop(options); + }; - // Return the results of applying the iteratee to each element. - _.map = _.collect = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveJoinGroupApplication = function (info) { + info = eval('(' + info + ')'); + var self = this; + var options = { + title: "Group join application", + msg: info.user + " applys to join into group:" + info.group_id, + agree: function agree() { + WebIM.doQuery('{"type":"acceptJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) {}, function (code, msg) { + var message = { + data: { + data: "acceptJoinGroupApplication error:" + msg + }, + type: _code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP + }; + self.onError(message); + }); + }, + reject: function reject() { + WebIM.doQuery('{"type":"declineJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) {}, function (code, msg) { + var message = { + data: { + data: "declineJoinGroupApplication error:" + msg + }, + type: _code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP + }; + self.onError(message); + }); + } + }; + this.onConfirmPop(options); + }; - // Create a reducing function iterating left or right. - function createReduce(dir) { - // Optimized iterator function as using arguments.length - // in the main function will deoptimize the, see #1991. - function iterator(obj, iteratee, memo, keys, index, length) { - for (; index >= 0 && index < length; index += dir) { - var currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - } + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveAcceptionFromGroup = function (info) { + info = eval('(' + info + ')'); + var options = { + title: "Group notification", + msg: "You had joined into the group:" + info.group_name + ".", + agree: function agree() {} + }; + this.onConfirmPop(options); + }; - return function(obj, iteratee, memo, context) { - iteratee = optimizeCb(iteratee, context, 4); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - index = dir > 0 ? 0 : length - 1; - // Determine the initial value if none is provided. - if (arguments.length < 3) { - memo = obj[keys ? keys[index] : index]; - index += dir; - } - return iterator(obj, iteratee, memo, keys, index, length); + /** + * for windowSDK + * @private + * + */ + connection.prototype._onReceiveRejectionFromGroup = function () { + info = eval('(' + info + ')'); + var options = { + title: "Group notification", + msg: "You have been rejected to join into the group:" + info.group_name + ".", + agree: function agree() {} }; - } + this.onConfirmPop(options); + }; - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - _.reduce = _.foldl = _.inject = createReduce(1); + /** + * for windowSDK + * @private + * + */ + connection.prototype._onUpdateMyGroupList = function (options) { + this.onUpdateMyGroupList(options); + }; - // The right-associative version of reduce, also known as `foldr`. - _.reduceRight = _.foldr = createReduce(-1); + /** + * for windowSDK + * @private + * + */ + connection.prototype._onUpdateMyRoster = function (options) { + this.onUpdateMyRoster(options); + }; - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var key; - if (isArrayLike(obj)) { - key = _.findIndex(obj, predicate, context); - } else { - key = _.findKey(obj, predicate, context); - } - if (key !== void 0 && key !== -1) return obj[key]; - }; + /** + * @private + * + */ + connection.prototype.reconnect = function () { + var that = this; + setTimeout(function () { + _login(that.context.restTokenData, that); + }, (this.autoReconnectNumTotal == 0 ? 0 : this.autoReconnectInterval) * 1000); + this.autoReconnectNumTotal++; + }; - // Return all the elements that pass a truth test. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - _.each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - }; + /** + * + * @private + * @deprecated + */ + connection.prototype.closed = function () { + var message = { + data: { + data: "Closed error" + }, + type: _code.WEBIM_CONNECTION_CLOSED + }; + this.onError(message); + }; - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, _.negate(cb(predicate)), context); - }; + /** + * used for blacklist + * @private + * + */ + function _parsePrivacy(iq) { + var list = []; + var items = iq.getElementsByTagName('item'); - // Determine whether all of the elements match a truth test. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var jid = item.getAttribute('value'); + var order = item.getAttribute('order'); + var type = item.getAttribute('type'); + if (!jid) { + continue; + } + var n = _parseNameFromJidFn(jid); + list[n] = { + type: type, + order: order, + jid: jid, + name: n + }; + } } - return true; - }; + return list; + }; - // Determine if at least one element in the object matches a truth test. - // Aliased as `any`. - _.some = _.any = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - }; + /** + * 获取好友黑名单 + * @param {Object} options + * + */ + connection.prototype.getBlacklist = function (options) { + options = options || {}; + var iq = $iq({ type: 'get' }); + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var me = this; - // Determine if the array or object contains a given item (using `===`). - // Aliased as `includes` and `include`. - _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return _.indexOf(obj, item, fromIndex) >= 0; - }; + iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' }); - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - var func = isFunc ? method : value[method]; - return func == null ? func : func.apply(value, args); + this.context.stropheConn.sendIQ(iq.tree(), function (iq) { + me.onBlacklistUpdate(_parsePrivacy(iq)); + sucFn(); + }, function () { + me.onBlacklistUpdate([]); + errFn(); }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; + }; - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matcher(attrs)); - }; + /** + * 加入好友黑名单 + * @param {Object} options + * + */ + connection.prototype.addToBlackList = function (options) { + var iq = $iq({ type: 'set' }); + var blacklist = options.list || {}; + var type = options.type || 'jid'; + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' }); - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matcher(attrs)); - }; + var keys = Object.keys(blacklist); + var len = keys.length; + var order = 2; - // Return the maximum element (or element-based computation). - _.max = function(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; + for (var i = 0; i < len; i++) { + var item = blacklist[keys[i]]; + var type = item.type || 'jid'; + var jid = item.jid; - // Return the minimum element (or element-based computation). - _.min = function(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = value; - lastComputed = computed; + piece = piece.c('item', { action: 'deny', order: order++, type: type, value: jid }).c('message'); + if (i !== len - 1) { + piece = piece.up().up(); } - }); - } - return result; - }; - - // Shuffle a collection, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var set = isArrayLike(obj) ? obj : _.values(obj); - var length = set.length; - var shuffled = Array(length); - for (var index = 0, rand; index < length; index++) { - rand = _.random(0, index); - if (rand !== index) shuffled[index] = shuffled[rand]; - shuffled[rand] = set[index]; - } - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // Sort the object's values by a criterion produced by an iteratee. - _.sortBy = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iteratee(value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iteratee, context) { - var result = {}; - iteratee = cb(iteratee, context); - _.each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, value, key) { - if (_.has(result, key)) result[key].push(value); else result[key] = [value]; - }); + // console.log('addToBlackList', blacklist, piece.tree()); + this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); + }; - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, value, key) { - result[key] = value; - }); + /** + * 从好友黑名单删除 + * @param {Object} options + * + */ + connection.prototype.removeFromBlackList = function (options) { - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, value, key) { - if (_.has(result, key)) result[key]++; else result[key] = 1; - }); + var iq = $iq({ type: 'set' }); + var blacklist = options.list || {}; + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' }); - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return _.map(obj, _.identity); - return _.values(obj); - }; + var keys = Object.keys(blacklist); + var len = keys.length; - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : _.keys(obj).length; - }; + for (var i = 0; i < len; i++) { + var item = blacklist[keys[i]]; + var type = item.type || 'jid'; + var jid = item.jid; + var order = item.order; - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(obj, predicate, context) { - predicate = cb(predicate, context); - var pass = [], fail = []; - _.each(obj, function(value, key, obj) { - (predicate(value, key, obj) ? pass : fail).push(value); - }); - return [pass, fail]; - }; + piece = piece.c('item', { action: 'deny', order: order, type: type, value: jid }).c('message'); + if (i !== len - 1) { + piece = piece.up().up(); + } + } - // Array Functions - // --------------- + // console.log('removeFromBlackList', blacklist, piece.tree()); + this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); + }; - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - return _.initial(array, array.length - n); - }; + /** + * + * @private + */ + connection.prototype._getGroupJid = function (to) { + var appKey = this.context.appKey || ''; + return appKey + '_' + to + '@conference.' + this.domain; + }; - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - _.initial = function(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - }; + /** + * 加入群组黑名单 + * @param {Object} options + * + */ + connection.prototype.addToGroupBlackList = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var jid = _getJid(options, this); + var affiliation = 'admin'; //options.affiliation || 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return _.rest(array, Math.max(0, array.length - n)); - }; + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', { + affiliation: 'outcast', + jid: jid + }); - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; + this.context.stropheConn.sendIQ(iq.tree(), sucFn, errFn); + }; - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; + /** + * + * @private + */ + function _parseGroupBlacklist(iq) { + var list = {}; + var items = iq.getElementsByTagName('item'); - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, strict, startIndex) { - var output = [], idx = 0; - for (var i = startIndex || 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { - //flatten current level of array or arguments object - if (!shallow) value = flatten(value, shallow, strict); - var j = 0, len = value.length; - output.length += len; - while (j < len) { - output[idx++] = value[j++]; + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var jid = item.getAttribute('jid'); + var affiliation = item.getAttribute('affiliation'); + var nick = item.getAttribute('nick'); + if (!jid) { + continue; + } + var n = _parseNameFromJidFn(jid); + list[n] = { + jid: jid, + affiliation: affiliation, + nick: nick, + name: n + }; } - } else if (!strict) { - output[idx++] = value; - } } - return output; - }; + return list; + } - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, false); - }; + /** + * 获取群组黑名单 + * @param {Object} options + */ + connection.prototype.getGroupBlacklist = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; + // var jid = _getJid(options, this); + var affiliation = 'admin'; //options.affiliation || 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'get', to: to }); - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iteratee, context) { - if (!_.isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!_.contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!_.contains(result, value)) { - result.push(value); - } - } - return result; - }; + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', { + affiliation: 'outcast' + }); - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(flatten(arguments, true, true)); - }; + this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { + sucFn(_parseGroupBlacklist(msginfo)); + }, function () { + errFn(); + }); + }; - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (_.contains(result, item)) continue; - for (var j = 1; j < argsLength; j++) { - if (!_.contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - }; + /** + * 从群组黑名单删除 + * @param {Object} options + */ + connection.prototype.removeGroupMemberFromBlacklist = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = flatten(arguments, true, true, 1); - return _.filter(array, function(value){ - return !_.contains(rest, value); + var jid = _getJid(options, this); + var affiliation = 'admin'; //options.affiliation || 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); + + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', { + affiliation: 'none', + jid: jid }); - }; - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - return _.unzip(arguments); - }; + this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { + sucFn(); + }, function () { + errFn(); + }); + }; + + /** + * 修改群名称 + * + * @param {Object} options - + * @example + + + + http://jabber.org/protocol/muc#roomconfig + Room Name + + + + */ + connection.prototype.changeGroupSubject = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + + // must be `owner` + var affiliation = 'owner'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); - // Complement of _.zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices - _.unzip = function(array) { - var length = array && _.max(array, getLength).length || 0; - var result = Array(length); + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('x', { type: 'submit', xmlns: 'jabber:x:data' }).c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up().c('field', { 'var': 'muc#roomconfig_roomname' }).c('value').t(options.subject).up().up().c('field', { 'var': 'muc#roomconfig_roomdesc' }).c('value').t(options.description); - for (var index = 0; index < length; index++) { - result[index] = _.pluck(array, index); - } - return result; - }; + this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { + sucFn(); + }, function () { + errFn(); + }); + }; - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; + /** + * 删除群组 + * + * @param {Object} options - + * @example + + + + xxx destory group yyy + + + + */ + connection.prototype.destroyGroup = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; - // Generator function to create the findIndex and findLastIndex functions - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } + // must be `owner` + var affiliation = 'owner'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); - // Returns the first index on an array-like that passes a predicate test - _.findIndex = createPredicateIndexFinder(1); - _.findLastIndex = createPredicateIndexFinder(-1); + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('destroy').c('reason').t(options.reason || ''); - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - }; + this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { + sucFn(); + }, function () { + errFn(); + }); + }; - // Generator function to create the indexOf and lastIndexOf functions - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), _.isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; - } + /** + * 主动离开群组 + * + * @param {Object} options - + * @example + + + + + + + */ + connection.prototype.leaveGroupBySelf = function (options) { + var self = this; + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); - _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); + // must be `owner` + var jid = _getJid(options, this); + var affiliation = 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - step = step || 1; + iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', { + affiliation: 'none', + jid: jid + }); - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); + this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { + sucFn(msgInfo); + var pres = $pres({ type: 'unavailable', to: to + '/' + self.context.userId }); + self.sendCommand(pres.tree()); + }, function (errInfo) { + errFn(errInfo); + }); + }; - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; + /** + * 被踢出群组 + * + * @param {Object} options - + * @example + + + + + + + + + */ + connection.prototype.leaveGroup = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var list = options.list || []; + var affiliation = 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); + var piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }); + var keys = Object.keys(list); + var len = keys.length; + + for (var i = 0; i < len; i++) { + var name = list[keys[i]]; + var jid = _getJidByName(name, this); + + piece = piece.c('item', { + affiliation: 'none', + jid: jid + }).up().c('item', { + role: 'none', + jid: jid + }).up(); } - return range; - }; + this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { + sucFn(msgInfo); + }, function (errInfo) { + errFn(errInfo); + }); + }; - // Function (ahem) Functions - // ------------------ + /** + * 添加群组成员 + * + * @param {Object} options - + * @example + Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发) + + + + + liuwz invite you to join group '谢谢' + + + + + + + + + + */ + connection.prototype.addGroupMembers = function (options) { + var sucFn = options.success || _utils.emptyfn; + var errFn = options.error || _utils.emptyfn; + var list = options.list || []; + var affiliation = 'admin'; + var to = this._getGroupJid(options.roomId); + var iq = $iq({ type: 'set', to: to }); + var piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }); + var len = list.length; - // Determines whether to execute a function as a constructor - // or a normal function with the provided arguments - var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (_.isObject(result)) return result; - return self; - }; + for (var i = 0; i < len; i++) { - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); - var args = slice.call(arguments, 2); - var bound = function() { - return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); - }; - return bound; - }; + var name = list[i]; + var jid = _getJidByName(name, this); - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }; + piece = piece.c('item', { + affiliation: 'member', + jid: jid + }).up(); - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var i, length = arguments.length, key; - if (length <= 1) throw new Error('bindAll must be passed function names'); - for (i = 1; i < length; i++) { - key = arguments[i]; - obj[key] = _.bind(obj[key], obj); + var dom = $msg({ + to: to + }).c('x', { + xmlns: 'http://jabber.org/protocol/muc#user' + }).c('invite', { + to: jid + }).c('reason').t(options.reason || ''); + + this.sendCommand(dom.tree()); } - return obj; - }; - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; + this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { + sucFn(msgInfo); + }, function (errInfo) { + errFn(errInfo); + }); + }; + + /** + * 接受加入申请 + * + * @param {Object} options - + */ + connection.prototype.acceptInviteFromGroup = function (options) { + options.success = function () { + // then send sendAcceptInviteMessage + // connection.prototype.sendAcceptInviteMessage(optoins); }; - memoize.cache = {}; - return memoize; - }; + this.addGroupMembers(options); + }; - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ - return func.apply(null, args); - }, wait); - }; + /** + * 拒绝入群申请 + * @param {Object} options - + * @example + throw request for now 暂时不处理,直接丢弃 - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = _.partial(_.delay, _, 1); + + + + reject + + + + */ + connection.prototype.rejectInviteFromGroup = function (options) { + // var from = _getJidByName(options.from, this); + // var dom = $msg({ + // from: from, + // to: _getJidByName(options.to, this) + // }).c('x', { + // xmlns: 'http://jabber.org/protocol/muc#user' + // }).c('apply', { + // from: from, + // to: this._getGroupJid(options.groupId), + // toNick: options.groupName + // }).c('reason').t(options.reason || ''); + // + // this.sendCommand(dom.tree()); + }; - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - if (!options) options = {}; - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; + /** + * 创建群组-异步 + * @param {Object} p - + */ + connection.prototype.createGroupAsync = function (p) { + var roomId = p.from; + var me = this; + var toRoom = this._getGroupJid(roomId); + var to = toRoom + '/' + this.context.userId; + var options = this.groupOption; + var suc = p.success || _utils.emptyfn; - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; + // Creating a Reserved Room + var iq = $iq({ type: 'get', to: toRoom }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }); - var later = function() { - var last = _.now() - timestamp; + // Strophe.info('step 1 ----------'); + // Strophe.info(options); + me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { + // console.log(msgInfo); - if (last < wait && last >= 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - if (!timeout) context = args = null; + // for ie hack + if ('setAttribute' in msgInfo) { + // Strophe.info('step 3 ----------'); + var x = msgInfo.getElementsByTagName('x')[0]; + x.setAttribute('type', 'submit'); + } else { + // Strophe.info('step 4 ----------'); + Strophe.forEachChild(msgInfo, 'x', function (field) { + field.setAttribute('type', 'submit'); + }); } - } - }; - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } + Strophe.info('step 5 ----------'); + Strophe.forEachChild(x, 'field', function (field) { + var fieldVar = field.getAttribute('var'); + var valueDom = field.getElementsByTagName('value')[0]; + Strophe.info(fieldVar); + switch (fieldVar) { + case 'muc#roomconfig_maxusers': + _setText(valueDom, options.optionsMaxUsers || 200); + break; + case 'muc#roomconfig_roomname': + _setText(valueDom, options.subject || ''); + break; + case 'muc#roomconfig_roomdesc': + _setText(valueDom, options.description || ''); + break; + case 'muc#roomconfig_publicroom': + // public 1 + _setText(valueDom, +options.optionsPublic); + break; + case 'muc#roomconfig_membersonly': + _setText(valueDom, +options.optionsMembersOnly); + break; + case 'muc#roomconfig_moderatedroom': + _setText(valueDom, +options.optionsModerate); + break; + case 'muc#roomconfig_persistentroom': + _setText(valueDom, 1); + break; + case 'muc#roomconfig_allowinvites': + _setText(valueDom, +options.optionsAllowInvites); + break; + case 'muc#roomconfig_allowvisitornickchange': + _setText(valueDom, 0); + break; + case 'muc#roomconfig_allowvisitorstatus': + _setText(valueDom, 0); + break; + case 'allow_private_messages': + _setText(valueDom, 0); + break; + case 'allow_private_messages_from_visitors': + _setText(valueDom, 'nobody'); + break; + default: + break; + } + }); + + var iq = $iq({ to: toRoom, type: 'set' }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }).cnode(x); + + me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { + me.addGroupMembers({ + list: options.members, + roomId: roomId + }); + + suc(options); + }, function (errInfo) { + // errFn(errInfo); + }); + // sucFn(msgInfo); + }, function (errInfo) { + // errFn(errInfo); + }); + }; - return result; - }; - }; + /** + * 创建群组 + * @param {Object} options - + * @example + * 1. 创建申请 -> 得到房主身份 + * 2. 获取房主信息 -> 得到房间form + * 3. 完善房间form -> 创建成功 + * 4. 添加房间成员 + * 5. 消息通知成员 + */ + connection.prototype.createGroup = function (options) { + this.groupOption = options; + var roomId = +new Date(); + var toRoom = this._getGroupJid(roomId); + var to = toRoom + '/' + this.context.userId; - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; + var pres = $pres({ to: to }).c('x', { xmlns: 'http://jabber.org/protocol/muc' }).up().c('create', { xmlns: 'http://jabber.org/protocol/muc' }).up(); - // Returns a negated version of the passed-in predicate. - _.negate = function(predicate) { - return function() { - return !predicate.apply(this, arguments); + // createGroupACK + this.sendCommand(pres.tree()); + }; + // 通过RestFul API接口创建群组 + connection.prototype.createGroupNew = function (opt) { + opt.data.owner = this.user; + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups', + dataType: 'json', + type: 'POST', + data: JSON.stringify(opt.data), + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } }; - }; + options.success = function (respData) { + opt.success(respData); + this.onCreateGroup(respData); + }.bind(this); + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; + /** + * 通过RestFul API屏蔽群组 + * @param {Object} options - + */ + connection.prototype.blockGroup = function (opt) { + var groupId = opt.groupId; + groupId = 'notification_ignore_' + groupId; + var data = { + entities: [] }; - }; - - // Returns a function that will only be executed on and after the Nth call. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } + data.entities[0] = {}; + data.entities[0][groupId] = true; + var options = { + type: 'PUT', + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user, + data: JSON.stringify(data), + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } }; - }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Returns a function that will only be executed up to (but not including) the Nth call. - _.before = function(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; + /** + * 通过RestFul API发出入群申请 + * @param {Object} opt - + */ + connection.prototype.joinGroup = function (opt) { + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + opt.groupId + '/' + 'apply', + type: 'POST', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = _.partial(_.before, 2); - - // Object Functions - // ---------------- + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + /** + * 通过RestFul API获取群组列表 + * @param {Object} opt - + */ + connection.prototype.listGroups = function (opt) { + var requestData = []; + requestData['limit'] = opt.limit; + requestData['cursor'] = opt.cursor; + if (!requestData['cursor']) delete requestData['cursor']; + if (isNaN(opt.limit)) { + throw 'The parameter \"limit\" should be a number'; + return; + } + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/publicchatgroups', + type: 'GET', + dataType: 'json', + data: requestData, + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - function collectNonEnumProps(obj, keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; + /** + * 通过RestFul API根据groupid获取群组详情 + * @param {Object} opt - + */ + connection.prototype.getGroupInfo = function (opt) { + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups/' + opt.groupId, + type: 'GET', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Constructor is a special case. - var prop = 'constructor'; - if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); + /** + * 通过RestFul API列出某用户所加入的所有群组 + * @param {Object} opt - + */ + connection.prototype.getGroup = function (opt) { + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user + '/' + 'joined_chatgroups', + dataType: 'json', + type: 'GET', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { - keys.push(prop); - } + /** + * 通过RestFul API列出群组的所有成员 + * @param {Object} opt - + */ + connection.prototype.listGroupMember = function (opt) { + if (isNaN(opt.pageNum) || opt.pageNum <= 0) { + throw 'The parameter \"pageNum\" should be a positive number'; + return; + } else if (isNaN(opt.pageSize) || opt.pageSize <= 0) { + throw 'The parameter \"pageSize\" should be a positive number'; + return; + } else if (opt.groupId === null && typeof opt.groupId === 'undefined') { + throw 'The parameter \"groupId\" should be added'; + return; } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve all the property names of an object. - _.allKeys = function(obj) { - if (!_.isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; + var requestData = [], + groupId = opt.groupId; + requestData['pagenum'] = opt.pageNum; + requestData['pagesize'] = opt.pageSize; + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/users', + dataType: 'json', + type: 'GET', + data: requestData, + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; + /** + * 通过RestFul API禁止群用户发言 + * @param {Object} opt - + */ + connection.prototype.mute = function (opt) { + var groupId = opt.groupId, + requestData = { + "usernames": [opt.username], + "mute_duration": opt.muteDuration + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute', + dataType: 'json', + type: 'POST', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + }, + data: JSON.stringify(requestData) + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Returns the results of applying the iteratee to each element of the object - // In contrast to _.map it returns an object - _.mapObject = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = _.keys(obj), - length = keys.length, - results = {}, - currentKey; - for (var index = 0; index < length; index++) { - currentKey = keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; + /** + * 通过RestFul API取消对用户禁言 + * @param {Object} opt - + */ + connection.prototype.removeMute = function (opt) { + var groupId = opt.groupId, + username = opt.username; + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute' + '/' + username, + dataType: 'json', + type: 'DELETE', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; + /** + * 通过RestFul API获取群组下所有管理员 + * @param {Object} opt - + */ + connection.prototype.getGroupAdmin = function (opt) { + var groupId = opt.groupId; + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/admin', + dataType: 'json', + type: 'GET', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; + /** + * 通过RestFul API获取群组下所有被禁言成员 + * @param {Object} opt - + */ + connection.prototype.getMuted = function (opt) { + var groupId = opt.groupId; + var options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/mute', + dataType: 'json', + type: 'GET', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; + /** + * 通过RestFul API设置群管理员 + * @param {Object} opt - + */ + connection.prototype.setAdmin = function (opt) { + var groupId = opt.groupId, + requestData = { + newadmin: opt.username + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin', + type: "POST", + dataType: 'json', + data: JSON.stringify(requestData), + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Extend a given object with all the properties in passed-in object(s). - _.extend = createAssigner(_.allKeys); + /** + * 通过RestFul API取消群管理员 + * @param {Object} opt - + */ + connection.prototype.removeAdmin = function (opt) { + var groupId = opt.groupId, + username = opt.username, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin' + '/' + username, + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Assigns a given object with all the own properties in the passed-in object(s) - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - _.extendOwn = _.assign = createAssigner(_.keys); + /** + * 通过RestFul API同意用户加入群 + * @param {Object} opt - + */ + connection.prototype.agreeJoinGroup = function (opt) { + var groupId = opt.groupId, + requestData = { + "applicant": opt.applicant, + "verifyResult": true, + "reason": "no clue" + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify', + type: 'POST', + dataType: "json", + data: JSON.stringify(requestData), + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Returns the first key on an object that passes a predicate test - _.findKey = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = _.keys(obj), key; - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - }; + /** + * 通过RestFul API拒绝用户加入群 + * @param {Object} opt - + */ + connection.prototype.rejectJoinGroup = function (opt) { + var groupId = opt.groupId, + requestData = { + "applicant": opt.applicant, + "verifyResult": false, + "reason": "no clue" + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify', + type: 'POST', + dataType: "json", + data: JSON.stringify(requestData), + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(object, oiteratee, context) { - var result = {}, obj = object, iteratee, keys; - if (obj == null) return result; - if (_.isFunction(oiteratee)) { - keys = _.allKeys(obj); - iteratee = optimizeCb(oiteratee, context); - } else { - keys = flatten(arguments, false, false, 1); - iteratee = function(value, key, obj) { return key in obj; }; - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }; + /** + * 通过RestFul API添加用户至群组黑名单(单个) + * @param {Object} opt - + */ + connection.prototype.groupBlockSingle = function (opt) { + var groupId = opt.groupId, + username = opt.username, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username, + type: 'POST', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; + + /** + * 通过RestFul API添加用户至群组黑名单(批量) + * @param {Object} opt - + */ + connection.prototype.groupBlockMulti = function (opt) { + var groupId = opt.groupId, + usernames = opt.usernames, + requestData = { + usernames: usernames + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users', + data: JSON.stringify(requestData), + type: 'POST', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj, iteratee, context) { - if (_.isFunction(iteratee)) { - iteratee = _.negate(iteratee); - } else { - var keys = _.map(flatten(arguments, false, false, 1), String); - iteratee = function(value, key) { - return !_.contains(keys, key); - }; - } - return _.pick(obj, iteratee, context); - }; + /** + * 通过RestFul API将用户从群黑名单移除(单个) + * @param {Object} opt - + */ + connection.prototype.removeGroupBlockSingle = function (opt) { + var groupId = opt.groupId, + username = opt.username, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username, + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Fill in a given object with default properties. - _.defaults = createAssigner(_.allKeys, true); + /** + * 通过RestFul API将用户从群黑名单移除(批量) + * @param {Object} opt - + */ + connection.prototype.removeGroupBlockMulti = function (opt) { + var groupId = opt.groupId, + username = opt.username.join(','), + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username, + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - _.create = function(prototype, props) { - var result = baseCreate(prototype); - if (props) _.extendOwn(result, props); - return result; - }; + /** + * 通过RestFul API解散群组 + * @param {Object} opt - + */ + connection.prototype.dissolveGroup = function (opt) { + var groupId = opt.groupId, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '?version=v3', + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; + /** + * 通过RestFul API获取群组黑名单 + * @param {Object} opt - + */ + connection.prototype.getGroupBlacklistNew = function (opt) { + var groupId = opt.groupId, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users', + type: 'GET', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; + /** + * 通过RestFul API离开群组 + * @param {Object} opt - + */ + connection.prototype.quitGroup = function (opt) { + var groupId = opt.groupId, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'quit', + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Returns whether an object has a given set of `key:value` pairs. - _.isMatch = function(object, attrs) { - var keys = _.keys(attrs), length = keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - }; + /** + * 通过RestFul API修改群信息 + * @param {Object} opt - + */ + connection.prototype.modifyGroup = function (opt) { + var groupId = opt.groupId, + requestData = { + groupname: opt.groupName, + description: opt.description + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId, + type: 'PUT', + data: JSON.stringify(requestData), + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; + /** + * 通过RestFul API删除单个群成员 + * @param {Object} opt - + */ + connection.prototype.removeSingleGroupMember = function (opt) { + var groupId = opt.groupId, + username = opt.username, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + username, + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - switch (className) { - // Strings, numbers, regular expressions, dates, and booleans are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - } + /** + * 通过RestFul API删除多个群成员 + * @param {Object} opt - + */ + connection.prototype.removeMultiGroupMember = function (opt) { + var groupId = opt.groupId, + users = opt.users.join(','), + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + users, + type: 'DELETE', + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; + /** + * 通过RestFul API邀请群成员 + * @param {Object} opt - + */ + connection.prototype.inviteToGroup = function (opt) { + var groupId = opt.groupId, + users = opt.users, + requestData = { + usernames: users + }, + options = { + url: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'invite', + type: 'POST', + data: JSON.stringify(requestData), + dataType: 'json', + headers: { + 'Authorization': 'Bearer ' + this.token, + 'Content-Type': 'application/json' + } + }; + options.success = opt.success || _utils.emptyfn; + options.error = opt.error || _utils.emptyfn; + WebIM.utils.ajax(options); + }; - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && - _.isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } + function _setText(valueDom, v) { + if ('textContent' in valueDom) { + valueDom.textContent = v; + } else if ('text' in valueDom) { + valueDom.text = v; + } else { + // Strophe.info('_setText 4 ----------'); + // valueDom.innerHTML = v; } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + } - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; + var WebIM = window.WebIM || {}; + WebIM.connection = connection; + WebIM.utils = _utils; + WebIM.statusCode = _code; + WebIM.message = _msg.message; + WebIM.doQuery = function (str, suc, fail) { + if (typeof window.cefQuery === 'undefined') { + return; } + window.cefQuery({ + request: str, + persistent: false, + onSuccess: suc, + onFailure: fail + }); + }; - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); + /**************************** debug ****************************/ + function logMessage(message) { + WebIM && WebIM.config.isDebug && console.log(WebIM.utils.ts() + '[recv] ', message.data); + } - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var keys = _.keys(a), key; - length = keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (_.keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = keys[length]; - if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - }; + if (WebIM && WebIM.config.isDebug) { + Strophe.Connection.prototype.rawOutput = function (data) { + console.log('%c ' + WebIM.utils.ts() + '[send] ' + data, "background-color: #e2f7da"); + }; + } - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b); - }; + if (WebIM && WebIM.config && WebIM.config.isSandBox) { + WebIM.config.xmppURL = WebIM.config.xmppURL.replace('.easemob.', '-sandbox.easemob.'); + WebIM.config.apiURL = WebIM.config.apiURL.replace('.easemob.', '-sdb.easemob.'); + } - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; - return _.keys(obj).length === 0; - }; + module.exports = WebIM; - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; + if (false) { + module.hot.accept(); + } - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) === '[object Array]'; - }; +/***/ }, - // Is a given variable an object? - _.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; +/***/ 249: +/***/ function(module, exports, __webpack_require__) { - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; + 'use strict'; + + var CryptoJS = __webpack_require__(211); + ;(function () { + 'use strict'; + + var _utils = __webpack_require__(206).utils; + var Message = function Message(type, id) { + if (!this instanceof Message) { + return new Message(type); + } + + this._msg = {}; + + if (typeof Message[type] === 'function') { + Message[type].prototype.setGroup = this.setGroup; + this._msg = new Message[type](id); + } + return this._msg; + }; + Message.prototype.setGroup = function (group) { + this.body.group = group; }; - }); - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return _.has(obj, 'callee'); + /* + * Read Message + */ + Message.read = function (id) { + this.id = id; + this.type = 'read'; }; - } - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), and in Safari 8 (#1929). - if (typeof /./ != 'function' && typeof Int8Array != 'object') { - _.isFunction = function(obj) { - return typeof obj == 'function' || false; + Message.read.prototype.set = function (opt) { + this.body = { + ackId: opt.id, + to: opt.to + }; }; - } - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; + /* + * deliver message + */ + Message.delivery = function (id) { + this.id = id; + this.type = 'delivery'; + }; - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj !== +obj; - }; + Message.delivery.prototype.set = function (opt) { + this.body = { + bodyId: opt.id, + to: opt.to + }; + }; - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - }; + /* + * text message + */ + Message.txt = function (id) { + this.id = id; + this.type = 'txt'; + this.body = {}; + }; + Message.txt.prototype.set = function (opt) { + this.value = opt.msg; + this.body = { + id: this.id, + to: opt.to, + msg: this.value, + type: this.type, + roomType: opt.roomType, + ext: opt.ext || {}, + success: opt.success, + fail: opt.fail + }; - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; + !opt.roomType && delete this.body.roomType; + }; - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; + /* + * cmd message + */ + Message.cmd = function (id) { + this.id = id; + this.type = 'cmd'; + this.body = {}; + }; + Message.cmd.prototype.set = function (opt) { + this.value = ''; - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - }; + this.body = { + to: opt.to, + action: opt.action, + msg: this.value, + type: this.type, + roomType: opt.roomType, + ext: opt.ext || {}, + success: opt.success + }; + !opt.roomType && delete this.body.roomType; + }; + + /* + * loc message + */ + Message.location = function (id) { + this.id = id; + this.type = 'loc'; + this.body = {}; + }; + Message.location.prototype.set = function (opt) { + this.body = { + to: opt.to, + type: this.type, + roomType: opt.roomType, + addr: opt.addr, + lat: opt.lat, + lng: opt.lng, + ext: opt.ext || {} + }; + }; - // Utility Functions - // ----------------- + /* + * img message + */ + Message.img = function (id) { + this.id = id; + this.type = 'img'; + this.body = {}; + }; + Message.img.prototype.set = function (opt) { + opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; + this.value = opt.file; - // Keep the identity function around for default iteratees. - _.identity = function(value) { - return value; - }; + this.body = { + id: this.id, + file: this.value, + apiUrl: opt.apiUrl, + to: opt.to, + type: this.type, + ext: opt.ext || {}, + roomType: opt.roomType, + onFileUploadError: opt.onFileUploadError, + onFileUploadComplete: opt.onFileUploadComplete, + success: opt.success, + fail: opt.fail, + flashUpload: opt.flashUpload, + width: opt.width, + height: opt.height, + body: opt.body, + uploadError: opt.uploadError, + uploadComplete: opt.uploadComplete + }; - // Predicate-generating functions. Often useful outside of Underscore. - _.constant = function(value) { - return function() { - return value; + !opt.roomType && delete this.body.roomType; }; - }; - _.noop = function(){}; + /* + * audio message + */ + Message.audio = function (id) { + this.id = id; + this.type = 'audio'; + this.body = {}; + }; + Message.audio.prototype.set = function (opt) { + opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - _.property = property; + this.value = opt.file; + this.filename = opt.filename || this.value.filename; - // Generates a function for a given object that returns a given property. - _.propertyOf = function(obj) { - return obj == null ? function(){} : function(key) { - return obj[key]; + this.body = { + id: this.id, + file: this.value, + filename: this.filename, + apiUrl: opt.apiUrl, + to: opt.to, + type: this.type, + ext: opt.ext || {}, + length: opt.length || 0, + roomType: opt.roomType, + file_length: opt.file_length, + onFileUploadError: opt.onFileUploadError, + onFileUploadComplete: opt.onFileUploadComplete, + success: opt.success, + fail: opt.fail, + flashUpload: opt.flashUpload, + body: opt.body + }; + !opt.roomType && delete this.body.roomType; }; - }; - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - _.matcher = _.matches = function(attrs) { - attrs = _.extendOwn({}, attrs); - return function(obj) { - return _.isMatch(obj, attrs); + /* + * file message + */ + Message.file = function (id) { + this.id = id; + this.type = 'file'; + this.body = {}; }; - }; + Message.file.prototype.set = function (opt) { + opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - // Run a function **n** times. - _.times = function(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - }; + this.value = opt.file; + this.filename = opt.filename || this.value.filename; - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; + this.body = { + id: this.id, + file: this.value, + filename: this.filename, + apiUrl: opt.apiUrl, + to: opt.to, + type: this.type, + ext: opt.ext || {}, + roomType: opt.roomType, + onFileUploadError: opt.onFileUploadError, + onFileUploadComplete: opt.onFileUploadComplete, + success: opt.success, + fail: opt.fail, + flashUpload: opt.flashUpload, + body: opt.body + }; + !opt.roomType && delete this.body.roomType; + }; - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { - return new Date().getTime(); - }; + /* + * video message + */ + Message.video = function (id) {}; + Message.video.prototype.set = function (opt) {}; - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = _.invert(escapeMap); + var _Message = function _Message(message) { - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped - var source = '(?:' + _.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + if (!this instanceof _Message) { + return new _Message(message, conn); + } + + this.msg = message; }; - }; - _.escape = createEscaper(escapeMap); - _.unescape = createEscaper(unescapeMap); - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property, fallback) { - var value = object == null ? void 0 : object[property]; - if (value === void 0) { - value = fallback; - } - return _.isFunction(value) ? value.call(object) : value; - }; + _Message.prototype.send = function (conn) { + var me = this; - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; + var _send = function _send(message) { - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; + message.ext = message.ext || {}; + message.ext.weichat = message.ext.weichat || {}; + message.ext.weichat.originType = message.ext.weichat.originType || 'webim'; - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; + var dom; + var json = { + from: conn.context.userId || '', + to: message.to, + bodies: [message.body], + ext: message.ext || {} + }; + var jsonstr = _utils.stringify(json); + dom = $msg({ + type: message.group || 'chat', + to: message.toJid, + id: message.id, + xmlns: 'jabber:client' + }).c('body').t(jsonstr); - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; + if (message.roomType) { + dom.up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' }); + } + if (message.bodyId) { + dom = $msg({ + from: conn.context.jid || '', + to: message.toJid, + id: message.id, + xmlns: 'jabber:client' + }).c('body').t(message.bodyId); + var delivery = { + xmlns: 'urn:xmpp:receipts', + id: message.bodyId + }; + dom.up().c('delivery', delivery); + } + if (message.ackId) { - var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + if (conn.context.jid.indexOf(message.toJid) >= 0) { + return; + } + dom = $msg({ + from: conn.context.jid || '', + to: message.toJid, + id: message.id, + xmlns: 'jabber:client' + }).c('body').t(message.ackId); + var read = { + xmlns: 'urn:xmpp:receipts', + id: message.ackId + }; + dom.up().c('acked', read); + } - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; + setTimeout(function () { + if (typeof _msgHash !== 'undefined' && _msgHash[message.id]) { + _msgHash[message.id].msg.fail instanceof Function && _msgHash[message.id].msg.fail(message.id); + } + }, 60000); + conn.sendCommand(dom.tree(), message.id); + }; + + if (me.msg.file) { + if (me.msg.body && me.msg.body.url) { + // Only send msg + _send(me.msg); + return; + } + var _tmpComplete = me.msg.onFileUploadComplete; + var _complete = function _complete(data) { + if (data.entities[0]['file-metadata']) { + var file_len = data.entities[0]['file-metadata']['content-length']; + // me.msg.file_length = file_len; + me.msg.filetype = data.entities[0]['file-metadata']['content-type']; + if (file_len > 204800) { + me.msg.thumbnail = true; + } + } - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - _.template = function(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = _.defaults({}, settings, _.templateSettings); + me.msg.body = { + type: me.msg.type || 'file', + + url: (location.protocol != 'https:' && conn.isHttpDNS ? conn.apiUrl + data.uri.substr(data.uri.indexOf("/", 9)) : data.uri) + '/' + data.entities[0]['uuid'], + secret: data.entities[0]['share-secret'], + filename: me.msg.file.filename || me.msg.filename, + size: { + width: me.msg.width || 0, + height: me.msg.height || 0 + }, + length: me.msg.length || 0, + file_length: me.msg.ext.file_length || 0, + filetype: me.msg.filetype + }; + _send(me.msg); + _tmpComplete instanceof Function && _tmpComplete(data, me.msg.id); + }; - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); + me.msg.onFileUploadComplete = _complete; + _utils.uploadFile.call(conn, me.msg); + } else { + me.msg.body = { + type: me.msg.type === 'chat' ? 'txt' : me.msg.type, + msg: me.msg.msg + }; + if (me.msg.type === 'cmd') { + me.msg.body.action = me.msg.action; + } else if (me.msg.type === 'loc') { + me.msg.body.addr = me.msg.addr; + me.msg.body.lat = me.msg.lat; + me.msg.body.lng = me.msg.lng; + } - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, escapeChar); - index = offset + match.length; + _send(me.msg); + } + }; - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } + exports._msg = _Message; + exports.message = Message; + })(); - // Adobe VMs need the match returned to produce the correct offest. - return match; - }); - source += "';\n"; +/***/ }, - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; +/***/ 250: +/***/ function(module, exports) { - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; + "use strict"; - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; + ;(function () { + function Array_h(length) { + this.array = length === undefined ? [] : new Array(length); } - var template = function(data) { - return render.call(this, data, _); - }; + Array_h.prototype = { + /** + * 返回数组长度 + * + * @return {Number} length [数组长度] + */ + length: function length() { + return this.array.length; + }, - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; + at: function at(index) { + return this.array[index]; + }, - return template; - }; + set: function set(index, obj) { + this.array[index] = obj; + }, - // Add a "chain" function. Start chaining a wrapped Underscore object. - _.chain = function(obj) { - var instance = _(obj); - instance._chain = true; - return instance; - }; + /** + * 向数组的末尾添加一个或多个元素,并返回新的长度。 + * + * @param {*} obj [description] + * @return {Number} length [新数组的长度] + */ + push: function push(obj) { + return this.array.push(obj); + }, - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. + /** + * 返回数组中选定的元素 + * + * @param {Number} start [开始索引值] + * @param {Number} end [结束索引值] + * @return {Array} newArray [新的数组] + */ + slice: function slice(start, end) { + return this.array = this.array.slice(start, end); + }, - // Helper function to continue chaining intermediate results. - var result = function(instance, obj) { - return instance._chain ? _(obj).chain() : obj; - }; + concat: function concat(array) { + this.array = this.array.concat(array); + }, - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - _.each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result(this, func.apply(_, args)); - }; - }); - }; + remove: function remove(index, count) { + count = count === undefined ? 1 : count; + this.array.splice(index, count); + }, - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); + join: function join(separator) { + return this.array.join(separator); + }, - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; - return result(this, obj); + clear: function clear() { + this.array.length = 0; + } }; - }); - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result(this, method.apply(this._wrapped, arguments)); + /** + * 先进先出队列 (First Input First Output) + * + * 一种先进先出的数据缓存器 + */ + var Queue = function Queue() { + this._array_h = new Array_h(); }; - }); - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; + Queue.prototype = { + _index: 0, - // Provide unwrapping proxy for some methods used in engine operations - // such as arithmetic and JSON stringification. - _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; + /** + * 排队 + * + * @param {Object} obj [description] + * @return {[type]} [description] + */ + push: function push(obj) { + this._array_h.push(obj); + }, - _.prototype.toString = function() { - return '' + this._wrapped; - }; + /** + * 出队 + * + * @return {Object} [description] + */ + pop: function pop() { + var ret = null; + if (this._array_h.length()) { + ret = this._array_h.at(this._index); + if (++this._index * 2 >= this._array_h.length()) { + this._array_h.slice(this._index); + this._index = 0; + } + } + return ret; + }, - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { - return _; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - }.call(this)); + /** + * 返回队列中头部(即最新添加的)的动态对象 + * + * @return {Object} [description] + */ + head: function head() { + var ret = null, + len = this._array_h.length(); + if (len) { + ret = this._array_h.at(len - 1); + } + return ret; + }, + + /** + * 返回队列中尾部(即最早添加的)的动态对象 + * + * @return {Object} [description] + */ + tail: function tail() { + var ret = null, + len = this._array_h.length(); + if (len) { + ret = this._array_h.at(this._index); + } + return ret; + }, + + /** + * 返回数据队列长度 + * + * @return {Number} [description] + */ + length: function length() { + return this._array_h.length() - this._index; + }, + + /** + * 队列是否为空 + * + * @return {Boolean} [description] + */ + empty: function empty() { + return this._array_h.length() === 0; + }, + + clear: function clear() { + this._array_h.clear(); + } + }; + exports.Queue = Queue; + })(); +/***/ } -/***/ }) -/******/ ]) -}); -; \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/sdk/dist/websdk-1.4.11.min.js b/sdk/dist/websdk-1.4.12.min.js similarity index 99% rename from sdk/dist/websdk-1.4.11.min.js rename to sdk/dist/websdk-1.4.12.min.js index e917c9b4..f788ae02 100644 --- a/sdk/dist/websdk-1.4.11.min.js +++ b/sdk/dist/websdk-1.4.12.min.js @@ -1,6 +1,6 @@ -"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?exports.WebIM=t():e.WebIM=t()}(void 0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(module,exports,__webpack_require__){function _parsePrivacy(e){var t=[],n=e.getElementsByTagName("item");if(n)for(var r=0;r")>0){var n=t.indexOf(""),r=t.indexOf(""),t=t.substring(n+5,r);stropheConn.setJid(t)}WebIM&&WebIM.config.isDebug&&console.log(WebIM.utils.ts()+"[recv] ",e.data)}var _version="1.4.2",_code=__webpack_require__(2).code,_utils=__webpack_require__(3).utils,_msg=__webpack_require__(4),_message=_msg._msg,_msgHash={},Queue=__webpack_require__(39).Queue,CryptoJS=__webpack_require__(5),_=__webpack_require__(40),stropheConn=null;window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,window.XDomainRequest,Strophe.Request.prototype._newXHR=function(){var e=_utils.xmlrequest(!0);return e.overrideMimeType&&e.overrideMimeType("text/xml"),e.onreadystatechange=this.func.bind(null,this),e},Strophe.Websocket.prototype._closeSocket=function(){if(this.socket){var e=this;setTimeout(function(){try{e.socket.close()}catch(e){}},0)}else this.socket=null},Strophe.Websocket.prototype._onMessage=function(e){logMessage(e);var t,n;if(0===e.data.indexOf(" from server"))}if(0===e.data.search("0){var childNode=msgBody.childNodes[0];if(childNode.nodeType==Strophe.ElementType.TEXT){var jsondata=childNode.wholeText||childNode.nodeValue;jsondata=jsondata.replace("\n","
");try{var data=eval("("+jsondata+")");parseMsgData.errorMsg=!1,parseMsgData.data=[data]}catch(e){}}}}var delayTags=msginfo.getElementsByTagName("delay");if(delayTags&&delayTags.length>0){var delayTag=delayTags[0],delayMsgTime=delayTag.getAttribute("stamp");delayMsgTime&&(parseMsgData.delayTimeStamp=delayMsgTime)}}else{var childrens=msginfo.childNodes;if(childrens&&childrens.length>0){var child=msginfo.childNodes[0];if(child.nodeType==Strophe.ElementType.TEXT)try{var data=eval("("+child.nodeValue+")");parseMsgData.errorMsg=!1,parseMsgData.data=[data]}catch(e){}}}return parseMsgData},_parseNameFromJidFn=function(e,t){t=t||"";var n=e,r=n.indexOf("_");-1!==r&&(n=n.substring(r+1));var o=n.indexOf("@"+t);return-1!==o&&(n=n.substring(0,o)),n},_parseFriend=function(e,t,n){var r=[],o=e.getElementsByTagName("item");if(o)for(var i=0;i0&&"urn:xmpp:receipts"===t[0].namespaceURI)s="received";else if(n&&n.length>0)s="invite";else if(r&&r.length>0)s="delivery";else if(o&&o.length)s="acked";else if(i&&i.length){var a=i[0],c=a.getElementsByTagName("user-muted");c&&c.length&&(s="userMuted")}return s},_handleMessageQueue=function(e){for(var t in _msgHash)_msgHash.hasOwnProperty(t)&&_msgHash[t].send(e)},_loginCallback=function(e,t,n){var r,o;if("conflict"===t&&(r=!0),e==Strophe.Status.CONNFAIL)o={type:_code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,msg:t,reconnect:!0},r&&(o.conflict=!0),n.onError(o);else if(e==Strophe.Status.ATTACHED||e==Strophe.Status.CONNECTED){n.autoReconnectNumTotal=0,n.intervalId=setInterval(function(){n.handelSendQueue()},200);var i=function(e){var t=e.getElementsByTagName("delivery"),r=e.getElementsByTagName("acked");if(t.length)return n.handleDeliveredMessage(e),!0;if(r.length)return n.handleAckedMessage(e),!0;switch(_parseMessageType(e)){case"received":return n.handleReceivedMessage(e),!0;case"invite":return n.handleInviteMessage(e),!0;case"delivery":return n.handleDeliveredMessage(e),!0;case"acked":return n.handleAckedMessage(e),!0;case"userMuted":return n.handleMutedMessage(e),!0;default:return n.handleMessage(e),!0}},s=function(e){return n.handlePresence(e),!0},a=function(e){return n.handlePing(e),!0},c=function(e){return n.handleIqRoster(e),!0},u=function(e){return n.handleIqPrivacy(e),!0},p=function(e){return n.handleIq(e),!0};n.addHandler(i,null,"message",null,null,null),n.addHandler(s,null,"presence",null,null,null),n.addHandler(a,"urn:xmpp:ping","iq","get",null,null),n.addHandler(c,"jabber:iq:roster","iq","set",null,null),n.addHandler(u,"jabber:iq:privacy","iq","set",null,null),n.addHandler(p,null,"iq",null,null,null),n.registerConfrIQHandler&&n.registerConfrIQHandler(),n.context.status=_code.STATUS_OPENED;var l=[_code.WEBIM_MESSAGE_REC_TEXT,_code.WEBIM_MESSAGE_REC_EMOJI];_utils.isCanDownLoadFile&&(l.push(_code.WEBIM_MESSAGE_REC_PHOTO),l.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE));var d=[_code.WEBIM_MESSAGE_SED_TEXT];_utils.isCanUploadFile&&(d.push(_code.WEBIM_MESSAGE_REC_PHOTO),d.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE)),n.notifyVersion(),n.retry&&_handleMessageQueue(n),n.heartBeat(),n.isAutoLogin&&n.setPresence();try{if(n.unSendMsgArr.length>0)for(var f in n.unSendMsgArr){var h=n.unSendMsgArr[f];n.sendCommand(h),delete n.unSendMsgArr[f]}}catch(e){console.error(e.message)}n.offLineSendConnecting=!1,n.logOut=!1,n.onOpened({canReceive:l,canSend:d,accessToken:n.context.accessToken})}else if(e==Strophe.Status.DISCONNECTING)n.isOpened()&&(n.stopHeartBeat(),n.context.status=_code.STATUS_CLOSING,o={type:_code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,msg:t,reconnect:!0},r&&(o.conflict=!0),n.onError(o));else if(e==Strophe.Status.DISCONNECTED){if(n.isOpened()){if(n.autoReconnectNumTotalthis.restTotal)return void console.log("rest hosts all tried,quit");var n="",r=this.restHosts[this.restIndex],o=_utils.getXmlFirstChild(r,"domain"),i=_utils.getXmlFirstChild(r,"ip");if(i){var s=_utils.getXmlFirstChild(r,"port");n=("https:"===location.protocol?"https:":"http:")+"//"+i.textContent+":"+s.textContent}else n=("https:"===location.protocol?"https:":"http:")+"//"+o.textContent;""!=n&&(this.apiUrl=n,e.apiUrl=n),"login"==t?this.login(e):this.signup(e)},connection.prototype.getHttpDNS=function(e,t){if(this.restHosts)return void this.getRestFromHttpDNS(e,t);var n=this,r=function(r,o){r=(new DOMParser).parseFromString(r,"text/xml").documentElement;var i=n.getHostsByTag(r,"rest");if(!i)return void console.log("rest hosts error3");n.restHosts=i,n.restTotal=i.length;var s=n.getHostsByTag(r,"xmpp");if(!s)return void console.log("xmpp hosts error3");n.xmppHosts=s,n.xmppTotal=s.length,n.getRestFromHttpDNS(e,t)},o=function(r,o,i){console.log("getHttpDNS error",r,i),++n.dnsIndex0){var f=d[0];l.show=Strophe.getText(f)}var h=e.getElementsByTagName("status");if(h&&h.length>0){var m=h[0];l.status=Strophe.getText(m),l.code=m.getAttribute("code")}var y=e.getElementsByTagName("priority");if(y&&y.length>0){var _=y[0];l.priority=Strophe.getText(_)}var g=e.getElementsByTagName("error");if(g&&g.length>0){var g=g[0];l.error={code:g.getAttribute("code")}}var v=e.getElementsByTagName("destroy");if(v&&v.length>0){var v=v[0];l.destroy=!0;var E=v.getElementsByTagName("reason");E&&E.length>0&&(l.reason=Strophe.getText(E[0]))}var N=e.getElementsByTagName("item");if(N&&N.length>0){var O=N[0],I=O.getAttribute("role"),b=O.getAttribute("jid"),x=O.getAttribute("affiliation");if("none"==I&&b){var T=_parseNameFromJidFn(b),C=O.getElementsByTagName("actor")[0],R=C.getAttribute("nick");l.actor=R,l.kicked=T}"moderator"==I&&"201"==l.code&&"owner"===x&&(l.type="createGroupACK",a=!0)}var S=e.getElementsByTagName("x");if(S&&S.length>0){var M=S[0].getElementsByTagName("apply"),B=S[0].getElementsByTagName("accept"),A=S[0].getElementsByTagName("item"),w=S[0].getElementsByTagName("decline"),k=S[0].getElementsByTagName("add_admin"),j=S[0].getElementsByTagName("remove_admin"),F=S[0].getElementsByTagName("add_mute"),D=S[0].getElementsByTagName("remove_mute");if(M&&M.length>0){p=!0,l.toNick=M[0].getAttribute("toNick"),l.type="joinGroupNotifications";var U=M[0].getAttribute("to"),W=U.split("@")[0].split("_");W=W[W.length-1],l.gid=W}else if(B&&B.length>0)l.type="joinPublicGroupSuccess";else if(A&&A.length>0){var x=A[0].getAttribute("affiliation"),I=A[0].getAttribute("role");if("member"==x||"participant"==I){c=!0,l.mid=l.fromJid.split("/"),l.mid=l.mid[l.mid.length-1],l.type="memberJoinPublicGroupSuccess";var L=e.getElementsByTagName("roomtype");if(L&&L.length>0){var r=L[0].getAttribute("type");"chatroom"==r&&(l.type="memberJoinChatRoomSuccess")}}}else if(w&&w.length){u=!0;var W=w[0].getAttribute("fromNick"),G=_parseNameFromJidFn(w[0].getAttribute("from"));l.type="joinPublicGroupDeclined",l.owner=G,l.gid=W}else if(k&&k.length>0){var W=_parseNameFromJidFn(k[0].getAttribute("mucjid")),G=_parseNameFromJidFn(k[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="addAdmin"}else if(j&&j.length>0){var W=_parseNameFromJidFn(j[0].getAttribute("mucjid")),G=_parseNameFromJidFn(j[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="removeAdmin"}else if(F&&F.length>0){var W=_parseNameFromJidFn(F[0].getAttribute("mucjid")),G=_parseNameFromJidFn(F[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="addMute"}else if(D&&D.length>0){var W=_parseNameFromJidFn(D[0].getAttribute("mucjid")),G=_parseNameFromJidFn(D[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="removeMute"}}if(l.chatroom){l.presence_type=o,l.original_type=l.type;t.slice(t.lastIndexOf("/")+1)===this.context.userId&&(""!==l.type||l.code?"unavailable"!==o&&"unavailable"!==l.type||(l.status?110==l.code?l.type="leaveChatRoom":l.error&&406==l.error.code&&(l.type="reachChatRoomCapacity"):l.type="leaveChatRoom"):l.type="joinChatRoomSuccess")}else if(l.presence_type=o,l.original_type=r,/subscribe/.test(l.type));else if(""!=r||l.status||l.error||a||p||c||u){if("unavailable"===o||"unavailable"===r)if(l.destroy)l.type="deleteGroupChat";else if(307==l.code||321==l.code){var H=e.getAttribute("nick");l.type=H?"removedFromGroup":"leaveGroup"}}else console.log(2222222,e,l,p);this.onPresence(l,e)}},connection.prototype.handlePing=function(e){if(!this.isClosed()){var t=e.getAttribute("id"),n=e.getAttribute("from"),r=e.getAttribute("to"),o=$iq({from:r,to:n,id:t,type:"result"});this.sendCommand(o.tree())}},connection.prototype.handleIq=function(e){return!0},connection.prototype.handleIqPrivacy=function(e){0!=e.getElementsByTagName("list").length&&this.getBlacklist()},connection.prototype.handleIqRoster=function(e){var t=e.getAttribute("id"),n=e.getAttribute("from")||"",r=(_parseNameFromJidFn(n),this.context.jid),o=(this.context.userId,$iq({type:"result",id:t,from:r}));this.sendCommand(o.tree());var i=e.getElementsByTagName("query");if(i&&i.length>0){var s=i[0],a=_parseFriend(s,this,n);this.onRoster(a)}return!0},connection.prototype.handleMessage=function(e){var t=this;if(!this.isClosed()){var n=e.getAttribute("id")||"";this.cacheReceiptsMessage({id:n});var r=_parseResponseMessage(e);if(r.errorMsg)return void this.handlePresence(e);var o=e.getElementsByTagName("error"),i="",s="",a=!1;if(o.length>0){a=!0,i=o[0].getAttribute("code");var c=o[0].getElementsByTagName("text");s=c[0].textContent||c[0].text}var u=r.data;for(var p in u)if(u.hasOwnProperty(p)){var l=u[p];if(l.from&&l.to){var d=(l.from+"").toLowerCase(),f=(l.to+"").toLowerCase(),h=l.ext||{},m="",y=e.getElementsByTagName("roomtype");m=y.length?y[0].getAttribute("type")||"chat":e.getAttribute("type")||"chat";var _=l.bodies;if(_&&0!=_.length){var g=l.bodies[0],v=g.type;try{switch(v){case"txt":var E=g.msg;if("base64"===t.encrypt.type)E=atob(E);else if("aes"===t.encrypt.type){var N=CryptoJS.enc.Utf8.parse(t.encrypt.key),O=CryptoJS.enc.Utf8.parse(t.encrypt.iv),I=t.encrypt.mode.toLowerCase(),b={};"cbc"===I?b={iv:O,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}:"ebc"===I&&(b={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7});var x=E,T=CryptoJS.AES.decrypt(x,N,b),C=T.toString(CryptoJS.enc.Utf8);E=C}var R=_utils.parseTextMessage(E,WebIM.Emoji);if(R.isemoji){var l={id:n,type:m,from:d,to:f,delay:r.delayTimeStamp,data:R.body,ext:h};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onEmojiMessage(l)}else{var l={id:n,type:m,from:d,to:f,delay:r.delayTimeStamp,data:E,ext:h};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onTextMessage(l)}break;case"img":var S=0,M=0;g.size&&(S=g.size.width,M=g.size.height);var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,thumb:g.thumb,thumb_secret:g.thumb_secret,file_length:g.file_length||"",width:S,height:M,filetype:g.filetype||"",accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onPictureMessage(l);break;case"audio":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,length:g.length||"",file_length:g.file_length||"",filetype:g.filetype||"",accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onAudioMessage(l);break;case"file":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,file_length:g.file_length,accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onFileMessage(l);break;case"loc":var l={id:n,type:m,from:d,to:f,addr:g.addr,lat:g.lat,lng:g.lng,ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onLocationMessage(l);break;case"video":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,file_length:g.file_length,accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onVideoMessage(l);break;case"cmd":var l={id:n,from:d,to:f,action:g.action,ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onCmdMessage(l)}if(t.delivery){var B=t.getUniqueId(),A=l.id,w=new WebIM.message("delivery",B);w.set({id:A,to:l.from}),t.send(w.body)}}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}}}}}},connection.prototype.handleDeliveredMessage=function(e){var t=e.id,n=e.getElementsByTagName("body"),r=0;r=isNaN(n[0].innerHTML)?n[1].innerHTML:n[0].innerHTML;var o={mid:r};this.onDeliverdMessage(o),this.sendReceiptsMessage({id:t})},connection.prototype.handleAckedMessage=function(e){var t=e.id,n=e.getElementsByTagName("body"),r=0;r=isNaN(n[0].innerHTML)?n[1].innerHTML:n[0].innerHTML;var o={mid:r};this.onReadMessage(o),this.sendReceiptsMessage({id:t})},connection.prototype.handleReceivedMessage=function(e){try{var t=e.getElementsByTagName("received"),n=t[0].getAttribute("mid"),r=e.getElementsByTagName("body"),o=r[0].innerHTML,i={mid:n,id:o};this.onReceivedMessage(i)}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}var o,n,s=e.getElementsByTagName("received");if(s.length>0&&(o=s[0].childNodes&&s[0].childNodes.length>0?s[0].childNodes[0].nodeValue:s[0].innerHTML||s[0].innerText,n=s[0].getAttribute("mid")),_msgHash[o]){try{_msgHash[o].msg.success instanceof Function&&_msgHash[o].msg.success(o,n)}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete _msgHash[o]}},connection.prototype.handleInviteMessage=function(e){var t=null,n=e.getElementsByTagName("invite"),r=e.getElementsByTagName("reason")[0],o=r.textContent,i=e.getAttribute("id")||"";if(this.sendReceiptsMessage({id:i}),n&&n.length>0){var s=n[0].getAttribute("from");t=_parseNameFromJidFn(s)}var a=e.getElementsByTagName("x"),c=null;if(a&&a.length>0)for(var u=0;u")>0){var n=t.indexOf(""),r=t.indexOf(""),t=t.substring(n+5,r);stropheConn.setJid(t)}var o,t;if(0===e.data.indexOf(" from server"))}if(0===e.data.search("0){var childNode=msgBody.childNodes[0];if(childNode.nodeType==Strophe.ElementType.TEXT){var jsondata=childNode.wholeText||childNode.nodeValue;jsondata=jsondata.replace("\n","
");try{var data=eval("("+jsondata+")");parseMsgData.errorMsg=!1,parseMsgData.data=[data]}catch(e){}}}}var delayTags=msginfo.getElementsByTagName("delay");if(delayTags&&delayTags.length>0){var delayTag=delayTags[0],delayMsgTime=delayTag.getAttribute("stamp");delayMsgTime&&(parseMsgData.delayTimeStamp=delayMsgTime)}}else{var childrens=msginfo.childNodes;if(childrens&&childrens.length>0){var child=msginfo.childNodes[0];if(child.nodeType==Strophe.ElementType.TEXT)try{var data=eval("("+child.nodeValue+")");parseMsgData.errorMsg=!1,parseMsgData.data=[data]}catch(e){}}}return parseMsgData},_parseNameFromJidFn=function(e,t){t=t||"";var n=e,r=n.indexOf("_");-1!==r&&(n=n.substring(r+1));var o=n.indexOf("@"+t);return-1!==o&&(n=n.substring(0,o)),n},_parseFriend=function(e,t,n){var r=[],o=e.getElementsByTagName("item");if(o)for(var i=0;i0&&"urn:xmpp:receipts"===t[0].namespaceURI)s="received";else if(n&&n.length>0)s="invite";else if(r&&r.length>0)s="delivery";else if(o&&o.length)s="acked";else if(i&&i.length){var a=i[0],c=a.getElementsByTagName("user-muted");c&&c.length&&(s="userMuted")}return s},_handleMessageQueue=function(e){for(var t in _msgHash)_msgHash.hasOwnProperty(t)&&_msgHash[t].send(e)},_loginCallback=function(e,t,n){var r,o;if("conflict"===t&&(r=!0),e==Strophe.Status.CONNFAIL)o={type:_code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,msg:t,reconnect:!0},r&&(o.conflict=!0),n.onError(o);else if(e==Strophe.Status.ATTACHED||e==Strophe.Status.CONNECTED){n.autoReconnectNumTotal=0,n.intervalId=setInterval(function(){n.handelSendQueue()},200);var i=function(e){var t=e.getElementsByTagName("delivery"),r=e.getElementsByTagName("acked");if(t.length)return n.handleDeliveredMessage(e),!0;if(r.length)return n.handleAckedMessage(e),!0;switch(_parseMessageType(e)){case"received":return n.handleReceivedMessage(e),!0;case"invite":return n.handleInviteMessage(e),!0;case"delivery":return n.handleDeliveredMessage(e),!0;case"acked":return n.handleAckedMessage(e),!0;case"userMuted":return n.handleMutedMessage(e),!0;default:return n.handleMessage(e),!0}},s=function(e){return n.handlePresence(e),!0},a=function(e){return n.handlePing(e),!0},c=function(e){return n.handleIqRoster(e),!0},u=function(e){return n.handleIqPrivacy(e),!0},p=function(e){return n.handleIq(e),!0};n.addHandler(i,null,"message",null,null,null),n.addHandler(s,null,"presence",null,null,null),n.addHandler(a,"urn:xmpp:ping","iq","get",null,null),n.addHandler(c,"jabber:iq:roster","iq","set",null,null),n.addHandler(u,"jabber:iq:privacy","iq","set",null,null),n.addHandler(p,null,"iq",null,null,null),n.registerConfrIQHandler&&n.registerConfrIQHandler(),n.context.status=_code.STATUS_OPENED;var l=[_code.WEBIM_MESSAGE_REC_TEXT,_code.WEBIM_MESSAGE_REC_EMOJI];_utils.isCanDownLoadFile&&(l.push(_code.WEBIM_MESSAGE_REC_PHOTO),l.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE));var d=[_code.WEBIM_MESSAGE_SED_TEXT];_utils.isCanUploadFile&&(d.push(_code.WEBIM_MESSAGE_REC_PHOTO),d.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE)),n.notifyVersion(),n.retry&&_handleMessageQueue(n),n.heartBeat(),n.isAutoLogin&&n.setPresence();try{if(n.unSendMsgArr.length>0)for(var f in n.unSendMsgArr){var h=n.unSendMsgArr[f];n.sendCommand(h),delete n.unSendMsgArr[f]}}catch(e){console.error(e.message)}n.offLineSendConnecting=!1,n.logOut=!1,n.onOpened({canReceive:l,canSend:d,accessToken:n.context.accessToken})}else if(e==Strophe.Status.DISCONNECTING)n.isOpened()&&(n.stopHeartBeat(),n.context.status=_code.STATUS_CLOSING,o={type:_code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,msg:t,reconnect:!0},r&&(o.conflict=!0),n.onError(o));else if(e==Strophe.Status.DISCONNECTED){if(n.isOpened()){if(n.autoReconnectNumTotalthis.restTotal)return void console.log("rest hosts all tried,quit");var n="",r=this.restHosts[this.restIndex],o=_utils.getXmlFirstChild(r,"domain"),i=_utils.getXmlFirstChild(r,"ip");if(i){var s=_utils.getXmlFirstChild(r,"port");n=("https:"===location.protocol?"https:":"http:")+"//"+i.textContent+":"+s.textContent}else n=("https:"===location.protocol?"https:":"http:")+"//"+o.textContent;""!=n&&(this.apiUrl=n,e.apiUrl=n),"login"==t?this.login(e):this.signup(e)},connection.prototype.getHttpDNS=function(e,t){if(this.restHosts)return void this.getRestFromHttpDNS(e,t);var n=this,r=function(r,o){r=(new DOMParser).parseFromString(r,"text/xml").documentElement;var i=n.getHostsByTag(r,"rest");if(!i)return void console.log("rest hosts error3");n.restHosts=i,n.restTotal=i.length;var s=n.getHostsByTag(r,"xmpp");if(!s)return void console.log("xmpp hosts error3");n.xmppHosts=s,n.xmppTotal=s.length,n.getRestFromHttpDNS(e,t)},o=function(r,o,i){console.log("getHttpDNS error",r,i),++n.dnsIndex0){var f=d[0];l.show=Strophe.getText(f)}var h=e.getElementsByTagName("status");if(h&&h.length>0){var m=h[0];l.status=Strophe.getText(m),l.code=m.getAttribute("code")}var y=e.getElementsByTagName("priority");if(y&&y.length>0){var _=y[0];l.priority=Strophe.getText(_)}var g=e.getElementsByTagName("error");if(g&&g.length>0){var g=g[0];l.error={code:g.getAttribute("code")}}var v=e.getElementsByTagName("destroy");if(v&&v.length>0){var v=v[0];l.destroy=!0;var E=v.getElementsByTagName("reason");E&&E.length>0&&(l.reason=Strophe.getText(E[0]))}var N=e.getElementsByTagName("item");if(N&&N.length>0){var O=N[0],I=O.getAttribute("role"),b=O.getAttribute("jid"),x=O.getAttribute("affiliation");if("none"==I&&b){var T=_parseNameFromJidFn(b),C=O.getElementsByTagName("actor")[0],R=C.getAttribute("nick");l.actor=R,l.kicked=T}"moderator"==I&&"201"==l.code&&"owner"===x&&(l.type="createGroupACK",a=!0)}var S=e.getElementsByTagName("x");if(S&&S.length>0){var M=S[0].getElementsByTagName("apply"),B=S[0].getElementsByTagName("accept"),A=S[0].getElementsByTagName("item"),w=S[0].getElementsByTagName("decline"),k=S[0].getElementsByTagName("add_admin"),j=S[0].getElementsByTagName("remove_admin"),F=S[0].getElementsByTagName("add_mute"),D=S[0].getElementsByTagName("remove_mute");if(M&&M.length>0){p=!0,l.toNick=M[0].getAttribute("toNick"),l.type="joinGroupNotifications";var U=M[0].getAttribute("to"),W=U.split("@")[0].split("_");W=W[W.length-1],l.gid=W}else if(B&&B.length>0)l.type="joinPublicGroupSuccess";else if(A&&A.length>0){var x=A[0].getAttribute("affiliation"),I=A[0].getAttribute("role");if("member"==x||"participant"==I){c=!0,l.mid=l.fromJid.split("/"),l.mid=l.mid[l.mid.length-1],l.type="memberJoinPublicGroupSuccess";var L=e.getElementsByTagName("roomtype");if(L&&L.length>0){var r=L[0].getAttribute("type");"chatroom"==r&&(l.type="memberJoinChatRoomSuccess")}}}else if(w&&w.length){u=!0;var W=w[0].getAttribute("fromNick"),G=_parseNameFromJidFn(w[0].getAttribute("from"));l.type="joinPublicGroupDeclined",l.owner=G,l.gid=W}else if(k&&k.length>0){var W=_parseNameFromJidFn(k[0].getAttribute("mucjid")),G=_parseNameFromJidFn(k[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="addAdmin"}else if(j&&j.length>0){var W=_parseNameFromJidFn(j[0].getAttribute("mucjid")),G=_parseNameFromJidFn(j[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="removeAdmin"}else if(F&&F.length>0){var W=_parseNameFromJidFn(F[0].getAttribute("mucjid")),G=_parseNameFromJidFn(F[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="addMute"}else if(D&&D.length>0){var W=_parseNameFromJidFn(D[0].getAttribute("mucjid")),G=_parseNameFromJidFn(D[0].getAttribute("from"));l.owner=G,l.gid=W,l.type="removeMute"}}if(l.chatroom){l.presence_type=o,l.original_type=l.type;t.slice(t.lastIndexOf("/")+1)===this.context.userId&&(""!==l.type||l.code?"unavailable"!==o&&"unavailable"!==l.type||(l.status?110==l.code?l.type="leaveChatRoom":l.error&&406==l.error.code&&(l.type="reachChatRoomCapacity"):l.type="leaveChatRoom"):l.type="joinChatRoomSuccess")}else if(l.presence_type=o,l.original_type=r,/subscribe/.test(l.type));else if(""!=r||l.status||l.error||a||p||c||u){if("unavailable"===o||"unavailable"===r)if(l.destroy)l.type="deleteGroupChat";else if(307==l.code||321==l.code){var H=e.getAttribute("nick");l.type=H?"removedFromGroup":"leaveGroup"}}else console.log(2222222,e,l,p);this.onPresence(l,e)}},connection.prototype.handlePing=function(e){if(!this.isClosed()){var t=e.getAttribute("id"),n=e.getAttribute("from"),r=e.getAttribute("to"),o=$iq({from:r,to:n,id:t,type:"result"});this.sendCommand(o.tree())}},connection.prototype.handleIq=function(e){return!0},connection.prototype.handleIqPrivacy=function(e){0!=e.getElementsByTagName("list").length&&this.getBlacklist()},connection.prototype.handleIqRoster=function(e){var t=e.getAttribute("id"),n=e.getAttribute("from")||"",r=(_parseNameFromJidFn(n),this.context.jid),o=(this.context.userId,$iq({type:"result",id:t,from:r}));this.sendCommand(o.tree());var i=e.getElementsByTagName("query");if(i&&i.length>0){var s=i[0],a=_parseFriend(s,this,n);this.onRoster(a)}return!0},connection.prototype.handleMessage=function(e){var t=this;if(!this.isClosed()){var n=e.getAttribute("id")||"";this.cacheReceiptsMessage({id:n});var r=_parseResponseMessage(e);if(r.errorMsg)return void this.handlePresence(e);var o=e.getElementsByTagName("error"),i="",s="",a=!1;if(o.length>0){a=!0,i=o[0].getAttribute("code");var c=o[0].getElementsByTagName("text");s=c[0].textContent||c[0].text}var u=r.data;for(var p in u)if(u.hasOwnProperty(p)){var l=u[p];if(l.from&&l.to){var d=(l.from+"").toLowerCase(),f=(l.to+"").toLowerCase(),h=l.ext||{},m="",y=e.getElementsByTagName("roomtype");m=y.length?y[0].getAttribute("type")||"chat":e.getAttribute("type")||"chat";var _=l.bodies;if(_&&0!=_.length){var g=l.bodies[0],v=g.type;try{switch(v){case"txt":var E=g.msg;if("base64"===t.encrypt.type)E=atob(E);else if("aes"===t.encrypt.type){var N=CryptoJS.enc.Utf8.parse(t.encrypt.key),O=CryptoJS.enc.Utf8.parse(t.encrypt.iv),I=t.encrypt.mode.toLowerCase(),b={};"cbc"===I?b={iv:O,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}:"ebc"===I&&(b={mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7});var x=E,T=CryptoJS.AES.decrypt(x,N,b),C=T.toString(CryptoJS.enc.Utf8);E=C}var R=_utils.parseTextMessage(E,WebIM.Emoji);if(R.isemoji){var l={id:n,type:m,from:d,to:f,delay:r.delayTimeStamp,data:R.body,ext:h};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onEmojiMessage(l)}else{var l={id:n,type:m,from:d,to:f,delay:r.delayTimeStamp,data:E,ext:h};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onTextMessage(l)}break;case"img":var S=0,M=0;g.size&&(S=g.size.width,M=g.size.height);var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,thumb:g.thumb,thumb_secret:g.thumb_secret,file_length:g.file_length||"",width:S,height:M,filetype:g.filetype||"",accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onPictureMessage(l);break;case"audio":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,length:g.length||"",file_length:g.file_length||"",filetype:g.filetype||"",accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onAudioMessage(l);break;case"file":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,file_length:g.file_length,accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onFileMessage(l);break;case"loc":var l={id:n,type:m,from:d,to:f,addr:g.addr,lat:g.lat,lng:g.lng,ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onLocationMessage(l);break;case"video":var l={id:n,type:m,from:d,to:f,url:"https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+g.url.substr(g.url.indexOf("/",9)):g.url,secret:g.secret,filename:g.filename,file_length:g.file_length,accessToken:this.context.accessToken||"",ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onVideoMessage(l);break;case"cmd":var l={id:n,from:d,to:f,action:g.action,ext:h,delay:r.delayTimeStamp};!l.delay&&delete l.delay,l.error=a,l.errorText=s,l.errorCode=i,this.onCmdMessage(l)}if(t.delivery){var B=t.getUniqueId(),A=l.id,w=new WebIM.message("delivery",B);w.set({id:A,to:l.from}),t.send(w.body)}}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}}}}}},connection.prototype.handleDeliveredMessage=function(e){var t=e.id,n=e.getElementsByTagName("body"),r=0;r=isNaN(n[0].innerHTML)?n[1].innerHTML:n[0].innerHTML;var o={mid:r};this.onDeliverdMessage(o),this.sendReceiptsMessage({id:t})},connection.prototype.handleAckedMessage=function(e){var t=e.id,n=e.getElementsByTagName("body"),r=0;r=isNaN(n[0].innerHTML)?n[1].innerHTML:n[0].innerHTML;var o={mid:r};this.onReadMessage(o),this.sendReceiptsMessage({id:t})},connection.prototype.handleReceivedMessage=function(e){try{var t=e.getElementsByTagName("received"),n=t[0].getAttribute("mid"),r=e.getElementsByTagName("body"),o=r[0].innerHTML,i={mid:n,id:o};this.onReceivedMessage(i)}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}var o,n,s=e.getElementsByTagName("received");if(s.length>0&&(o=s[0].childNodes&&s[0].childNodes.length>0?s[0].childNodes[0].nodeValue:s[0].innerHTML||s[0].innerText,n=s[0].getAttribute("mid")),_msgHash[o]){try{_msgHash[o].msg.success instanceof Function&&_msgHash[o].msg.success(o,n)}catch(e){this.onError({type:_code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete _msgHash[o]}},connection.prototype.handleInviteMessage=function(e){var t=null,n=e.getElementsByTagName("invite"),r=e.getElementsByTagName("reason")[0],o=r.textContent,i=e.getAttribute("id")||"";if(this.sendReceiptsMessage({id:i}),n&&n.length>0){var s=n[0].getAttribute("from");t=_parseNameFromJidFn(s)}var a=e.getElementsByTagName("x"),c=null;if(a&&a.length>0)for(var u=0;u0){var o=r[0];t=_parseFriend(o)}n(t,e)},o=e.error||this.onError,i=function(e){o({type:_code.WEBIM_CONNCTION_GETROSTER_ERROR,data:e})};this.isOpened()?this.context.stropheConn.sendIQ(t.tree(),r,i):o({type:_code.WEBIM_CONNCTION_DISCONNECTED})},connection.prototype.subscribe=function(e){var t=_getJid(e,this),n=$pres({to:t,type:"subscribe"});e.message&&n.c("status").t(e.message).up(),e.nick&&n.c("nick",{xmlns:"http://jabber.org/protocol/nick"}).t(e.nick),this.sendCommand(n.tree())},connection.prototype.subscribed=function(e){var t=_getJid(e,this),n=$pres({to:t,type:"subscribed"});e.message&&n.c("status").t(e.message).up(),this.sendCommand(n.tree())},connection.prototype.unsubscribe=function(e){var t=_getJid(e,this),n=$pres({to:t,type:"unsubscribe"});e.message&&n.c("status").t(e.message),this.sendCommand(n.tree())},connection.prototype.unsubscribed=function(e){var t=_getJid(e,this),n=$pres({to:t,type:"unsubscribed"});e.message&&n.c("status").t(e.message).up(),this.sendCommand(n.tree())},connection.prototype.joinPublicGroup=function(e){var t=this.context.appKey+"_"+e.roomId+"@conference."+this.domain,n=t+"/"+this.context.userId,r=e.success||_utils.emptyfn,o=e.error||_utils.emptyfn,i=function(e){o({type:_code.WEBIM_CONNCTION_JOINROOM_ERROR,data:e})},s=$pres({from:this.context.jid,to:n}).c("x",{xmlns:Strophe.NS.MUC});this.context.stropheConn.sendIQ(s.tree(),r,i)},connection.prototype.listRooms=function(e){var t=$iq({to:e.server||"conference."+this.domain,from:this.context.jid,type:"get"}).c("query",{xmlns:Strophe.NS.DISCO_ITEMS}),n=e.success||_utils.emptyfn,r=e.error||this.onError,o=function(e){var t=[];t=_parseRoom(e);try{n(t)}catch(e){r({type:_code.WEBIM_CONNCTION_GETROOM_ERROR,data:e})}},i=e.error||_utils.emptyfn,s=function(e){i({type:_code.WEBIM_CONNCTION_GETROOM_ERROR,data:e})};this.context.stropheConn.sendIQ(t.tree(),o,s)},connection.prototype.queryRoomMember=function(e){var t=(this.domain,[]),n=$iq({to:this.context.appKey+"_"+e.roomId+"@conference."+this.domain,type:"get"}).c("query",{xmlns:Strophe.NS.MUC+"#admin"}).c("item",{affiliation:"member"}),r=e.success||_utils.emptyfn,o=function(e){var n=e.getElementsByTagName("item");if(n)for(var o=0;o0)return navigator.plugins["Shockwave Flash"];return 0}(),c=s(),u="undefined"!=typeof FormData,p="undefined"!=typeof Blob,l=c.setRequestHeader||!1,d=c.overrideMimeType||!1,f=l&&u,h=f||a,m=l&&(p||d);Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(o){if("object"!==(void 0===o?"undefined":_typeof(o))&&("function"!=typeof o||null===o))throw new TypeError("Object.keys called on non-object");var i,s,a=[];for(i in o)e.call(o,i)&&a.push(i);if(t)for(s=0;s0){var o=r.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=o.name||""}}else{var o=document.getElementById(e).value;t.url=o;var i=o.lastIndexOf("/"),s=o.lastIndexOf("\\"),a=Math.max(i,s);t.filename=a<0?o:o.substring(a+1)}var c=t.filename.lastIndexOf(".");return-1!=c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t}catch(e){throw e}},getFileSize:function(e){var t=this.getFileLength(e);if(t>1e7)return!1;var n=Math.round(t/1e3);if(n<1e3)t=n+" KB";else if(n>=1e3){var r=n/1e3;if(r<1e3)t=r.toFixed(1)+" MB";else{var o=r/1e3;t=o.toFixed(1)+" GB"}}return t},getFileLength:function(e){var t=0;if(e)if(e.files)e.files.length>0&&(t=e.files[0].size);else if(e.select&&"ActiveXObject"in window){e.select();var n=new ActiveXObject("Scripting.FileSystemObject"),e=n.GetFile(e.value);t=e.Size}return t},hasFlash:a,trim:function(e){return e="string"==typeof e?e:"",e.trim?e.trim():e.replace(/^\s|\s$/g,"")},parseEmoji:function(e){if(void 0===WebIM.Emoji||void 0===WebIM.Emoji.map)return e;var t=WebIM.Emoji;for(var n in t.map)if(t.map.hasOwnProperty(n))for(;e.indexOf(n)>-1;)e=e.replace(n,'');return e},parseLink:function(e){var t=/(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-\/=]*/gm;return e=e.replace(t,function(e){return""+e+""})},parseJSON:function(e){if(window.JSON&&window.JSON.parse)return window.JSON.parse(e+"");var t,n=null,r=y.trim(e+"");return r&&!y.trim(r.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,function(e,r,o,i){return t&&r&&(n=0),0===n?e:(t=o||r,n+=!i-!o,"")}))?Function("return "+r)():Function("Invalid JSON: "+e)()},parseUploadResponse:function(e){return e.indexOf("callback")>-1?e.slice(9,-1):e},parseDownloadResponse:function(e){return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},uploadFile:function(t){var t=t||{};t.onFileUploadProgress=t.onFileUploadProgress||e,t.onFileUploadComplete=t.onFileUploadComplete||e,t.onFileUploadError=t.onFileUploadError||e,t.onFileUploadCanceled=t.onFileUploadCanceled||e;var n=t.accessToken||this.context.accessToken;if(!n)return void t.onFileUploadError({type:r.WEBIM_UPLOADFILE_NO_LOGIN,id:t.id});var o,i,s,a=t.appKey||this.context.appKey||"";if(a&&(s=a.split("#"),o=s[0],i=s[1]),!o&&!i)return void t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,id:t.id});var c=t.apiUrl,u=c+"/"+o+"/"+i+"/chatfiles";if(!y.isCanUploadFileAsync)return void(y.hasFlash&&"function"==typeof t.flashUpload?t.flashUpload&&t.flashUpload(u,t):t.onFileUploadError({type:r.WEBIM_UPLOADFILE_BROWSER_ERROR,id:t.id}));var p=t.file.data?t.file.data.size:void 0;if(p>10485760)return void t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,id:t.id});if(p<=0)return void t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,id:t.id});var l=y.xmlrequest(),d=function(e){t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,id:t.id,xhr:l})};l.upload&&l.upload.addEventListener("progress",t.onFileUploadProgress,!1),l.addEventListener?(l.addEventListener("abort",t.onFileUploadCanceled,!1),l.addEventListener("load",function(e){try{var n=y.parseJSON(l.responseText);try{t.onFileUploadComplete(n)}catch(e){t.onFileUploadError({type:r.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}}catch(e){t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,data:l.responseText,id:t.id,xhr:l})}},!1),l.addEventListener("error",d,!1)):l.onreadystatechange&&(l.onreadystatechange=function(){if(4===l.readyState)if(200===ajax.status)try{var e=y.parseJSON(l.responseText);t.onFileUploadComplete(e)}catch(e){t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,data:l.responseText,id:t.id,xhr:l})}else t.onFileUploadError({type:r.WEBIM_UPLOADFILE_ERROR,data:l.responseText,id:t.id,xhr:l});else l.abort(),t.onFileUploadCanceled()}),l.open("POST",u),l.setRequestHeader("restrict-access","true"),l.setRequestHeader("Accept","*/*"),l.setRequestHeader("Authorization","Bearer "+n);var f=new FormData;f.append("file",t.file.data),window.XDomainRequest&&(l.readyState=2),l.send(f)},download:function(t){t.onFileDownloadComplete=t.onFileDownloadComplete||e,t.onFileDownloadError=t.onFileDownloadError||e;var n=t.accessToken||this.context.accessToken;if(!n)return void t.onFileDownloadError({type:r.WEBIM_DOWNLOADFILE_NO_LOGIN,id:t.id});var o=function(e){t.onFileDownloadError({type:r.WEBIM_DOWNLOADFILE_ERROR,id:t.id,xhr:i})};if(!y.isCanDownLoadFile)return void t.onFileDownloadComplete();var i=y.xmlrequest();"addEventListener"in i?(i.addEventListener("load",function(e){t.onFileDownloadComplete(i.response,i)},!1),i.addEventListener("error",o,!1)):"onreadystatechange"in i&&(i.onreadystatechange=function(){4===i.readyState?200===ajax.status?t.onFileDownloadComplete(i.response,i):t.onFileDownloadError({type:r.WEBIM_DOWNLOADFILE_ERROR,id:t.id,xhr:i}):(i.abort(),t.onFileDownloadError({type:r.WEBIM_DOWNLOADFILE_ERROR,id:t.id,xhr:i}))});var s=t.method||"GET",a=t.responseType||"blob",c=t.mimeType||"text/plain; charset=x-user-defined";i.open(s,t.url),"undefined"!=typeof Blob?i.responseType=a:i.overrideMimeType(c);var u={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":t.secret,Authorization:"Bearer "+n},p=t.headers||{};for(var l in p)u[l]=p[l];for(var l in u)u[l]&&i.setRequestHeader(l,u[l]);window.XDomainRequest&&(i.readyState=2),i.send(null)},parseTextMessage:function(e,t){if("string"==typeof e){if("[object Object]"!==Object.prototype.toString.call(t))return{isemoji:!1,body:[{type:"txt",data:e}]};var n=e,r=[],o=/\[[^[\]]{2,3}\]/gm,i=n.match(o);if(!i||i.length<1)return{isemoji:!1,body:[{type:"txt",data:e}]};for(var s=!1,a=0;a0?"&":"?")+(u?u+"&":u)+"_v="+(new Date).getTime(),c=null,u=null}if(s.open(a,t.url,y.isCanSetRequestHeader),y.isCanSetRequestHeader){var l=t.headers||{};for(var d in l)l.hasOwnProperty(d)&&s.setRequestHeader(d,l[d])}return window.XDomainRequest&&(s.readyState=2),s.send(c),s},ts:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),r=e.getSeconds(),o=e.getMilliseconds();return(t<10?"0"+t:t)+":"+(n<10?"0"+n:n)+":"+(r<10?"0"+r:r)+":"+o+" "},getObjectKey:function(e,t){for(var n in e)if(e[n]==t)return n;return""},sprintf:function(){var e,t,n=arguments,r=n[0]||"";for(e=1,t=n.length;e=0)return;r=$msg({from:t.context.jid||"",to:n.toJid,id:n.id,xmlns:"jabber:client"}).c("body").t(n.ackId);var a={xmlns:"urn:xmpp:receipts",id:n.ackId};r.up().c("acked",a)}setTimeout(function(){"undefined"!=typeof _msgHash&&_msgHash[n.id]&&_msgHash[n.id].msg.fail instanceof Function&&_msgHash[n.id].msg.fail(n.id)},6e4),t.sendCommand(r.tree(),n.id)};if(n.msg.file){if(n.msg.body&&n.msg.body.url)return void r(n.msg);var o=n.msg.onFileUploadComplete,i=function(e){if(e.entities[0]["file-metadata"]){var i=e.entities[0]["file-metadata"]["content-length"];n.msg.filetype=e.entities[0]["file-metadata"]["content-type"],i>204800&&(n.msg.thumbnail=!0)}n.msg.body={type:n.msg.type||"file",url:("https:"!=location.protocol&&t.isHttpDNS?t.apiUrl+e.uri.substr(e.uri.indexOf("/",9)):e.uri)+"/"+e.entities[0].uuid,secret:e.entities[0]["share-secret"],filename:n.msg.file.filename||n.msg.filename,size:{width:n.msg.width||0,height:n.msg.height||0},length:n.msg.length||0,file_length:n.msg.ext.file_length||0,filetype:n.msg.filetype},r(n.msg),o instanceof Function&&o(e,n.msg.id)};n.msg.onFileUploadComplete=i,e.uploadFile.call(t,n.msg)}else n.msg.body={type:"chat"===n.msg.type?"txt":n.msg.type,msg:n.msg.msg},"cmd"===n.msg.type?n.msg.body.action=n.msg.action:"loc"===n.msg.type&&(n.msg.body.addr=n.msg.addr,n.msg.body.lat=n.msg.lat,n.msg.body.lng=n.msg.lng),r(n.msg)},t._msg=o,t.message=r}()},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(7),n(8),n(9),n(10),n(11),n(12),n(13),n(14),n(15),n(16),n(17),n(18),n(19),n(20),n(21),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29),n(30),n(31),n(32),n(33),n(34),n(35),n(36),n(37),n(38))}(0,function(e){return e})},function(e,t,n){!function(n,r){e.exports=t=r()}(0,function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},o=r.lib={},i=o.Base=function(){return{extend:function(e){var t=n(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)}}}(),s=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[r+i>>>2]|=s<<24-(r+i)%4*8}else for(var i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],o=0;o>16)&r,t=18e3*(65535&t)+(t>>16)&r;var o=(n<<16)+t&r;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}}(4294967296*(n||e.random()));n=987654071*i(),r.push(4294967296*i()|0)}return new s.init(r,t)}}),a=r.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},p=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,a=4*i,c=o/a;c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0);var u=c*i,p=e.min(4*u,o);if(u){for(var l=0;l>>2]|=e[r]<<24-r%4*8;o.call(this,n,t)}else o.apply(this,arguments)}).prototype=r}}(),e.lib.WordArray})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){return function(){function t(e){return e<<8&4278255360|e>>>8&16711935}var n=e,r=n.lib,o=r.WordArray,i=n.enc;i.Utf16=i.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>1]|=e.charCodeAt(r)<<16-r%2*16;return o.create(n,2*t)}};i.Utf16LE={stringify:function(e){for(var n=e.words,r=e.sigBytes,o=[],i=0;i>>2]>>>16-i%4*8&65535);o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i>>1]|=t(e.charCodeAt(i)<<16-i%2*16);return o.create(r,2*n)}}}(),e.enc.Utf16})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){return function(){function t(e,t,n){for(var r=[],i=0,s=0;s>>6-s%4*2;r[i>>>2]|=(a|c)<<24-i%4*8,i++}return o.create(r,i)}var n=e,r=n.lib,o=r.WordArray,i=n.enc;i.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i>>2]>>>24-i%4*8&255,a=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=s<<16|a<<8|c,p=0;p<4&&i+.75*p>>6*(3-p)&63));var l=r.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var n=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i>>32-i)+t}function r(e,t,n,r,o,i,s){var a=e+(t&r|n&~r)+o+s;return(a<>>32-i)+t}function o(e,t,n,r,o,i,s){var a=e+(t^n^r)+o+s;return(a<>>32-i)+t}function i(e,t,n,r,o,i,s){var a=e+(n^(t|~r))+o+s;return(a<>>32-i)+t}var s=e,a=s.lib,c=a.WordArray,u=a.Hasher,p=s.algo,l=[];!function(){for(var e=0;e<64;e++)l[e]=4294967296*t.abs(t.sin(e+1))|0}();var d=p.MD5=u.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;s<16;s++){var a=t+s,c=e[a];e[a]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var u=this._hash.words,p=e[t+0],d=e[t+1],f=e[t+2],h=e[t+3],m=e[t+4],y=e[t+5],_=e[t+6],g=e[t+7],v=e[t+8],E=e[t+9],N=e[t+10],O=e[t+11],I=e[t+12],b=e[t+13],x=e[t+14],T=e[t+15],C=u[0],R=u[1],S=u[2],M=u[3];C=n(C,R,S,M,p,7,l[0]),M=n(M,C,R,S,d,12,l[1]),S=n(S,M,C,R,f,17,l[2]),R=n(R,S,M,C,h,22,l[3]),C=n(C,R,S,M,m,7,l[4]),M=n(M,C,R,S,y,12,l[5]),S=n(S,M,C,R,_,17,l[6]),R=n(R,S,M,C,g,22,l[7]),C=n(C,R,S,M,v,7,l[8]),M=n(M,C,R,S,E,12,l[9]),S=n(S,M,C,R,N,17,l[10]),R=n(R,S,M,C,O,22,l[11]),C=n(C,R,S,M,I,7,l[12]),M=n(M,C,R,S,b,12,l[13]),S=n(S,M,C,R,x,17,l[14]),R=n(R,S,M,C,T,22,l[15]),C=r(C,R,S,M,d,5,l[16]),M=r(M,C,R,S,_,9,l[17]),S=r(S,M,C,R,O,14,l[18]),R=r(R,S,M,C,p,20,l[19]),C=r(C,R,S,M,y,5,l[20]),M=r(M,C,R,S,N,9,l[21]),S=r(S,M,C,R,T,14,l[22]),R=r(R,S,M,C,m,20,l[23]),C=r(C,R,S,M,E,5,l[24]),M=r(M,C,R,S,x,9,l[25]),S=r(S,M,C,R,h,14,l[26]),R=r(R,S,M,C,v,20,l[27]),C=r(C,R,S,M,b,5,l[28]),M=r(M,C,R,S,f,9,l[29]),S=r(S,M,C,R,g,14,l[30]),R=r(R,S,M,C,I,20,l[31]),C=o(C,R,S,M,y,4,l[32]),M=o(M,C,R,S,v,11,l[33]),S=o(S,M,C,R,O,16,l[34]),R=o(R,S,M,C,x,23,l[35]),C=o(C,R,S,M,d,4,l[36]),M=o(M,C,R,S,m,11,l[37]),S=o(S,M,C,R,g,16,l[38]),R=o(R,S,M,C,N,23,l[39]),C=o(C,R,S,M,b,4,l[40]),M=o(M,C,R,S,p,11,l[41]),S=o(S,M,C,R,h,16,l[42]),R=o(R,S,M,C,_,23,l[43]),C=o(C,R,S,M,E,4,l[44]),M=o(M,C,R,S,I,11,l[45]),S=o(S,M,C,R,T,16,l[46]),R=o(R,S,M,C,f,23,l[47]),C=i(C,R,S,M,p,6,l[48]),M=i(M,C,R,S,g,10,l[49]),S=i(S,M,C,R,x,15,l[50]),R=i(R,S,M,C,y,21,l[51]),C=i(C,R,S,M,I,6,l[52]),M=i(M,C,R,S,h,10,l[53]),S=i(S,M,C,R,N,15,l[54]),R=i(R,S,M,C,d,21,l[55]),C=i(C,R,S,M,v,6,l[56]),M=i(M,C,R,S,T,10,l[57]),S=i(S,M,C,R,_,15,l[58]),R=i(R,S,M,C,b,21,l[59]),C=i(C,R,S,M,m,6,l[60]),M=i(M,C,R,S,O,10,l[61]),S=i(S,M,C,R,f,15,l[62]),R=i(R,S,M,C,E,21,l[63]),u[0]=u[0]+C|0,u[1]=u[1]+R|0,u[2]=u[2]+S|0,u[3]=u[3]+M|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;n[o>>>5]|=128<<24-o%32;var i=t.floor(r/4294967296),s=r;n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var p=c[u];c[u]=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8)}return a},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});s.MD5=u._createHelper(d),s.HmacMD5=u._createHmacHelper(d)}(Math),e.MD5})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,o=n.Hasher,i=t.algo,s=[],a=i.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var p=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=p<<1|p>>>31}var l=(r<<5|r>>>27)+c+s[u];l+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=o._createHelper(a),t.HmacSHA1=o._createHmacHelper(a)}(),e.SHA1})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){return function(t){var n=e,r=n.lib,o=r.WordArray,i=r.Hasher,s=n.algo,a=[],c=[];!function(){function e(e){return 4294967296*(e-(0|e))|0}for(var n=2,r=0;r<64;)(function(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0})(n)&&(r<8&&(a[r]=e(t.pow(n,.5))),c[r]=e(t.pow(n,1/3)),r++),n++}();var u=[],p=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],p=n[5],l=n[6],d=n[7],f=0;f<64;f++){if(f<16)u[f]=0|e[t+f];else{var h=u[f-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,y=u[f-2],_=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[f]=m+u[f-7]+_+u[f-16]}var g=a&p^~a&l,v=r&o^r&i^o&i,E=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),N=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),O=d+N+g+c[f]+u[f],I=E+v;d=l,l=p,p=a,a=s+O|0,s=i,i=o,o=r,r=O+I|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+p|0,n[6]=n[6]+l|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=t.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=i._createHelper(p),n.HmacSHA256=i._createHmacHelper(p)}(Math),e.SHA256})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(13))}(0,function(e){return function(){var t=e,n=t.lib,r=n.WordArray,o=t.algo,i=o.SHA256,s=o.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});t.SHA224=i._createHelper(s),t.HmacSHA224=i._createHmacHelper(s)}(),e.SHA224})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(7))}(0,function(e){return function(){function t(){return s.create.apply(s,arguments)} var n=e,r=n.lib,o=r.Hasher,i=n.x64,s=i.Word,a=i.WordArray,c=n.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],p=[];!function(){for(var e=0;e<80;e++)p[e]=t()}();var l=c.SHA512=o.extend({_doReset:function(){this._hash=new a.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],a=n[4],c=n[5],l=n[6],d=n[7],f=r.high,h=r.low,m=o.high,y=o.low,_=i.high,g=i.low,v=s.high,E=s.low,N=a.high,O=a.low,I=c.high,b=c.low,x=l.high,T=l.low,C=d.high,R=d.low,S=f,M=h,B=m,A=y,w=_,k=g,j=v,F=E,D=N,U=O,W=I,L=b,G=x,H=T,P=C,z=R,J=0;J<80;J++){var q=p[J];if(J<16)var K=q.high=0|e[t+2*J],X=q.low=0|e[t+2*J+1];else{var Q=p[J-15],$=Q.high,V=Q.low,Y=($>>>1|V<<31)^($>>>8|V<<24)^$>>>7,Z=(V>>>1|$<<31)^(V>>>8|$<<24)^(V>>>7|$<<25),ee=p[J-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,oe=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ie=p[J-7],se=ie.high,ae=ie.low,ce=p[J-16],ue=ce.high,pe=ce.low,X=Z+ae,K=Y+se+(X>>>0>>0?1:0),X=X+oe,K=K+re+(X>>>0>>0?1:0),X=X+pe,K=K+ue+(X>>>0>>0?1:0);q.high=K,q.low=X}var le=D&W^~D&G,de=U&L^~U&H,fe=S&B^S&w^B&w,he=M&A^M&k^A&k,me=(S>>>28|M<<4)^(S<<30|M>>>2)^(S<<25|M>>>7),ye=(M>>>28|S<<4)^(M<<30|S>>>2)^(M<<25|S>>>7),_e=(D>>>14|U<<18)^(D>>>18|U<<14)^(D<<23|U>>>9),ge=(U>>>14|D<<18)^(U>>>18|D<<14)^(U<<23|D>>>9),ve=u[J],Ee=ve.high,Ne=ve.low,Oe=z+ge,Ie=P+_e+(Oe>>>0>>0?1:0),Oe=Oe+de,Ie=Ie+le+(Oe>>>0>>0?1:0),Oe=Oe+Ne,Ie=Ie+Ee+(Oe>>>0>>0?1:0),Oe=Oe+X,Ie=Ie+K+(Oe>>>0>>0?1:0),be=ye+he,xe=me+fe+(be>>>0>>0?1:0);P=G,z=H,G=W,H=L,W=D,L=U,U=F+Oe|0,D=j+Ie+(U>>>0>>0?1:0)|0,j=w,F=k,w=B,k=A,B=S,A=M,M=Oe+be|0,S=Ie+xe+(M>>>0>>0?1:0)|0}h=r.low=h+M,r.high=f+S+(h>>>0>>0?1:0),y=o.low=y+A,o.high=m+B+(y>>>0>>0?1:0),g=i.low=g+k,i.high=_+w+(g>>>0>>0?1:0),E=s.low=E+F,s.high=v+j+(E>>>0>>0?1:0),O=a.low=O+U,a.high=N+D+(O>>>0>>0?1:0),b=c.low=b+L,c.high=I+W+(b>>>0>>0?1:0),T=l.low=T+H,l.high=x+G+(T>>>0>>0?1:0),R=d.low=R+z,d.high=C+P+(R>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});n.SHA512=o._createHelper(l),n.HmacSHA512=o._createHmacHelper(l)}(),e.SHA512})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(7),n(15))}(0,function(e){return function(){var t=e,n=t.x64,r=n.Word,o=n.WordArray,i=t.algo,s=i.SHA512,a=i.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}});t.SHA384=s._createHelper(a),t.HmacSHA384=s._createHmacHelper(a)}(),e.SHA384})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(7))}(0,function(e){return function(t){var n=e,r=n.lib,o=r.WordArray,i=r.Hasher,s=n.x64,a=s.Word,c=n.algo,u=[],p=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[e+5*t]=(n+1)*(n+2)/2%64;var r=t%5,o=(2*e+3*t)%5;e=r,t=o}for(var e=0;e<5;e++)for(var t=0;t<5;t++)p[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,s=0;s<24;s++){for(var c=0,d=0,f=0;f<7;f++){if(1&i){var h=(1<>>24)|4278255360&(i<<24|i>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8);var a=n[o];a.high^=s,a.low^=i}for(var c=0;c<24;c++){for(var f=0;f<5;f++){for(var h=0,m=0,y=0;y<5;y++){var a=n[f+5*y];h^=a.high,m^=a.low}var _=d[f];_.high=h,_.low=m}for(var f=0;f<5;f++)for(var g=d[(f+4)%5],v=d[(f+1)%5],E=v.high,N=v.low,h=g.high^(E<<1|N>>>31),m=g.low^(N<<1|E>>>31),y=0;y<5;y++){var a=n[f+5*y];a.high^=h,a.low^=m}for(var O=1;O<25;O++){var a=n[O],I=a.high,b=a.low,x=u[O];if(x<32)var h=I<>>32-x,m=b<>>32-x;else var h=b<>>64-x,m=I<>>64-x;var T=d[p[O]];T.high=h,T.low=m}var C=d[0],R=n[0];C.high=R.high,C.low=R.low;for(var f=0;f<5;f++)for(var y=0;y<5;y++){var O=f+5*y,a=n[O],S=d[O],M=d[(f+1)%5+5*y],B=d[(f+2)%5+5*y];a.high=S.high^~M.high&B.high,a.low=S.low^~M.low&B.low}var a=n[0],A=l[c];a.high^=A.high,a.low^=A.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/i)*i>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],p=0;p>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),u.push(f),u.push(d)}return new o.init(u,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=i._createHelper(f),n.HmacSHA3=i._createHmacHelper(f)}(Math),e.SHA3})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){return function(t){function n(e,t,n){return e^t^n}function r(e,t,n){return e&t|~e&n}function o(e,t,n){return(e|~t)^n}function i(e,t,n){return e&n|t&~n}function s(e,t,n){return e^(t|~n)}function a(e,t){return e<>>32-t}var c=e,u=c.lib,p=u.WordArray,l=u.Hasher,d=c.algo,f=p.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=p.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]),m=p.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]),y=p.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]),_=p.create([0,1518500249,1859775393,2400959708,2840853838]),g=p.create([1352829926,1548603684,1836072691,2053994217,0]),v=d.RIPEMD160=l.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var c=0;c<16;c++){var u=t+c,p=e[u];e[u]=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8)}var l,d,v,E,N,O,I,b,x,T,C=this._hash.words,R=_.words,S=g.words,M=f.words,B=h.words,A=m.words,w=y.words;O=l=C[0],I=d=C[1],b=v=C[2],x=E=C[3],T=N=C[4];for(var k,c=0;c<80;c+=1)k=l+e[t+M[c]]|0,k+=c<16?n(d,v,E)+R[0]:c<32?r(d,v,E)+R[1]:c<48?o(d,v,E)+R[2]:c<64?i(d,v,E)+R[3]:s(d,v,E)+R[4],k|=0,k=a(k,A[c]),k=k+N|0,l=N,N=E,E=a(v,10),v=d,d=k,k=O+e[t+B[c]]|0,k+=c<16?s(I,b,x)+S[0]:c<32?i(I,b,x)+S[1]:c<48?o(I,b,x)+S[2]:c<64?r(I,b,x)+S[3]:n(I,b,x)+S[4],k|=0,k=a(k,w[c]),k=k+T|0,O=T,T=x,x=a(b,10),b=I,I=k;k=C[1]+v+x|0,C[1]=C[2]+E+T|0,C[2]=C[3]+N+O|0,C[3]=C[4]+l+I|0,C[4]=C[0]+d+b|0,C[0]=k},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,i=o.words,s=0;s<5;s++){var a=i[s];i[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return o},clone:function(){var e=l.clone.call(this);return e._hash=this._hash.clone(),e}});c.RIPEMD160=l._createHelper(v),c.HmacRIPEMD160=l._createHmacHelper(v)}(Math),e.RIPEMD160})},function(e,t,n){!function(r,o){e.exports=t=o(n(6))}(0,function(e){!function(){var t=e,n=t.lib,r=n.Base,o=t.enc,i=o.Utf8,s=t.algo;s.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,u=0;u>>2];e.sigBytes-=t}},_=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:y}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else{var r=n.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_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}),r.CipherParams=o.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=n.format={},v=g.OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=i.create([1398893684,1701076831]).concat(n).concat(t);else var r=t;return r.toString(c)},parse:function(e){var t=c.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=i.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return _.create({ciphertext:t,salt:r})}},E=r.SerializableCipher=o.extend({cfg:o.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r),i=o.finalize(t),s=o.cfg;return _.create({ciphertext:i,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),N=n.kdf={},O=N.OpenSSL={execute:function(e,t,n,r){r||(r=i.random(8));var o=p.create({keySize:t+n}).compute(e,r),s=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,_.create({key:o,iv:s,salt:r})}},I=r.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:O}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=r.kdf.execute(n,e.keySize,e.ivSize);r.iv=o.iv;var i=E.encrypt.call(this,e,t,o.key,r);return i.mixIn(o),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var o=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=o.iv,E.decrypt.call(this,e,t,o.key,r)}})}()})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return e.mode.CFB=function(){function t(e,t,n,r){var o=this._iv;if(o){var i=o.slice(0);this._iv=void 0}else var i=this._prevBlock;r.encryptBlock(i,0);for(var s=0;s>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var r=e.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0),n(s);var a=s.slice(0);r.encryptBlock(a,0);for(var c=0;c>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return e.pad.Iso10126={pad:function(t,n){var r=4*n,o=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(o-1)).concat(e.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1;!(t[n>>>2]>>>24-n%4*8&255);)n--;e.sigBytes=n+1}},e.pad.ZeroPadding})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(22))}(0,function(e){return function(t){var n=e,r=n.lib,o=r.CipherParams,i=n.enc,s=i.Hex,a=n.format;a.Hex={stringify:function(e){return e.ciphertext.toString(s)},parse:function(e){var t=s.parse(e);return o.create({ciphertext:t})}}}(),e.format.Hex})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(10),n(11),n(21),n(22))}(0,function(e){return function(){var t=e,n=t.lib,r=n.BlockCipher,o=t.algo,i=[],s=[],a=[],c=[],u=[],p=[],l=[],d=[],f=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=0,r=0,t=0;t<256;t++){var o=r^r<<1^r<<2^r<<3^r<<4;o=o>>>8^255&o^99,i[n]=o,s[o]=n;var m=e[n],y=e[m],_=e[y],g=257*e[o]^16843008*o;a[n]=g<<24|g>>>8,c[n]=g<<16|g>>>16,u[n]=g<<8|g>>>24,p[n]=g;var g=16843009*_^65537*y^257*m^16843008*n;l[o]=g<<24|g>>>8,d[o]=g<<16|g>>>16,f[o]=g<<8|g>>>24,h[o]=g,n?(n=m^e[e[e[_^m]]],r^=e[e[r]]):n=r=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],y=o.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=this._nRounds=n+6,o=4*(r+1),s=this._keySchedule=[],a=0;a6&&a%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=c<<8|c>>>24,c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=m[a/n|0]<<24),s[a]=s[a-n]^c}for(var u=this._invKeySchedule=[],p=0;p>>24]]^d[i[c>>>16&255]]^f[i[c>>>8&255]]^h[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,c,u,p,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,h,s);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,s,a){for(var c=this._nRounds,u=e[t]^n[0],p=e[t+1]^n[1],l=e[t+2]^n[2],d=e[t+3]^n[3],f=4,h=1;h>>24]^o[p>>>16&255]^i[l>>>8&255]^s[255&d]^n[f++],y=r[p>>>24]^o[l>>>16&255]^i[d>>>8&255]^s[255&u]^n[f++],_=r[l>>>24]^o[d>>>16&255]^i[u>>>8&255]^s[255&p]^n[f++],g=r[d>>>24]^o[u>>>16&255]^i[p>>>8&255]^s[255&l]^n[f++];u=m,p=y,l=_,d=g}var m=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[l>>>8&255]<<8|a[255&d])^n[f++],y=(a[p>>>24]<<24|a[l>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[f++],_=(a[l>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^n[f++],g=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&l])^n[f++];e[t]=m,e[t+1]=y,e[t+2]=_,e[t+3]=g},keySize:8});t.AES=r._createHelper(y)}(),e.AES})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(10),n(11),n(21),n(22))}(0,function(e){return function(){function t(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-o%32&1}for(var i=this._subKeys=[],s=0;s<16;s++){for(var a=i[s]=[],l=p[s],r=0;r<24;r++)a[r/6|0]|=n[(u[r]-1+l)%28]<<31-r%6,a[4+(r/6|0)]|=n[28+(u[r+24]-1+l)%28]<<31-r%6;a[0]=a[0]<<1|a[0]>>>31;for(var r=1;r<7;r++)a[r]=a[r]>>>4*(r-1)+3;a[7]=a[7]<<5|a[7]>>>27}for(var d=this._invSubKeys=[],r=0;r<16;r++)d[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,r,o){this._lBlock=e[r],this._rBlock=e[r+1],t.call(this,4,252645135),t.call(this,16,65535),n.call(this,2,858993459),n.call(this,8,16711935),t.call(this,1,1431655765);for(var i=0;i<16;i++){for(var s=o[i],a=this._lBlock,c=this._rBlock,u=0,p=0;p<8;p++)u|=l[p][((c^s[p])&d[p])>>>0];this._lBlock=c,this._rBlock=a^u}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,t.call(this,1,1431655765), n.call(this,8,16711935),n.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),e[r]=this._lBlock,e[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=s._createHelper(f);var h=a.TripleDES=s.extend({_doReset:function(){var e=this._key,t=e.words;this._des1=f.createEncryptor(i.create(t.slice(0,2))),this._des2=f.createEncryptor(i.create(t.slice(2,4))),this._des3=f.createEncryptor(i.create(t.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=s._createHelper(h)}(),e.TripleDES})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(10),n(11),n(21),n(22))}(0,function(e){return function(){function t(){for(var e=this._S,t=this._i,n=this._j,r=0,o=0;o<4;o++){t=(t+1)%256,n=(n+e[t])%256;var i=e[t];e[t]=e[n],e[n]=i,r|=e[(e[t]+e[n])%256]<<24-8*o}return this._i=t,this._j=n,r}var n=e,r=n.lib,o=r.StreamCipher,i=n.algo,s=i.RC4=o.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;for(var o=0,i=0;o<256;o++){var s=o%n,a=t[s>>>2]>>>24-s%4*8&255;i=(i+r[o]+a)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(e,n){e[n]^=t.call(this)},keySize:8,ivSize:0});n.RC4=o._createHelper(s);var a=i.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)t.call(this)}});n.RC4Drop=o._createHelper(a)}(),e.RC4})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(10),n(11),n(21),n(22))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];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;for(var n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,i=r>>>16,s=((o*o>>>17)+o*i>>>15)+i*i,u=((4294901760&r)*r|0)+((65535&r)*r|0);c[n]=s^u}e[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,e[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,e[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,e[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,e[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,e[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,e[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,e[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var n=e,r=n.lib,o=r.StreamCipher,i=n.algo,s=[],a=[],c=[],u=i.Rabbit=o.extend({_doReset:function(){for(var e=this._key.words,n=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 o=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]];this._b=0;for(var r=0;r<4;r++)t.call(this);for(var r=0;r<8;r++)i[r]^=o[r+4&7];if(n){var s=n.words,a=s[0],c=s[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=u>>>16|4294901760&p,d=p<<16|65535&u;i[0]^=u,i[1]^=l,i[2]^=p,i[3]^=d,i[4]^=u,i[5]^=l,i[6]^=p,i[7]^=d;for(var r=0;r<4;r++)t.call(this)}},_doProcessBlock:function(e,n){var r=this._X;t.call(this),s[0]=r[0]^r[5]>>>16^r[3]<<16,s[1]=r[2]^r[7]>>>16^r[5]<<16,s[2]=r[4]^r[1]>>>16^r[7]<<16,s[3]=r[6]^r[3]>>>16^r[1]<<16;for(var o=0;o<4;o++)s[o]=16711935&(s[o]<<8|s[o]>>>24)|4278255360&(s[o]<<24|s[o]>>>8),e[n+o]^=s[o]},blockSize:4,ivSize:2});n.Rabbit=o._createHelper(u)}(),e.Rabbit})},function(e,t,n){!function(r,o,i){e.exports=t=o(n(6),n(10),n(11),n(21),n(22))}(0,function(e){return function(){function t(){for(var e=this._X,t=this._C,n=0;n<8;n++)a[n]=t[n];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;for(var n=0;n<8;n++){var r=e[n]+t[n],o=65535&r,i=r>>>16,s=((o*o>>>17)+o*i>>>15)+i*i,u=((4294901760&r)*r|0)+((65535&r)*r|0);c[n]=s^u}e[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,e[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,e[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,e[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,e[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,e[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,e[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,e[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var n=e,r=n.lib,o=r.StreamCipher,i=n.algo,s=[],a=[],c=[],u=i.RabbitLegacy=o.extend({_doReset:function(){var e=this._key.words,n=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],o=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++)t.call(this);for(var i=0;i<8;i++)o[i]^=r[i+4&7];if(n){var s=n.words,a=s[0],c=s[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=u>>>16|4294901760&p,d=p<<16|65535&u;o[0]^=u,o[1]^=l,o[2]^=p,o[3]^=d,o[4]^=u,o[5]^=l,o[6]^=p,o[7]^=d;for(var i=0;i<4;i++)t.call(this)}},_doProcessBlock:function(e,n){var r=this._X;t.call(this),s[0]=r[0]^r[5]>>>16^r[3]<<16,s[1]=r[2]^r[7]>>>16^r[5]<<16,s[2]=r[4]^r[1]>>>16^r[7]<<16,s[3]=r[6]^r[3]>>>16^r[1]<<16;for(var o=0;o<4;o++)s[o]=16711935&(s[o]<<8|s[o]>>>24)|4278255360&(s[o]<<24|s[o]>>>8),e[n+o]^=s[o]},blockSize:4,ivSize:2});n.RabbitLegacy=o._createHelper(u)}(),e.RabbitLegacy})},function(e,t){!function(){function e(e){this.array=void 0===e?[]:new Array(e)}e.prototype={length:function(){return this.array.length},at:function(e){return this.array[e]},set:function(e,t){this.array[e]=t},push:function(e){return this.array.push(e)},slice:function(e,t){return this.array=this.array.slice(e,t)},concat:function(e){this.array=this.array.concat(e)},remove:function(e,t){t=void 0===t?1:t,this.array.splice(e,t)},join:function(e){return this.array.join(e)},clear:function(){this.array.length=0}};var n=function(){this._array_h=new e};n.prototype={_index:0,push:function(e){this._array_h.push(e)},pop:function(){var e=null;return this._array_h.length()&&(e=this._array_h.at(this._index),2*++this._index>=this._array_h.length()&&(this._array_h.slice(this._index),this._index=0)),e},head:function(){var e=null,t=this._array_h.length();return t&&(e=this._array_h.at(t-1)),e},tail:function(){var e=null;return this._array_h.length()&&(e=this._array_h.at(this._index)),e},length:function(){return this._array_h.length()-this._index},empty:function(){return 0===this._array_h.length()},clear:function(){this._array_h.clear()}},t.Queue=n}()},function(e,t,n){var r,o;(function(){function n(e){function t(t,n,r,o,i,s){for(;i>=0&&i0?0:a-1;return arguments.length<3&&(o=n[s?s[c]:c],c+=e),t(n,r,o,s,c,a)}}function i(e){return function(t,n,r){n=b(n,r);for(var o=S(t),i=e>0?0:o-1;i>=0&&i0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return i=n(r,o),r[i]===o?i:-1;if(o!==o)return i=t(h.call(r,s,a),O.isNaN),i>=0?i+s:-1;for(i=e>0?s:a-1;i>=0&&i=0&&t<=R};O.each=O.forEach=function(e,t,n){t=I(t,n);var r,o;if(M(e))for(r=0,o=e.length;r=0},O.invoke=function(e,t){var n=h.call(arguments,2),r=O.isFunction(t);return O.map(e,function(e){var o=r?t:e[t];return null==o?o:o.apply(e,n)})},O.pluck=function(e,t){return O.map(e,O.property(t))},O.where=function(e,t){return O.filter(e,O.matcher(t))},O.findWhere=function(e,t){return O.find(e,O.matcher(t))},O.max=function(e,t,n){var r,o,i=-1/0,s=-1/0;if(null==t&&null!=e){e=M(e)?e:O.values(e);for(var a=0,c=e.length;ai&&(i=r)}else t=b(t,n),O.each(e,function(e,n,r){((o=t(e,n,r))>s||o===-1/0&&i===-1/0)&&(i=e,s=o)});return i},O.min=function(e,t,n){var r,o,i=1/0,s=1/0;if(null==t&&null!=e){e=M(e)?e:O.values(e);for(var a=0,c=e.length;ar||void 0===n)return 1;if(nt?(s&&(clearTimeout(s),s=null),a=u,i=e.apply(r,o),s||(r=o=null)):s||!1===n.trailing||(s=setTimeout(c,p)),i}},O.debounce=function(e,t,n){var r,o,i,s,a,c=function c(){var u=O.now()-s;u=0?r=setTimeout(c,t-u):(r=null,n||(a=e.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,s=O.now();var u=n&&!r;return r||(r=setTimeout(c,t)),u&&(a=e.apply(i,o),i=o=null),a}},O.wrap=function(e,t){return O.partial(t,e)},O.negate=function(e){return function(){return!e.apply(this,arguments)}},O.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},O.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},O.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},O.once=O.partial(O.before,2);var k=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];O.keys=function(e){if(!O.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)O.has(e,n)&&t.push(n);return k&&a(e,t),t},O.allKeys=function(e){if(!O.isObject(e))return[];var t=[];for(var n in e)t.push(n);return k&&a(e,t),t},O.values=function(e){for(var t=O.keys(e),n=t.length,r=Array(n),o=0;o":">",'"':""","'":"'","`":"`"},U=O.invert(D),W=function(e){var t=function(t){return e[t]},n="(?:"+O.keys(e).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(o,t):e}};O.escape=W(D),O.unescape=W(U),O.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),O.isFunction(r)?r.call(e):r};var L=0;O.uniqueId=function(e){var t=++L+"";return e?e+t:t},O.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,z=function(e){return"\\"+H[e]};O.template=function(e,t,n){!t&&n&&(t=n),t=O.defaults({},t,O.templateSettings);var r=RegExp([(t.escape||G).source,(t.interpolate||G).source,(t.evaluate||G).source].join("|")+"|$","g"),o=0,i="__p+='";e.replace(r,function(t,n,r,s,a){return i+=e.slice(o,a).replace(P,z),o=a+t.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var s=new Function(t.variable||"obj","_",i)}catch(e){throw e.source=i,e}var a=function(e){return s.call(this,e,O)};return a.source="function("+(t.variable||"obj")+"){\n"+i+"}",a},O.chain=function(e){var t=O(e);return t._chain=!0,t};var J=function(e,t){return e._chain?O(t).chain():t};O.mixin=function(e){O.each(O.functions(e),function(t){var n=O[t]=e[t];O.prototype[t]=function(){var e=[this._wrapped];return f.apply(e,arguments),J(this,n.apply(O,e))}})},O.mixin(O),O.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=p[e];O.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],J(this,n)}}),O.each(["concat","join","slice"],function(e){var t=p[e];O.prototype[e]=function(){return J(this,t.apply(this._wrapped,arguments))}}),O.prototype.value=function(){return this._wrapped},O.prototype.valueOf=O.prototype.toJSON=O.prototype.value,O.prototype.toString=function(){return""+this._wrapped},r=[],void 0!==(o=function(){return O}.apply(t,r))&&(e.exports=o)}).call(this)}])}); -//# sourceMappingURL=websdk-1.4.11.min.js.map +//# sourceMappingURL=websdk-1.4.12.min.js.map diff --git a/sdk/dist/websdk-1.4.12.min.js.map b/sdk/dist/websdk-1.4.12.min.js.map new file mode 100644 index 00000000..9b988fed --- /dev/null +++ b/sdk/dist/websdk-1.4.12.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["websdk-1.4.12.js"],"names":["_typeof","Symbol","iterator","obj","constructor","prototype","root","factory","exports","module","define","amd","undefined","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_parsePrivacy","iq","list","items","getElementsByTagName","i","length","item","jid","getAttribute","order","type","n","_parseNameFromJidFn","name","_parseGroupBlacklist","affiliation","nick","_setText","valueDom","v","textContent","text","logMessage","message","WebIM","config","isDebug","console","log","utils","ts","data","_version","_code","code","_utils","_msg","_message","_msgHash","Queue","CryptoJS","_","stropheConn","window","URL","webkitURL","mozURL","msURL","XDomainRequest","Strophe","Request","_newXHR","xhr","xmlrequest","overrideMimeType","onreadystatechange","this","func","bind","Websocket","_closeSocket","socket","me","setTimeout","close","e","_onMessage","indexOf","start","end","substring","setJid","elem","DOMParser","parseFromString","documentElement","see_uri","_conn","_changeConnectStatus","Status","REDIRECT","reset","service","_connect","_doDisconnect","search","_handleStreamStart","_streamWrap","_check_streamerror","ERROR","disconnecting","firstChild","nodeName","xmlInput","rawInput","serialize","_dataRecv","_listenNetwork","onlineCallback","offlineCallback","addEventListener","attachEvent","document","body","_parseRoom","result","rooms","roomJid","tmp","split","room","roomId","push","_parseRoomOccupants","occupants","_parseResponseMessage","msginfo","parseMsgData","errorMsg","msgBodies","msgBody","childNodes","childNode","nodeType","ElementType","TEXT","jsondata","wholeText","nodeValue","replace","eval","delayTags","delayTag","delayMsgTime","delayTimeStamp","childrens","child","domain","tempstr","findex","atindex","_parseFriend","queryTag","conn","from","rouster","subscription","friend","ask","groups","forEachChild","group","getText","subscribe","toJid","subscribed","_login","options","accessToken","access_token","stringify","onError","WEBIM_CONNCTION_OPEN_USERGRID_ERROR","context","accessTokenExpires","expires_in","isOpening","isOpened","getStrophe","callback","status","msg","_loginCallback","route","connect","wait","hold","_parseMessageType","receiveinfo","inviteinfo","deliveryinfo","acked","error","msgtype","namespaceURI","errorItem","userMuted","_handleMessageQueue","hasOwnProperty","send","conflict","CONNFAIL","WEBIM_CONNCTION_SERVER_CLOSE_ERROR","reconnect","ATTACHED","CONNECTED","autoReconnectNumTotal","intervalId","setInterval","handelSendQueue","handleMessage","delivery","handleDeliveredMessage","handleAckedMessage","handleReceivedMessage","handleInviteMessage","handleMutedMessage","handlePresence","handlePing","handleIqRoster","handleIqPrivacy","handleIq","addHandler","registerConfrIQHandler","STATUS_OPENED","supportRecMessage","WEBIM_MESSAGE_REC_TEXT","WEBIM_MESSAGE_REC_EMOJI","isCanDownLoadFile","WEBIM_MESSAGE_REC_PHOTO","WEBIM_MESSAGE_REC_AUDIO_FILE","supportSedMessage","WEBIM_MESSAGE_SED_TEXT","isCanUploadFile","notifyVersion","retry","heartBeat","isAutoLogin","setPresence","unSendMsgArr","dom","sendCommand","offLineSendConnecting","logOut","onOpened","canReceive","canSend","DISCONNECTING","stopHeartBeat","STATUS_CLOSING","DISCONNECTED","autoReconnectNumMax","WEBIM_CONNCTION_DISCONNECTED","STATUS_CLOSED","clear","onClosed","AUTHFAIL","WEBIM_CONNCTION_AUTH_ERROR","STATUS_ERROR","WEBIM_CONNCTION_SERVER_ERROR","status_now","_getJid","appKey","to","resource","_getJidByName","_validCheck","user","WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR","devInfos","WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR","orgName","appName","toLowerCase","isMultiLoginSessions","Date","getTime","Math","floor","random","toFixed","userId","_getXmppUrl","baseUrl","https","test","url","prefix","base","suffix","isSupportWss","WebSocket","connection","isHttpDNS","location","protocol","inactivity","heartBeatWait","maxRetries","pollingTime","autoReconnectInterval","STATUS_INIT","sendQueue","apiUrl","isWindowSDK","encrypt","token","dnsArr","dnsIndex","dnsTotal","restHosts","restIndex","restTotal","xmppHosts","xmppIndex","xmppTotal","groupOption","testInit","registerUser","getHttpDNS","signup","pop","sendReceiptsMessage","listen","emptyfn","onTextMessage","onEmojiMessage","onPictureMessage","onAudioMessage","onVideoMessage","onFileMessage","onLocationMessage","onCmdMessage","onPresence","onRoster","onReceivedMessage","onInviteMessage","onDeliverdMessage","onDeliveredMessage","onReadMessage","onMutedMessage","onOffline","onOnline","onConfirmPop","onCreateGroup","onUpdateMyGroupList","onUpdateMyRoster","onBlacklistUpdate","forcing","isNeed","navigator","userAgent","heartBeatID","ping","clearInterval","$msg","xmlns","tree","cacheReceiptsMessage","host","getXmlFirstChild","ip","port","parter","Connection","getHostsByTag","tagName","tag","hosts","getRestFromHttpDNS","login","self","suc","res","options2","dataType","app_key","encodeURIComponent","success","ajax","EMPTYFN","err","restUrl","userjson","username","password","nickname","userinfo","open","appkey","xmppURL","restTokenData","pwd","STATUS_DOLOGIN_IM","error_description","WEBIM_CONNCTION_OPEN_ERROR","STATUS_DOLOGIN_USERGRID","loginJson","grant_type","timestamp","loginfo","attach","WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR","sid","WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR","rid","WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR","wind","reason","isClosed","isClosing","disconnect","handler","ns","fail","getJid","$iq","t","up","failFn","ele","WEBIM_CONNCTION_NOTIFYVERSION_ERROR","sendIQ","presence_type","fromUser","toUser","isCreate","isMemberJoin","isDecline","isApply","info","fromJid","chatroom","showTags","showTag","show","statusTags","statusTag","priorityTags","priorityTag","priority","destroy","members","member","role","kickedMember","actor","actorNick","kicked","x","apply","accept","decline","addAdmin","removeAdmin","addMute","removeMute","toNick","groupJid","gid","mid","roomtype","owner","original_type","slice","lastIndexOf","getBlacklist","curJid","iqresult","errorCode","errorText","errorBool","textDOM","msgDatas","too","extmsg","ext","chattype","typeEl","bodies","receiveMsg","atob","key","enc","Utf8","parse","iv","mode","option","CBC","padding","pad","Pkcs7","ECB","encryptedBase64Str","decryptedData","AES","decrypt","decryptedStr","toString","emojibody","parseTextMessage","Emoji","isemoji","delay","rwidth","rheight","size","width","height","substr","secret","filename","thumb","thumb_secret","file_length","filetype","addr","lat","lng","action","msgId","getUniqueId","bodyId","deliverMessage","set","WEBIM_CONNCTION_CALLBACK_INNER_ERROR","isNaN","innerHTML","received","rcv","innerText","Function","form","invitemsg","reasonDom","reasonMsg","xmsg","roomid","roomjid","autoIncrement","cdate","offdate","offset","hexd","parseFloat","messageSource","clone","btoa","encryptedData","doQuery","encodeURI","chatType","response","WEBIM_MESSAGE_SED_ERROR","Object","addRoster","removeRoster","getRoster","completeFn","WEBIM_CONNCTION_GETROSTER_ERROR","pres","$pres","unsubscribe","unsubscribed","joinPublicGroup","room_nick","errorFn","WEBIM_CONNCTION_JOINROOM_ERROR","NS","MUC","listRooms","server","DISCO_ITEMS","WEBIM_CONNCTION_GETROOM_ERROR","queryRoomMember","mem","WEBIM_CONNCTION_GETROOMMEMBER_ERROR","queryRoomInfo","DISCO_INFO","settings","features","fields","fieldValues","field","fieldVar","fieldSimplify","WEBIM_CONNCTION_GETROOMINFO_ERROR","queryRoomOccupants","WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR","attrs","setUserSig","desc","getPresence","WEBIM_CONNCTION_PING_ERROR","errorType","WEBIM_CONNCTION_CLIENT_LOGOUT","getChatRooms","isCanSetRequestHeader","WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR","WEBIM_CONNCTION_LOAD_CHATROOM_ERROR","pageInfo","pagenum","parseInt","pagesize","opts","headers","Authorization","joinChatRoom","WEBIM_CONNCTION_JOINCHATROOM_ERROR","quitChatRoom","WEBIM_CONNCTION_QUITCHATROOM_ERROR","_onReceiveInviteFromGroup","title","group_id","agree","WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP","reject","WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP","_onReceiveInviteAcceptionFromGroup","_onReceiveInviteDeclineFromGroup","_onAutoAcceptInvitationFromGroup","group_name","_onLeaveGroup","_onReceiveJoinGroupApplication","WEBIM_CONNECTION_ACCEPT_JOIN_GROUP","WEBIM_CONNECTION_DECLINE_JOIN_GROUP","_onReceiveAcceptionFromGroup","_onReceiveRejectionFromGroup","_onUpdateMyGroupList","_onUpdateMyRoster","that","closed","WEBIM_CONNECTION_CLOSED","sucFn","errFn","addToBlackList","blacklist","piece","keys","len","value","removeFromBlackList","_getGroupJid","addToGroupBlackList","getGroupBlacklist","removeGroupMemberFromBlacklist","changeGroupSubject","var","subject","description","destroyGroup","leaveGroupBySelf","msgInfo","errInfo","leaveGroup","addGroupMembers","acceptInviteFromGroup","rejectInviteFromGroup","createGroupAsync","toRoom","setAttribute","optionsMaxUsers","optionsPublic","optionsMembersOnly","optionsModerate","optionsAllowInvites","cnode","createGroup","createGroupNew","opt","JSON","Content-Type","respData","blockGroup","groupId","entities","joinGroup","listGroups","requestData","limit","cursor","getGroupInfo","getGroup","listGroupMember","pageNum","pageSize","mute","usernames","mute_duration","muteDuration","getGroupAdmin","getMuted","setAdmin","newadmin","agreeJoinGroup","applicant","verifyResult","rejectJoinGroup","groupBlockSingle","groupBlockMulti","removeGroupBlockSingle","removeGroupBlockMulti","join","dissolveGroup","getGroupBlacklistNew","quitGroup","modifyGroup","groupname","groupName","removeSingleGroupMember","removeMultiGroupMember","users","inviteToGroup","statusCode","str","cefQuery","request","persistent","onSuccess","onFailure","rawOutput","isSandBox","apiURL","WEBIM_CONNCTION_ATTACH_ERROR","WEBIM_CONNCTION_ATTACH_USERGRID_ERROR","WEBIM_CONNCTION_REOPEN_ERROR","WEBIM_CONNCTION_IQ_ERROR","WEBIM_CONNCTION_CROSSDOMAIN_ERROR","WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES","WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR","WEBIM_CONNCTION_AJAX_ERROR","WEBIM_CONNCTION_CLIENT_OFFLINE","WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR","WEBIM_UPLOADFILE_BROWSER_ERROR","WEBIM_UPLOADFILE_ERROR","WEBIM_UPLOADFILE_NO_LOGIN","WEBIM_UPLOADFILE_NO_FILE","WEBIM_DOWNLOADFILE_ERROR","WEBIM_DOWNLOADFILE_NO_LOGIN","WEBIM_DOWNLOADFILE_BROWSER_ERROR","WEBIM_MESSAGE_REC_TEXT_ERROR","WEBIM_MESSAGE_REC_EMOTION","WEBIM_MESSAGE_REC_AUDIO","WEBIM_MESSAGE_REC_VEDIO","WEBIM_MESSAGE_REC_VEDIO_FILE","WEBIM_MESSAGE_REC_FILE","WEBIM_MESSAGE_SED_EMOTION","WEBIM_MESSAGE_SED_PHOTO","WEBIM_MESSAGE_SED_AUDIO","WEBIM_MESSAGE_SED_AUDIO_FILE","WEBIM_MESSAGE_SED_VEDIO","WEBIM_MESSAGE_SED_VEDIO_FILE","WEBIM_MESSAGE_SED_FILE","_createStandardXHR","XMLHttpRequest","_createActiveXHR","ActiveXObject","_xmlrequest","crossDomain","temp","readyState","onload","xmlDoc","async","loadXML","responseText","responseXML","ontimeout","onerror","_hasFlash","ex","plugins","_tmpUtilXHR","_hasFormData","FormData","_hasBlob","Blob","_isCanSetRequestHeader","setRequestHeader","_hasOverrideMimeType","_isCanUploadFileAsync","_isCanUploadFile","_isCanDownLoadFile","hasDontEnumBug","propertyIsEnumerable","dontEnums","dontEnumsLength","TypeError","prop","hasFormData","hasBlob","hasOverrideMimeType","isCanUploadFileAsync","notSupportList","ua","l","getIEVersion","matches","tridentMap","4","5","6","7","match","json","s","arr","iterate","isArr","o","getFileUrl","fileInputId","uri","fileObj","getElementById","createObjectURL","fileItems","files","u","pos1","pos2","pos","max","index","getFileSize","file","fileSize","getFileLength","kb","round","mb","gb","fileLength","select","fileobject","GetFile","Size","hasFlash","trim","parseEmoji","map","emoji","face","path","parseLink","reg","parseJSON","requireNonComma","depth","comma","parseUploadResponse","parseDownloadResponse","uploadFile","onFileUploadProgress","onFileUploadComplete","onFileUploadError","onFileUploadCanceled","acc","uploadUrl","flashUpload","upload","abort","formData","append","download","onFileDownloadComplete","onFileDownloadError","method","resType","responseType","mimeType","innerHeaer","X-Requested-With","Accept","share-secret","faces","emessage","expr","tmsg","existEmoji","emojiStr","restMsgIndex","parseUri","pattern","args","eq","parseHrefHash","hash","children","tempData","d","Hours","getHours","Minutes","getMinutes","Seconds","getSeconds","Milliseconds","getMilliseconds","getObjectKey","val","sprintf","arg","arguments","setCookie","days","cookie","getCookie","allCookie","all","decodeURIComponent","Message","setGroup","read","ackId","txt","roomType","cmd","img","uploadError","uploadComplete","audio","video","_Message","_send","weichat","originType","jsonstr","_tmpComplete","_complete","file_len","thumbnail","undef","create","F","subtype","C","C_lib","lib","Base","extend","overrides","mixIn","init","$super","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","concat","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","thatByte","ceil","nBytes","rcache","_r","m_w","m_z","mask","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","String","fromCharCode","latin1Str","latin1StrLength","charCodeAt","escape","Error","utf8Str","unescape","BufferedBlockAlgorithm","_data","_nDataBytes","_append","_process","doFlush","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","_minBufferSize","nWordsReady","nBytesReady","min","_doProcessBlock","processedWords","splice","C_algo","Hasher","cfg","_doReset","update","messageUpdate","finalize","_doFinalize","_createHelper","hasher","_createHmacHelper","HMAC","algo","X32WordArray","C_x64","x64","Word","high","low","toX32","x64Words","x64WordsLength","x32Words","x64Word","wordsLength","ArrayBuffer","superInit","typedArray","Uint8Array","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","buffer","byteOffset","byteLength","typedArrayByteLength","swapEndian","word","Utf16","Utf16BE","utf16Chars","codePoint","utf16Str","utf16StrLength","Utf16LE","parseLoop","base64Str","base64StrLength","reverseMap","bits1","bits2","Base64","_map","base64Chars","byte1","byte2","byte3","triplet","j","charAt","paddingChar","_reverseMap","paddingIndex","FF","a","b","GG","HH","II","T","abs","sin","MD5","_hash","M","offset_i","M_offset_i","H","M_offset_0","M_offset_1","M_offset_2","M_offset_3","M_offset_4","M_offset_5","M_offset_6","M_offset_7","M_offset_8","M_offset_9","M_offset_10","M_offset_11","M_offset_12","M_offset_13","M_offset_14","M_offset_15","nBitsTotal","nBitsLeft","nBitsTotalH","nBitsTotalL","H_i","HmacMD5","W","SHA1","HmacSHA1","K","getFractionalBits","nPrime","sqrtN","sqrt","factor","pow","SHA256","f","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","HmacSHA256","SHA224","HmacSHA224","X64Word_create","X64Word","X64WordArray","SHA512","H0","H1","H2","H3","H4","H5","H6","H7","H0h","H0l","H1h","H1l","H2h","H2l","H3h","H3l","H4h","H4l","H5h","H5l","H6h","H6l","H7h","H7l","ah","al","bh","bl","cl","dh","dl","eh","el","fh","fl","gh","gl","hh","hl","Wi","Wih","Wil","gamma0xh","gamma0xl","gamma0h","gamma0l","gamma1xh","gamma1xl","gamma1h","gamma1l","Wi7","Wi7h","Wi7l","Wi16","Wi16h","Wi16l","chh","chl","majh","majl","sigma0h","sigma0l","sigma1h","sigma1l","Ki","Kih","Kil","t1l","t1h","t2l","t2h","HmacSHA512","SHA384","HmacSHA384","RHO_OFFSETS","PI_INDEXES","ROUND_CONSTANTS","y","newX","newY","LFSR","roundConstantMsw","roundConstantLsw","bitPosition","SHA3","outputLength","state","_state","nBlockSizeLanes","M2i","M2i1","lane","tMsw","tLsw","Tx","Tx4","Tx1","Tx1Msw","Tx1Lsw","laneIndex","laneMsw","laneLsw","rhoOffset","TPiLane","T0","state0","TLane","Tx1Lane","Tx2Lane","roundConstant","blockSizeBits","outputLengthBytes","outputLengthLanes","hashWords","HmacSHA3","f1","z","f2","f3","f4","f5","rotl","_zl","_zr","_sl","_sr","_hl","_hr","RIPEMD160","ar","br","cr","dr","er","hr","zl","zr","sl","sr","HmacRIPEMD160","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","PBKDF2","keySize","iterations","compute","salt","hmac","derivedKey","blockIndex","derivedKeyWords","blockIndexWords","block","blockWords","blockWordsLength","intermediate","intermediateWords","EvpKDF","Cipher","createEncryptor","_ENC_XFORM_MODE","createDecryptor","_DEC_XFORM_MODE","xformMode","_xformMode","_key","process","dataUpdate","ivSize","selectCipherStrategy","PasswordBasedCipher","SerializableCipher","cipher","ciphertext","C_mode","StreamCipher","BlockCipherMode","Encryptor","Decryptor","_cipher","_iv","xorBlock","_prevBlock","processBlock","encryptBlock","thisBlock","decryptBlock","C_pad","nPaddingBytes","paddingWord","paddingWords","unpad","CipherParams","BlockCipher","modeCreator","_mode","__creator","finalProcessedBlocks","cipherParams","formatter","C_format","format","OpenSSLFormatter","OpenSSL","openSSLStr","ciphertextWords","encryptor","cipherCfg","algorithm","_parse","C_kdf","kdf","OpenSSLKdf","execute","derivedParams","CFB","generateKeystreamAndEncrypt","keystream","CTR","counter","_counter","CTRGladman","incWord","b1","b2","b3","incCounter","OFB","_keystream","AnsiX923","lastBytePos","Ansix923","Iso10126","Iso97971","ZeroPadding","NoPadding","input","SBOX","INV_SBOX","SUB_MIX_0","SUB_MIX_1","SUB_MIX_2","SUB_MIX_3","INV_SUB_MIX_0","INV_SUB_MIX_1","INV_SUB_MIX_2","INV_SUB_MIX_3","xi","sx","x2","x4","x8","RCON","_nRounds","_keyPriorReset","keyWords","nRounds","ksRows","keySchedule","_keySchedule","ksRow","invKeySchedule","_invKeySchedule","invKsRow","_doCryptBlock","s0","s1","s2","s3","t0","t3","exchangeLR","_lBlock","_rBlock","exchangeRL","PC1","PC2","BIT_SHIFTS","SBOX_P","0","268435456","536870912","805306368","1073741824","1342177280","1610612736","1879048192","2147483648","2415919104","2684354560","2952790016","3221225472","3489660928","3758096384","4026531840","134217728","402653184","671088640","939524096","1207959552","1476395008","1744830464","2013265920","2281701376","2550136832","2818572288","3087007744","3355443200","3623878656","3892314112","4160749568","1","268435457","536870913","805306369","1073741825","1342177281","1610612737","1879048193","2147483649","2415919105","2684354561","2952790017","3221225473","3489660929","3758096385","4026531841","134217729","402653185","671088641","939524097","1207959553","1476395009","1744830465","2013265921","2281701377","2550136833","2818572289","3087007745","3355443201","3623878657","3892314113","4160749569","16777216","33554432","50331648","67108864","83886080","100663296","117440512","150994944","167772160","184549376","201326592","218103808","234881024","251658240","8388608","25165824","41943040","58720256","75497472","92274688","109051904","125829120","142606336","159383552","176160768","192937984","209715200","226492416","243269632","260046848","285212672","301989888","318767104","335544320","352321536","369098752","385875968","419430400","436207616","452984832","469762048","486539264","503316480","520093696","276824064","293601280","310378496","327155712","343932928","360710144","377487360","394264576","411041792","427819008","444596224","461373440","478150656","494927872","511705088","528482304","1048576","2097152","3145728","4194304","5242880","6291456","7340032","9437184","10485760","11534336","12582912","13631488","14680064","15728640","524288","1572864","2621440","3670016","4718592","5767168","6815744","7864320","8912896","9961472","11010048","12058624","13107200","14155776","15204352","16252928","17825792","18874368","19922944","20971520","22020096","23068672","24117248","26214400","27262976","28311552","29360128","30408704","31457280","32505856","17301504","18350080","19398656","20447232","21495808","22544384","23592960","24641536","25690112","26738688","27787264","28835840","29884416","30932992","31981568","33030144","65536","131072","196608","262144","327680","393216","458752","589824","655360","720896","786432","851968","917504","983040","32768","98304","163840","229376","294912","360448","425984","491520","557056","622592","688128","753664","819200","884736","950272","1015808","1114112","1179648","1245184","1310720","1376256","1441792","1507328","1638400","1703936","1769472","1835008","1900544","1966080","2031616","1081344","1146880","1212416","1277952","1343488","1409024","1474560","1540096","1605632","1671168","1736704","1802240","1867776","1933312","1998848","2064384","4096","8192","12288","16384","20480","24576","28672","36864","40960","45056","49152","53248","57344","61440","2048","6144","10240","14336","18432","22528","26624","30720","34816","38912","43008","47104","51200","55296","59392","63488","69632","73728","77824","81920","86016","90112","94208","102400","106496","110592","114688","118784","122880","126976","67584","71680","75776","79872","83968","88064","92160","96256","100352","104448","108544","112640","116736","120832","124928","129024","256","512","768","1024","1280","1536","1792","2304","2560","2816","3072","3328","3584","3840","128","384","640","896","1152","1408","1664","1920","2176","2432","2688","2944","3200","3456","3712","3968","4352","4608","4864","5120","5376","5632","5888","6400","6656","6912","7168","7424","7680","7936","4224","4480","4736","4992","5248","5504","5760","6016","6272","6528","6784","7040","7296","7552","7808","8064","16","32","48","64","80","96","112","144","160","176","192","208","224","240","8","24","40","56","72","88","104","120","136","152","168","184","200","216","232","248","272","288","304","320","336","352","368","400","416","432","448","464","480","496","264","280","296","312","328","344","360","376","392","408","424","440","456","472","488","504","2","3","9","10","11","12","13","14","15","2147483650","2147483651","2147483652","2147483653","2147483654","2147483655","2147483656","2147483657","2147483658","2147483659","2147483660","2147483661","2147483662","2147483663","17","18","19","20","21","22","23","25","26","27","28","29","30","31","2147483664","2147483665","2147483666","2147483667","2147483668","2147483669","2147483670","2147483671","2147483672","2147483673","2147483674","2147483675","2147483676","2147483677","2147483678","2147483679","SBOX_MASK","DES","keyBits","keyBitPos","subKeys","_subKeys","nSubKey","subKey","bitShift","invSubKeys","_invSubKeys","lBlock","rBlock","TripleDES","_des1","_des2","_des3","generateKeystreamWord","S","_S","_i","_j","keystreamWord","RC4","keySigBytes","keyByteIndex","keyByte","RC4Drop","drop","nextState","X","_X","_C","C_","_b","gx","ga","G","Rabbit","IV","IV_0","IV_1","i0","i2","i1","i3","RabbitLegacy","Array_h","array","Array","at","remove","count","separator","_array_h","_index","ret","head","tail","empty","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","createReduce","dir","iteratee","memo","currentKey","optimizeCb","isArrayLike","createPredicateIndexFinder","predicate","cb","getLength","createIndexFinder","predicateFind","sortedIndex","idx","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","proto","isFunction","ObjProto","has","contains","previousUnderscore","ArrayProto","FuncProto","nativeIsArray","isArray","nativeKeys","nativeBind","nativeCreate","Ctor","_wrapped","VERSION","argCount","other","collection","accumulator","identity","isObject","matcher","property","Infinity","createAssigner","keysFunc","undefinedOnly","source","baseCreate","MAX_ARRAY_INDEX","each","forEach","collect","results","reduce","foldl","inject","reduceRight","foldr","find","detect","findIndex","findKey","filter","negate","every","some","any","includes","include","fromIndex","guard","values","invoke","isFunc","pluck","where","findWhere","computed","lastComputed","shuffle","rand","shuffled","sample","sortBy","criteria","sort","left","right","behavior","groupBy","indexBy","countBy","toArray","partition","pass","first","take","initial","last","rest","compact","flatten","shallow","strict","startIndex","output","isArguments","without","difference","uniq","unique","isSorted","isBoolean","seen","union","intersection","argsLength","zip","unzip","object","findLastIndex","range","stop","step","executeBound","sourceFunc","boundFunc","callingContext","bound","partial","boundArgs","position","bindAll","memoize","cache","address","defer","throttle","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","callNow","wrap","wrapper","compose","after","times","before","once","hasEnumBug","allKeys","mapObject","pairs","invert","functions","methods","names","extendOwn","assign","pick","oiteratee","omit","defaults","props","tap","interceptor","isMatch","aStack","bStack","className","areArrays","aCtor","bCtor","isEqual","isEmpty","isString","isElement","isFinite","isNumber","isNull","isUndefined","noConflict","constant","noop","propertyOf","accum","escapeMap","&","<",">","\"","'","`","unescapeMap","createEscaper","escaper","testRegexp","RegExp","replaceRegexp","string","fallback","idCounter","uniqueId","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","
","
","escapeChar","template","oldSettings","variable","render","chain","_chain","mixin","valueOf","toJSON"],"mappings":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,KAEtQ,SAA2CG,EAAMC,GAC0B,YAAlD,mBAAZC,SAA0B,YAAcR,QAAQQ,WAA8F,YAAjD,mBAAXC,QAAyB,YAAcT,QAAQS,SAAuBA,OAAOD,QAAUD,IAAqC,kBAAXG,SAAyBA,OAAOC,IAAKD,UAAWH,GAAwF,YAAlD,mBAAZC,SAA0B,YAAcR,QAAQQ,UAAwBA,QAAe,MAAID,IAAeD,EAAY,MAAIC,SACjZK,GAAW,WACb,MAAgB,UAAUC,GAMhB,QAASC,GAAoBC,GAG5B,GAAIC,EAAiBD,GACpB,MAAOC,GAAiBD,GAAUP,OAGnC,IAAIC,GAASO,EAAiBD,IAC7BP,WACAS,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOS,QAAS,EAGTT,EAAOD,QAvBf,GAAIQ,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAM/B,SAAUL,EAAQD,EAASM,GAE/BL,EAAOD,QAAUM,EAAoB,IAKjC,SAAUL,OAAQD,QAASM,qBAuyF/B,QAASS,eAAcC,GACtB,GAAIC,MACAC,EAAQF,EAAGG,qBAAqB,OAEpC,IAAID,EACH,IAAK,GAAIE,GAAI,EAAGA,EAAIF,EAAMG,OAAQD,IAAK,CACtC,GAAIE,GAAOJ,EAAME,GACbG,EAAMD,EAAKE,aAAa,SACxBC,EAAQH,EAAKE,aAAa,SAC1B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,UAAU0oB,MAAQ,WACnB,MAAO/jB,MAAK24D,UAKb15D,EAAE5D,UAAU0pE,QAAU9lE,EAAE5D,UAAU2pE,OAAS/lE,EAAE5D,UAAU0oB,MAEvD9kB,EAAE5D,UAAU4f,SAAW,WACtB,MAAO,GAAKjb,KAAK24D,UAWflC,SAEgF76D,MAF7C86D,EAAgC,WACpE,MAAOz3D,IACN+Y,MAAMxc,EAASi7D,MAA+Eh7D,EAAOD,QAAUk7D,KAEhHv6D,KAAK6D","file":"websdk-1.4.12.min.js","sourcesContent":["'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && (typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') exports[\"WebIM\"] = factory();else root[\"WebIM\"] = factory();\n})(undefined, function () {\n\treturn (/******/function (modules) {\n\t\t\t// webpackBootstrap\n\t\t\t/******/ // The module cache\n\t\t\t/******/var installedModules = {};\n\n\t\t\t/******/ // The require function\n\t\t\t/******/function __webpack_require__(moduleId) {\n\n\t\t\t\t/******/ // Check if module is in cache\n\t\t\t\t/******/if (installedModules[moduleId])\n\t\t\t\t\t/******/return installedModules[moduleId].exports;\n\n\t\t\t\t/******/ // Create a new module (and put it into the cache)\n\t\t\t\t/******/var module = installedModules[moduleId] = {\n\t\t\t\t\t/******/exports: {},\n\t\t\t\t\t/******/id: moduleId,\n\t\t\t\t\t/******/loaded: false\n\t\t\t\t\t/******/ };\n\n\t\t\t\t/******/ // Execute the module function\n\t\t\t\t/******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t\t\t\t/******/ // Flag the module as loaded\n\t\t\t\t/******/module.loaded = true;\n\n\t\t\t\t/******/ // Return the exports of the module\n\t\t\t\t/******/return module.exports;\n\t\t\t\t/******/\n\t\t\t}\n\n\t\t\t/******/ // expose the modules object (__webpack_modules__)\n\t\t\t/******/__webpack_require__.m = modules;\n\n\t\t\t/******/ // expose the module cache\n\t\t\t/******/__webpack_require__.c = installedModules;\n\n\t\t\t/******/ // __webpack_public_path__\n\t\t\t/******/__webpack_require__.p = \"\";\n\n\t\t\t/******/ // Load entry module and return exports\n\t\t\t/******/return __webpack_require__(0);\n\t\t\t/******/\n\t\t}(\n\t\t/************************************************************************/\n\t\t/******/[\n\t\t/* 0 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tmodule.exports = __webpack_require__(1\n\n\t\t\t/***/);\n\t\t},\n\t\t/* 1 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar _version = '1.4.2';\n\t\t\tvar _code = __webpack_require__(2).code;\n\t\t\tvar _utils = __webpack_require__(3).utils;\n\t\t\tvar _msg = __webpack_require__(4);\n\t\t\tvar _message = _msg._msg;\n\t\t\tvar _msgHash = {};\n\t\t\tvar Queue = __webpack_require__(39).Queue;\n\t\t\tvar CryptoJS = __webpack_require__(5);\n\t\t\tvar _ = __webpack_require__(40);\n\t\t\tvar stropheConn = null;\n\n\t\t\twindow.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;\n\n\t\t\tif (window.XDomainRequest) {\n\t\t\t\t// not support ie8 send is not a function , canot \n\t\t\t\t// case send is object, doesn't has a attr of call\n\t\t\t\t// XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send;\n\t\t\t\t// XDomainRequest.prototype.send = function () {\n\t\t\t\t// XDomainRequest.prototype.oldsend.call(this, arguments);\n\t\t\t\t// this.readyState = 2;\n\t\t\t\t// };\n\t\t\t}\n\n\t\t\tStrophe.Request.prototype._newXHR = function () {\n\t\t\t\tvar xhr = _utils.xmlrequest(true);\n\t\t\t\tif (xhr.overrideMimeType) {\n\t\t\t\t\txhr.overrideMimeType('text/xml');\n\t\t\t\t}\n\t\t\t\t// use Function.bind() to prepend ourselves as an argument\n\t\t\t\txhr.onreadystatechange = this.func.bind(null, this);\n\t\t\t\treturn xhr;\n\t\t\t};\n\n\t\t\tStrophe.Websocket.prototype._closeSocket = function () {\n\t\t\t\tif (this.socket) {\n\t\t\t\t\tvar me = this;\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tme.socket.close();\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}, 0);\n\t\t\t\t} else {\n\t\t\t\t\tthis.socket = null;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n *\n * Strophe.Websocket has a bug while logout:\n * 1.send: is ok;\n * 2.send: will cause a problem,log as follows:\n * WebSocket connection to 'ws://im-api.easemob.com/ws/' failed: Data frame received after close_connect @ strophe.js:5292connect @ strophe.js:2491_login @ websdk-1.1.2.js:278suc @ websdk-1.1.2.js:636xhr.onreadystatechange @ websdk-1.1.2.js:2582\n * 3 \"Websocket error [object Event]\"\n * _changeConnectStatus\n * onError Object {type: 7, msg: \"The WebSocket connection could not be established or was disconnected.\", reconnect: true}\n *\n * this will trigger socket.onError, therefore _doDisconnect again.\n * Fix it by overide _onMessage\n */\n\t\t\tStrophe.Websocket.prototype._onMessage = function (message) {\n\t\t\t\tlogMessage(message\n\t\t\t\t// 获取Resource\n\t\t\t\t);var data = message.data;\n\t\t\t\tif (data.indexOf('') > 0) {\n\t\t\t\t\tvar start = data.indexOf(''),\n\t\t\t\t\t end = data.indexOf(''),\n\t\t\t\t\t data = data.substring(start + 5, end);\n\t\t\t\t\tstropheConn.setJid(data);\n\t\t\t\t}\n\n\t\t\t\tvar elem, data;\n\t\t\t\t// check for closing stream\n\t\t\t\t// var close = '';\n\t\t\t\t// if (message.data === close) {\n\t\t\t\t// this._conn.rawInput(close);\n\t\t\t\t// this._conn.xmlInput(message);\n\t\t\t\t// if (!this._conn.disconnecting) {\n\t\t\t\t// this._conn._doDisconnect();\n\t\t\t\t// }\n\t\t\t\t// return;\n\t\t\t\t//\n\t\t\t\t// send and receive close xml: \n\t\t\t\t// so we can't judge whether message.data equals close by === simply.\n\t\t\t\tif (message.data.indexOf(\" from server\");\n\t\t\t\t\t\t// }\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t} else if (message.data.search(\" tag before we close the connection\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._conn._dataRecv(elem, message.data);\n\t\t\t};\n\n\t\t\tvar _listenNetwork = function _listenNetwork(onlineCallback, offlineCallback) {\n\n\t\t\t\tif (window.addEventListener) {\n\t\t\t\t\twindow.addEventListener('online', onlineCallback);\n\t\t\t\t\twindow.addEventListener('offline', offlineCallback);\n\t\t\t\t} else if (window.attachEvent) {\n\t\t\t\t\tif (document.body) {\n\t\t\t\t\t\tdocument.body.attachEvent('ononline', onlineCallback);\n\t\t\t\t\t\tdocument.body.attachEvent('onoffline', offlineCallback);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.attachEvent('load', function () {\n\t\t\t\t\t\t\tdocument.body.attachEvent('ononline', onlineCallback);\n\t\t\t\t\t\t\tdocument.body.attachEvent('onoffline', offlineCallback);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/*var onlineTmp = window.ononline;\n var offlineTmp = window.onoffline;\n window.attachEvent('ononline', function () {\n try {\n typeof onlineTmp === 'function' && onlineTmp();\n } catch ( e ) {}\n onlineCallback();\n });\n window.attachEvent('onoffline', function () {\n try {\n typeof offlineTmp === 'function' && offlineTmp();\n } catch ( e ) {}\n offlineCallback();\n });*/\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _parseRoom = function _parseRoom(result) {\n\t\t\t\tvar rooms = [];\n\t\t\t\tvar items = result.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar roomJid = item.getAttribute('jid');\n\t\t\t\t\t\tvar tmp = roomJid.split('@')[0];\n\t\t\t\t\t\tvar room = {\n\t\t\t\t\t\t\tjid: roomJid,\n\t\t\t\t\t\t\tname: item.getAttribute('name'),\n\t\t\t\t\t\t\troomId: tmp.split('_')[1]\n\t\t\t\t\t\t};\n\t\t\t\t\t\trooms.push(room);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rooms;\n\t\t\t};\n\n\t\t\tvar _parseRoomOccupants = function _parseRoomOccupants(result) {\n\t\t\t\tvar occupants = [];\n\t\t\t\tvar items = result.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar room = {\n\t\t\t\t\t\t\tjid: item.getAttribute('jid'),\n\t\t\t\t\t\t\tname: item.getAttribute('name')\n\t\t\t\t\t\t};\n\t\t\t\t\t\toccupants.push(room);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn occupants;\n\t\t\t};\n\n\t\t\tvar _parseResponseMessage = function _parseResponseMessage(msginfo) {\n\t\t\t\tvar parseMsgData = { errorMsg: true, data: [] };\n\n\t\t\t\tvar msgBodies = msginfo.getElementsByTagName('body');\n\t\t\t\tif (msgBodies) {\n\t\t\t\t\tfor (var i = 0; i < msgBodies.length; i++) {\n\t\t\t\t\t\tvar msgBody = msgBodies[i];\n\t\t\t\t\t\tvar childNodes = msgBody.childNodes;\n\t\t\t\t\t\tif (childNodes && childNodes.length > 0) {\n\t\t\t\t\t\t\tvar childNode = msgBody.childNodes[0];\n\t\t\t\t\t\t\tif (childNode.nodeType == Strophe.ElementType.TEXT) {\n\t\t\t\t\t\t\t\tvar jsondata = childNode.wholeText || childNode.nodeValue;\n\t\t\t\t\t\t\t\tjsondata = jsondata.replace('\\n', '
');\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tvar data = eval('(' + jsondata + ')');\n\t\t\t\t\t\t\t\t\tparseMsgData.errorMsg = false;\n\t\t\t\t\t\t\t\t\tparseMsgData.data = [data];\n\t\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar delayTags = msginfo.getElementsByTagName('delay');\n\t\t\t\t\tif (delayTags && delayTags.length > 0) {\n\t\t\t\t\t\tvar delayTag = delayTags[0];\n\t\t\t\t\t\tvar delayMsgTime = delayTag.getAttribute('stamp');\n\t\t\t\t\t\tif (delayMsgTime) {\n\t\t\t\t\t\t\tparseMsgData.delayTimeStamp = delayMsgTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar childrens = msginfo.childNodes;\n\t\t\t\t\tif (childrens && childrens.length > 0) {\n\t\t\t\t\t\tvar child = msginfo.childNodes[0];\n\t\t\t\t\t\tif (child.nodeType == Strophe.ElementType.TEXT) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar data = eval('(' + child.nodeValue + ')');\n\t\t\t\t\t\t\t\tparseMsgData.errorMsg = false;\n\t\t\t\t\t\t\t\tparseMsgData.data = [data];\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn parseMsgData;\n\t\t\t};\n\n\t\t\tvar _parseNameFromJidFn = function _parseNameFromJidFn(jid, domain) {\n\t\t\t\tdomain = domain || '';\n\t\t\t\tvar tempstr = jid;\n\t\t\t\tvar findex = tempstr.indexOf('_');\n\n\t\t\t\tif (findex !== -1) {\n\t\t\t\t\ttempstr = tempstr.substring(findex + 1);\n\t\t\t\t}\n\t\t\t\tvar atindex = tempstr.indexOf('@' + domain);\n\t\t\t\tif (atindex !== -1) {\n\t\t\t\t\ttempstr = tempstr.substring(0, atindex);\n\t\t\t\t}\n\t\t\t\treturn tempstr;\n\t\t\t};\n\n\t\t\tvar _parseFriend = function _parseFriend(queryTag, conn, from) {\n\t\t\t\tvar rouster = [];\n\t\t\t\tvar items = queryTag.getElementsByTagName('item');\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('jid');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar subscription = item.getAttribute('subscription');\n\t\t\t\t\t\tvar friend = {\n\t\t\t\t\t\t\tsubscription: subscription,\n\t\t\t\t\t\t\tjid: jid\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar ask = item.getAttribute('ask');\n\t\t\t\t\t\tif (ask) {\n\t\t\t\t\t\t\tfriend.ask = ask;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar name = item.getAttribute('name');\n\t\t\t\t\t\tif (name) {\n\t\t\t\t\t\t\tfriend.name = name;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\t\tfriend.name = n;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar groups = [];\n\t\t\t\t\t\tStrophe.forEachChild(item, 'group', function (group) {\n\t\t\t\t\t\t\tgroups.push(Strophe.getText(group));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfriend.groups = groups;\n\t\t\t\t\t\trouster.push(friend);\n\t\t\t\t\t\t// B同意之后 -> B订阅A\n\t\t\t\t\t\t// fix: 含有ask标示的好友代表已经发送过反向订阅消息,不需要再次发送。\n\t\t\t\t\t\tif (conn && subscription == 'from' && !ask) {\n\t\t\t\t\t\t\tconn.subscribe({\n\t\t\t\t\t\t\t\ttoJid: jid,\n\t\t\t\t\t\t\t\tmessage: \"[resp:true]\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (conn && subscription == 'to') {\n\t\t\t\t\t\t\tconn.subscribed({\n\t\t\t\t\t\t\t\ttoJid: jid\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn rouster;\n\t\t\t};\n\n\t\t\tvar _login = function _login(options, conn) {\n\t\t\t\tvar accessToken = options.access_token || '';\n\t\t\t\tif (accessToken == '') {\n\t\t\t\t\tvar loginfo = _utils.stringify(options);\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,\n\t\t\t\t\t\tdata: options\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconn.context.accessToken = options.access_token;\n\t\t\t\tconn.context.accessTokenExpires = options.expires_in;\n\t\t\t\tif (conn.isOpening() && conn.context.stropheConn) {\n\t\t\t\t\tstropheConn = conn.context.stropheConn;\n\t\t\t\t} else if (conn.isOpened() && conn.context.stropheConn) {\n\t\t\t\t\t// return;\n\t\t\t\t\tstropheConn = conn.getStrophe();\n\t\t\t\t} else {\n\t\t\t\t\tstropheConn = conn.getStrophe();\n\t\t\t\t}\n\t\t\t\tvar callback = function callback(status, msg) {\n\t\t\t\t\t_loginCallback(status, msg, conn);\n\t\t\t\t};\n\n\t\t\t\tconn.context.stropheConn = stropheConn;\n\t\t\t\tif (conn.route) {\n\t\t\t\t\tstropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold, conn.route);\n\t\t\t\t} else {\n\t\t\t\t\tstropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _parseMessageType = function _parseMessageType(msginfo) {\n\t\t\t\tvar receiveinfo = msginfo.getElementsByTagName('received'),\n\t\t\t\t inviteinfo = msginfo.getElementsByTagName('invite'),\n\t\t\t\t deliveryinfo = msginfo.getElementsByTagName('delivery'),\n\t\t\t\t acked = msginfo.getElementsByTagName('acked'),\n\t\t\t\t error = msginfo.getElementsByTagName('error'),\n\t\t\t\t msgtype = 'normal';\n\t\t\t\tif (receiveinfo && receiveinfo.length > 0 && receiveinfo[0].namespaceURI === 'urn:xmpp:receipts') {\n\n\t\t\t\t\tmsgtype = 'received';\n\t\t\t\t} else if (inviteinfo && inviteinfo.length > 0) {\n\n\t\t\t\t\tmsgtype = 'invite';\n\t\t\t\t} else if (deliveryinfo && deliveryinfo.length > 0) {\n\n\t\t\t\t\tmsgtype = 'delivery'; // 消息送达\n\t\t\t\t} else if (acked && acked.length) {\n\n\t\t\t\t\tmsgtype = 'acked'; // 消息已读\n\t\t\t\t} else if (error && error.length) {\n\n\t\t\t\t\tvar errorItem = error[0],\n\t\t\t\t\t userMuted = errorItem.getElementsByTagName('user-muted');\n\n\t\t\t\t\tif (userMuted && userMuted.length) {\n\n\t\t\t\t\t\tmsgtype = 'userMuted';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn msgtype;\n\t\t\t};\n\n\t\t\tvar _handleMessageQueue = function _handleMessageQueue(conn) {\n\t\t\t\tfor (var i in _msgHash) {\n\t\t\t\t\tif (_msgHash.hasOwnProperty(i)) {\n\t\t\t\t\t\t_msgHash[i].send(conn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar _loginCallback = function _loginCallback(status, msg, conn) {\n\t\t\t\tvar conflict, error;\n\n\t\t\t\tif (msg === 'conflict') {\n\t\t\t\t\tconflict = true;\n\t\t\t\t}\n\n\t\t\t\tif (status == Strophe.Status.CONNFAIL) {\n\t\t\t\t\t//client offline, ping/pong timeout, server quit, server offline\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,\n\t\t\t\t\t\tmsg: msg,\n\t\t\t\t\t\treconnect: true\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t} else if (status == Strophe.Status.ATTACHED || status == Strophe.Status.CONNECTED) {\n\t\t\t\t\t// client should limit the speed of sending ack messages up to 5/s\n\t\t\t\t\tconn.autoReconnectNumTotal = 0;\n\t\t\t\t\tconn.intervalId = setInterval(function () {\n\t\t\t\t\t\tconn.handelSendQueue();\n\t\t\t\t\t}, 200);\n\t\t\t\t\tvar handleMessage = function handleMessage(msginfo) {\n\t\t\t\t\t\tvar delivery = msginfo.getElementsByTagName('delivery');\n\t\t\t\t\t\tvar acked = msginfo.getElementsByTagName('acked');\n\t\t\t\t\t\tif (delivery.length) {\n\t\t\t\t\t\t\tconn.handleDeliveredMessage(msginfo);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (acked.length) {\n\t\t\t\t\t\t\tconn.handleAckedMessage(msginfo);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar type = _parseMessageType(msginfo);\n\t\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\t\tcase \"received\":\n\t\t\t\t\t\t\t\tconn.handleReceivedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"invite\":\n\t\t\t\t\t\t\t\tconn.handleInviteMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"delivery\":\n\t\t\t\t\t\t\t\tconn.handleDeliveredMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"acked\":\n\t\t\t\t\t\t\t\tconn.handleAckedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tcase \"userMuted\":\n\t\t\t\t\t\t\t\tconn.handleMutedMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconn.handleMessage(msginfo);\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tvar handlePresence = function handlePresence(msginfo) {\n\t\t\t\t\t\tconn.handlePresence(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handlePing = function handlePing(msginfo) {\n\t\t\t\t\t\tconn.handlePing(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIqRoster = function handleIqRoster(msginfo) {\n\t\t\t\t\t\tconn.handleIqRoster(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIqPrivacy = function handleIqPrivacy(msginfo) {\n\t\t\t\t\t\tconn.handleIqPrivacy(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t\t\tvar handleIq = function handleIq(msginfo) {\n\t\t\t\t\t\tconn.handleIq(msginfo);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\n\t\t\t\t\tconn.addHandler(handleMessage, null, 'message', null, null, null);\n\t\t\t\t\tconn.addHandler(handlePresence, null, 'presence', null, null, null);\n\t\t\t\t\tconn.addHandler(handlePing, 'urn:xmpp:ping', 'iq', 'get', null, null);\n\t\t\t\t\tconn.addHandler(handleIqRoster, 'jabber:iq:roster', 'iq', 'set', null, null);\n\t\t\t\t\tconn.addHandler(handleIqPrivacy, 'jabber:iq:privacy', 'iq', 'set', null, null);\n\t\t\t\t\tconn.addHandler(handleIq, null, 'iq', null, null, null);\n\n\t\t\t\t\tconn.registerConfrIQHandler && conn.registerConfrIQHandler();\n\n\t\t\t\t\tconn.context.status = _code.STATUS_OPENED;\n\n\t\t\t\t\tvar supportRecMessage = [_code.WEBIM_MESSAGE_REC_TEXT, _code.WEBIM_MESSAGE_REC_EMOJI];\n\n\t\t\t\t\tif (_utils.isCanDownLoadFile) {\n\t\t\t\t\t\tsupportRecMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO);\n\t\t\t\t\t\tsupportRecMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE);\n\t\t\t\t\t}\n\t\t\t\t\tvar supportSedMessage = [_code.WEBIM_MESSAGE_SED_TEXT];\n\t\t\t\t\tif (_utils.isCanUploadFile) {\n\t\t\t\t\t\tsupportSedMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO);\n\t\t\t\t\t\tsupportSedMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE);\n\t\t\t\t\t}\n\t\t\t\t\tconn.notifyVersion();\n\t\t\t\t\tconn.retry && _handleMessageQueue(conn);\n\t\t\t\t\tconn.heartBeat();\n\t\t\t\t\tconn.isAutoLogin && conn.setPresence();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (conn.unSendMsgArr.length > 0) {\n\t\t\t\t\t\t\tfor (var i in conn.unSendMsgArr) {\n\t\t\t\t\t\t\t\tvar dom = conn.unSendMsgArr[i];\n\t\t\t\t\t\t\t\tconn.sendCommand(dom);\n\t\t\t\t\t\t\t\tdelete conn.unSendMsgArr[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e.message);\n\t\t\t\t\t}\n\t\t\t\t\tconn.offLineSendConnecting = false;\n\t\t\t\t\tconn.logOut = false;\n\n\t\t\t\t\tconn.onOpened({\n\t\t\t\t\t\tcanReceive: supportRecMessage,\n\t\t\t\t\t\tcanSend: supportSedMessage,\n\t\t\t\t\t\taccessToken: conn.context.accessToken\n\t\t\t\t\t});\n\t\t\t\t} else if (status == Strophe.Status.DISCONNECTING) {\n\t\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\t\tconn.stopHeartBeat();\n\t\t\t\t\t\tconn.context.status = _code.STATUS_CLOSING;\n\n\t\t\t\t\t\terror = {\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR,\n\t\t\t\t\t\t\tmsg: msg,\n\t\t\t\t\t\t\treconnect: true\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\t\tconn.onError(error);\n\t\t\t\t\t}\n\t\t\t\t} else if (status == Strophe.Status.DISCONNECTED) {\n\t\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\t\tif (conn.autoReconnectNumTotal < conn.autoReconnectNumMax) {\n\t\t\t\t\t\t\tconn.reconnect();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = {\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconn.onError(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tconn.context.status = _code.STATUS_CLOSED;\n\t\t\t\t\tconn.clear();\n\t\t\t\t\tconn.onClosed();\n\t\t\t\t} else if (status == Strophe.Status.AUTHFAIL) {\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AUTH_ERROR\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t\tconn.clear();\n\t\t\t\t} else if (status == Strophe.Status.ERROR) {\n\t\t\t\t\tconn.context.status = _code.STATUS_ERROR;\n\t\t\t\t\terror = {\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SERVER_ERROR\n\t\t\t\t\t};\n\n\t\t\t\t\tconflict && (error.conflict = true);\n\t\t\t\t\tconn.onError(error);\n\t\t\t\t}\n\t\t\t\tconn.context.status_now = status;\n\t\t\t};\n\n\t\t\tvar _getJid = function _getJid(options, conn) {\n\t\t\t\tvar jid = options.toJid || '';\n\n\t\t\t\tif (jid === '') {\n\t\t\t\t\tvar appKey = conn.context.appKey || '';\n\t\t\t\t\tvar toJid = appKey + '_' + options.to + '@' + conn.domain;\n\n\t\t\t\t\tif (options.resource) {\n\t\t\t\t\t\ttoJid = toJid + '/' + options.resource;\n\t\t\t\t\t}\n\t\t\t\t\tjid = toJid;\n\t\t\t\t}\n\t\t\t\treturn jid;\n\t\t\t};\n\n\t\t\tvar _getJidByName = function _getJidByName(name, conn) {\n\t\t\t\tvar options = {\n\t\t\t\t\tto: name\n\t\t\t\t};\n\t\t\t\treturn _getJid(options, conn);\n\t\t\t};\n\n\t\t\tvar _validCheck = function _validCheck(options, conn) {\n\t\t\t\toptions = options || {};\n\n\t\t\t\tif (options.user == '') {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar user = options.user + '' || '';\n\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\tvar devInfos = appKey.split('#');\n\n\t\t\t\tif (devInfos.length !== 2) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar orgName = devInfos[0];\n\t\t\t\tvar appName = devInfos[1];\n\n\t\t\t\tif (!orgName) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!appName) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar jid = appKey + '_' + user.toLowerCase() + '@' + conn.domain,\n\t\t\t\t resource = options.resource || 'webim';\n\n\t\t\t\tif (conn.isMultiLoginSessions) {\n\t\t\t\t\tresource += user + new Date().getTime() + Math.floor(Math.random().toFixed(6) * 1000000);\n\t\t\t\t}\n\t\t\t\tconn.context.jid = jid + '/' + resource;\n\t\t\t\tconn.context.userId = user;\n\t\t\t\tconn.context.appKey = appKey;\n\t\t\t\tconn.context.appName = appName;\n\t\t\t\tconn.context.orgName = orgName;\n\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tvar _getXmppUrl = function _getXmppUrl(baseUrl, https) {\n\t\t\t\tif (/^(ws|http)s?:\\/\\/?/.test(baseUrl)) {\n\t\t\t\t\treturn baseUrl;\n\t\t\t\t}\n\n\t\t\t\tvar url = {\n\t\t\t\t\tprefix: 'http',\n\t\t\t\t\tbase: '://' + baseUrl,\n\t\t\t\t\tsuffix: '/http-bind/'\n\t\t\t\t};\n\n\t\t\t\tif (https && _utils.isSupportWss) {\n\t\t\t\t\turl.prefix = 'wss';\n\t\t\t\t\turl.suffix = '/ws/';\n\t\t\t\t} else {\n\t\t\t\t\tif (https) {\n\t\t\t\t\t\turl.prefix = 'https';\n\t\t\t\t\t} else if (window.WebSocket) {\n\t\t\t\t\t\turl.prefix = 'ws';\n\t\t\t\t\t\turl.suffix = '/ws/';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn url.prefix + url.base + url.suffix;\n\t\t\t};\n\n\t\t\t/**\n * The connection class.\n * @constructor\n * @param {Object} options -\n * @param {String} options.url - xmppURL for xmpp server\n * @param {String} options.apiUrl - apiURL for restful API server\n * @param {Boolean} options.isHttpDNS - while http:// protocol,use ip directly,instead of ServerName,avoiding DNS problem.default false\n * @param {Boolean} options.isMultiLoginSessions - true: A visitor can sign in to multiple webpages and receive messages at all the webpages. false: A visitor can sign in to only one webpage and receive messages at the webpage.\n * @param {Boolean} options.https - Whether use wss or not.\n * @param {Number} options.heartBeatWait - after login, send empty message to xmpp server like heartBeat every 45s, to keep the ws connection alive.\n * @param {Boolean} options.isAutoLogin - set presence after login\n * @param {Number} options.autoReconnectNumMax - will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.\n * @param {Number} options.autoReconnectInterval - the interval seconds between each auto reconnectting.\n * @param {Boolean} options.isWindowSDK - Whether for windows platform. default false.\n * @param {Boolean} options.encrypt - whether encrypt text message and emoji message\n * @param {Boolean} options.delivery - When a message arrived, whether the receiver send an ack message to the sender or not.\n * @param {Number} options.pollingTime -\n * @param {Number} options.maxRetries -\n * @param {Boolean} options.hold -\n * @param {String} options.route -\n * @param {String} options.domain -\n * @param {Boolean} options.inactivity -\n *\n * @returns {Class} a single instance of connection\n */\n\t\t\tvar connection = function connection(options) {\n\t\t\t\tif (!this instanceof connection) {\n\t\t\t\t\treturn new connection(options);\n\t\t\t\t}\n\n\t\t\t\tvar options = options || {};\n\n\t\t\t\tthis.isHttpDNS = options.isHttpDNS || false;\n\t\t\t\tthis.isMultiLoginSessions = options.isMultiLoginSessions || false;\n\t\t\t\tthis.wait = options.wait || 30;\n\t\t\t\tthis.hold = options.hold || 1;\n\t\t\t\tthis.retry = options.retry || false;\n\t\t\t\tthis.https = options.https || location.protocol === 'https:';\n\t\t\t\tthis.url = _getXmppUrl(options.url, this.https);\n\t\t\t\tthis.route = options.route || null;\n\t\t\t\tthis.domain = options.domain || 'easemob.com';\n\t\t\t\tthis.inactivity = options.inactivity || 30;\n\t\t\t\tthis.heartBeatWait = options.heartBeatWait || 4500;\n\t\t\t\tthis.maxRetries = options.maxRetries || 5;\n\t\t\t\tthis.isAutoLogin = options.isAutoLogin === false ? false : true;\n\t\t\t\tthis.pollingTime = options.pollingTime || 800;\n\t\t\t\tthis.stropheConn = false;\n\t\t\t\tthis.autoReconnectNumMax = options.autoReconnectNumMax || 0;\n\t\t\t\tthis.autoReconnectNumTotal = 0;\n\t\t\t\tthis.autoReconnectInterval = options.autoReconnectInterval || 0;\n\t\t\t\tthis.context = { status: _code.STATUS_INIT };\n\t\t\t\tthis.sendQueue = new Queue(); //instead of sending message immediately,cache them in this queue\n\t\t\t\tthis.intervalId = null; //clearInterval return value\n\t\t\t\tthis.apiUrl = options.apiUrl || '';\n\t\t\t\tthis.isWindowSDK = options.isWindowSDK || false;\n\t\t\t\tthis.encrypt = options.encrypt || { encrypt: { type: 'none' } };\n\t\t\t\tthis.delivery = options.delivery || false;\n\t\t\t\tthis.user = '';\n\t\t\t\tthis.orgName = '';\n\t\t\t\tthis.appName = '';\n\t\t\t\tthis.token = '';\n\t\t\t\tthis.unSendMsgArr = [];\n\t\t\t\tthis.offLineSendConnecting = false;\n\t\t\t\tthis.logOut = false;\n\n\t\t\t\tthis.dnsArr = ['https://rs.easemob.com', 'https://rsbak.easemob.com', 'http://182.92.174.78', 'http://112.126.66.111']; //http dns server hosts\n\t\t\t\tthis.dnsIndex = 0; //the dns ip used in dnsArr currently\n\t\t\t\tthis.dnsTotal = this.dnsArr.length; //max number of getting dns retries\n\t\t\t\tthis.restHosts = null; //rest server ips\n\t\t\t\tthis.restIndex = 0; //the rest ip used in restHosts currently\n\t\t\t\tthis.restTotal = 0; //max number of getting rest token retries\n\t\t\t\tthis.xmppHosts = null; //xmpp server ips\n\t\t\t\tthis.xmppIndex = 0; //the xmpp ip used in xmppHosts currently\n\t\t\t\tthis.xmppTotal = 0; //max number of creating xmpp server connection(ws/bosh) retries\n\n\t\t\t\tthis.groupOption = {};\n\t\t\t};\n\n\t\t\tconnection.prototype.testInit = function (options) {\n\t\t\t\tthis.orgName = options.orgName;\n\t\t\t\tthis.appName = options.appName;\n\t\t\t\tthis.user = options.user;\n\t\t\t\tthis.token = options.token;\n\t\t\t};\n\n\t\t\t/**\n * 注册新用户\n * @param {options} options -\n */\n\t\t\tconnection.prototype.registerUser = function (options) {\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\tthis.dnsIndex = 0;\n\t\t\t\t\tthis.getHttpDNS(options, 'signup');\n\t\t\t\t} else {\n\t\t\t\t\tthis.signup(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 处理发送队列\n * @private\n */\n\t\t\tconnection.prototype.handelSendQueue = function () {\n\t\t\t\tvar options = this.sendQueue.pop();\n\t\t\t\tif (options !== null) {\n\t\t\t\t\tthis.sendReceiptsMessage(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 注册监听函数\n * @param {options} options -\n */\n\t\t\tconnection.prototype.listen = function (options) {\n\t\t\t\tthis.onOpened = options.onOpened || _utils.emptyfn;\n\t\t\t\tthis.onClosed = options.onClosed || _utils.emptyfn;\n\t\t\t\tthis.onTextMessage = options.onTextMessage || _utils.emptyfn;\n\t\t\t\tthis.onEmojiMessage = options.onEmojiMessage || _utils.emptyfn;\n\t\t\t\tthis.onPictureMessage = options.onPictureMessage || _utils.emptyfn;\n\t\t\t\tthis.onAudioMessage = options.onAudioMessage || _utils.emptyfn;\n\t\t\t\tthis.onVideoMessage = options.onVideoMessage || _utils.emptyfn;\n\t\t\t\tthis.onFileMessage = options.onFileMessage || _utils.emptyfn;\n\t\t\t\tthis.onLocationMessage = options.onLocationMessage || _utils.emptyfn;\n\t\t\t\tthis.onCmdMessage = options.onCmdMessage || _utils.emptyfn;\n\t\t\t\tthis.onPresence = options.onPresence || _utils.emptyfn;\n\t\t\t\tthis.onRoster = options.onRoster || _utils.emptyfn;\n\t\t\t\tthis.onError = options.onError || _utils.emptyfn;\n\t\t\t\tthis.onReceivedMessage = options.onReceivedMessage || _utils.emptyfn;\n\t\t\t\tthis.onInviteMessage = options.onInviteMessage || _utils.emptyfn;\n\t\t\t\tthis.onDeliverdMessage = options.onDeliveredMessage || _utils.emptyfn;\n\t\t\t\tthis.onReadMessage = options.onReadMessage || _utils.emptyfn;\n\t\t\t\tthis.onMutedMessage = options.onMutedMessage || _utils.emptyfn;\n\t\t\t\tthis.onOffline = options.onOffline || _utils.emptyfn;\n\t\t\t\tthis.onOnline = options.onOnline || _utils.emptyfn;\n\t\t\t\tthis.onConfirmPop = options.onConfirmPop || _utils.emptyfn;\n\t\t\t\tthis.onCreateGroup = options.onCreateGroup || _utils.emptyfn;\n\t\t\t\t//for WindowSDK start\n\t\t\t\tthis.onUpdateMyGroupList = options.onUpdateMyGroupList || _utils.emptyfn;\n\t\t\t\tthis.onUpdateMyRoster = options.onUpdateMyRoster || _utils.emptyfn;\n\t\t\t\t//for WindowSDK end\n\t\t\t\tthis.onBlacklistUpdate = options.onBlacklistUpdate || _utils.emptyfn;\n\n\t\t\t\t_listenNetwork(this.onOnline, this.onOffline);\n\t\t\t};\n\n\t\t\t/**\n * 发送心跳\n * webrtc需要强制心跳,加个默认为false的参数 向下兼容\n * @param {Boolean} forcing - 是否强制发送\n * @private\n */\n\t\t\tconnection.prototype.heartBeat = function (forcing) {\n\t\t\t\tif (forcing !== true) {\n\t\t\t\t\tforcing = false;\n\t\t\t\t}\n\t\t\t\tvar me = this;\n\t\t\t\t//IE8: strophe auto switch from ws to BOSH, need heartbeat\n\t\t\t\tvar isNeed = !/^ws|wss/.test(me.url) || /mobile/.test(navigator.userAgent);\n\n\t\t\t\tif (this.heartBeatID || !forcing && !isNeed) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar options = {\n\t\t\t\t\ttoJid: this.domain,\n\t\t\t\t\ttype: 'normal'\n\t\t\t\t};\n\t\t\t\tthis.heartBeatID = setInterval(function () {\n\t\t\t\t\t// fix: do heartbeat only when websocket \n\t\t\t\t\t_utils.isSupportWss && me.ping(options);\n\t\t\t\t}, this.heartBeatWait);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.stopHeartBeat = function () {\n\t\t\t\tif (typeof this.heartBeatID == \"number\") {\n\t\t\t\t\tthis.heartBeatID = clearInterval(this.heartBeatID);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 发送接收消息回执\n * @param {Object} options -\n * @private\n */\n\t\t\tconnection.prototype.sendReceiptsMessage = function (options) {\n\t\t\t\tvar dom = $msg({\n\t\t\t\t\tfrom: this.context.jid || '',\n\t\t\t\t\tto: this.domain,\n\t\t\t\t\tid: options.id || ''\n\t\t\t\t}).c('received', {\n\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\tid: options.id || ''\n\t\t\t\t});\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.cacheReceiptsMessage = function (options) {\n\t\t\t\tthis.sendQueue.push(options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getStrophe = function () {\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\t//TODO: try this.xmppTotal times on fail\n\t\t\t\t\tvar url = '';\n\t\t\t\t\tvar host = this.xmppHosts[this.xmppIndex];\n\t\t\t\t\tvar domain = _utils.getXmlFirstChild(host, 'domain');\n\t\t\t\t\tvar ip = _utils.getXmlFirstChild(host, 'ip');\n\t\t\t\t\tif (ip) {\n\t\t\t\t\t\turl = ip.textContent;\n\t\t\t\t\t\tvar port = _utils.getXmlFirstChild(host, 'port');\n\t\t\t\t\t\tif (port.textContent != '80') {\n\t\t\t\t\t\t\turl += ':' + port.textContent;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\turl = domain.textContent;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (url != '') {\n\t\t\t\t\t\tvar parter = /(.+\\/\\/).+(\\/.+)/;\n\t\t\t\t\t\tthis.url = this.url.replace(parter, \"$1\" + url + \"$2\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar stropheConn = new Strophe.Connection(this.url, {\n\t\t\t\t\tinactivity: this.inactivity,\n\t\t\t\t\tmaxRetries: this.maxRetries,\n\t\t\t\t\tpollingTime: this.pollingTime\n\t\t\t\t});\n\t\t\t\treturn stropheConn;\n\t\t\t};\n\n\t\t\t/**\n *\n * @param data\n * @param tagName\n * @private\n */\n\t\t\tconnection.prototype.getHostsByTag = function (data, tagName) {\n\t\t\t\tvar tag = _utils.getXmlFirstChild(data, tagName);\n\t\t\t\tif (!tag) {\n\t\t\t\t\tconsole.log(tagName + ' hosts error');\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar hosts = tag.getElementsByTagName('hosts');\n\t\t\t\tif (hosts.length == 0) {\n\t\t\t\t\tconsole.log(tagName + ' hosts error2');\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn hosts[0].getElementsByTagName('host');\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getRestFromHttpDNS = function (options, type) {\n\t\t\t\tif (this.restIndex > this.restTotal) {\n\t\t\t\t\tconsole.log('rest hosts all tried,quit');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar url = '';\n\t\t\t\tvar host = this.restHosts[this.restIndex];\n\t\t\t\tvar domain = _utils.getXmlFirstChild(host, 'domain');\n\t\t\t\tvar ip = _utils.getXmlFirstChild(host, 'ip');\n\t\t\t\tif (ip) {\n\t\t\t\t\tvar port = _utils.getXmlFirstChild(host, 'port');\n\t\t\t\t\turl = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + ip.textContent + ':' + port.textContent;\n\t\t\t\t} else {\n\t\t\t\t\turl = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + domain.textContent;\n\t\t\t\t}\n\n\t\t\t\tif (url != '') {\n\t\t\t\t\tthis.apiUrl = url;\n\t\t\t\t\toptions.apiUrl = url;\n\t\t\t\t}\n\n\t\t\t\tif (type == 'login') {\n\t\t\t\t\tthis.login(options);\n\t\t\t\t} else {\n\t\t\t\t\tthis.signup(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.getHttpDNS = function (options, type) {\n\t\t\t\tif (this.restHosts) {\n\t\t\t\t\tthis.getRestFromHttpDNS(options, type);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar self = this;\n\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\tdata = new DOMParser().parseFromString(data, \"text/xml\").documentElement;\n\t\t\t\t\t//get rest ips\n\t\t\t\t\tvar restHosts = self.getHostsByTag(data, 'rest');\n\t\t\t\t\tif (!restHosts) {\n\t\t\t\t\t\tconsole.log('rest hosts error3');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tself.restHosts = restHosts;\n\t\t\t\t\tself.restTotal = restHosts.length;\n\n\t\t\t\t\t//get xmpp ips\n\t\t\t\t\tvar xmppHosts = self.getHostsByTag(data, 'xmpp');\n\t\t\t\t\tif (!xmppHosts) {\n\t\t\t\t\t\tconsole.log('xmpp hosts error3');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tself.xmppHosts = xmppHosts;\n\t\t\t\t\tself.xmppTotal = xmppHosts.length;\n\n\t\t\t\t\tself.getRestFromHttpDNS(options, type);\n\t\t\t\t};\n\t\t\t\tvar error = function error(res, xhr, msg) {\n\n\t\t\t\t\tconsole.log('getHttpDNS error', res, msg);\n\t\t\t\t\tself.dnsIndex++;\n\t\t\t\t\tif (self.dnsIndex < self.dnsTotal) {\n\t\t\t\t\t\tself.getHttpDNS(options, type);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tvar options2 = {\n\t\t\t\t\turl: this.dnsArr[this.dnsIndex] + '/easemob/server.xml',\n\t\t\t\t\tdataType: 'text',\n\t\t\t\t\ttype: 'GET',\n\n\t\t\t\t\t// url: 'http://www.easemob.com/easemob/server.xml',\n\t\t\t\t\t// dataType: 'xml',\n\t\t\t\t\tdata: { app_key: encodeURIComponent(options.appKey) },\n\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t};\n\t\t\t\t_utils.ajax(options2);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.signup = function (options) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar orgName = options.orgName || '';\n\t\t\t\tvar appName = options.appName || '';\n\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\tvar err = options.error || EMPTYFN;\n\n\t\t\t\tif (!orgName && !appName && appKey) {\n\t\t\t\t\tvar devInfos = appKey.split('#');\n\t\t\t\t\tif (devInfos.length === 2) {\n\t\t\t\t\t\torgName = devInfos[0];\n\t\t\t\t\t\tappName = devInfos[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!orgName && !appName) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\tif (location.protocol != 'https:' && self.isHttpDNS) {\n\t\t\t\t\t\tif (self.restIndex + 1 < self.restTotal) {\n\t\t\t\t\t\t\tself.restIndex++;\n\t\t\t\t\t\t\tself.getRestFromHttpDNS(options, 'signup');\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tself.clear();\n\t\t\t\t\terr(res);\n\t\t\t\t};\n\t\t\t\tvar https = options.https || https;\n\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\tvar restUrl = apiUrl + '/' + orgName + '/' + appName + '/users';\n\n\t\t\t\tvar userjson = {\n\t\t\t\t\tusername: options.username,\n\t\t\t\t\tpassword: options.password,\n\t\t\t\t\tnickname: options.nickname || ''\n\t\t\t\t};\n\n\t\t\t\tvar userinfo = _utils.stringify(userjson);\n\t\t\t\tvar options2 = {\n\t\t\t\t\turl: restUrl,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: userinfo,\n\t\t\t\t\tsuccess: suc,\n\t\t\t\t\terror: error\n\t\t\t\t};\n\t\t\t\t_utils.ajax(options2);\n\t\t\t};\n\n\t\t\t/**\n * 登录\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.open = function (options) {\n\t\t\t\tvar appkey = options.appKey,\n\t\t\t\t orgName = appkey.split('#')[0],\n\t\t\t\t appName = appkey.split('#')[1];\n\t\t\t\tthis.orgName = orgName;\n\t\t\t\tthis.appName = appName;\n\t\t\t\tif (options.accessToken) {\n\t\t\t\t\tthis.token = options.accessToken;\n\t\t\t\t}\n\t\t\t\tif (options.xmppURL) {\n\t\t\t\t\tthis.url = _getXmppUrl(options.xmppURL, this.https);\n\t\t\t\t}\n\t\t\t\tif (location.protocol != 'https:' && this.isHttpDNS) {\n\t\t\t\t\tthis.dnsIndex = 0;\n\t\t\t\t\tthis.getHttpDNS(options, 'login');\n\t\t\t\t} else {\n\t\t\t\t\tthis.login(options);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n *\n * @param options\n * @private\n */\n\t\t\tconnection.prototype.login = function (options) {\n\t\t\t\tthis.user = options.user;\n\t\t\t\tvar pass = _validCheck(options, this);\n\n\t\t\t\tif (!pass) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar conn = this;\n\n\t\t\t\tif (conn.isOpened()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (options.accessToken) {\n\t\t\t\t\toptions.access_token = options.accessToken;\n\t\t\t\t\tconn.context.restTokenData = options;\n\t\t\t\t\t_login(options, conn);\n\t\t\t\t} else {\n\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\tvar userId = this.context.userId;\n\t\t\t\t\tvar pwd = options.pwd || '';\n\t\t\t\t\tvar appName = this.context.appName;\n\t\t\t\t\tvar orgName = this.context.orgName;\n\n\t\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\t\tconn.context.status = _code.STATUS_DOLOGIN_IM;\n\t\t\t\t\t\tconn.context.restTokenData = data;\n\t\t\t\t\t\tif (options.success) options.success(data);\n\t\t\t\t\t\tconn.token = data.access_token;\n\t\t\t\t\t\t_login(data, conn);\n\t\t\t\t\t};\n\t\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\t\tif (options.error) options.error();\n\t\t\t\t\t\tif (location.protocol != 'https:' && conn.isHttpDNS) {\n\t\t\t\t\t\t\tif (conn.restIndex + 1 < conn.restTotal) {\n\t\t\t\t\t\t\t\tconn.restIndex++;\n\t\t\t\t\t\t\t\tconn.getRestFromHttpDNS(options, 'login');\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconn.clear();\n\t\t\t\t\t\tif (res.error && res.error_description) {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_OPEN_ERROR,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.context.status = _code.STATUS_DOLOGIN_USERGRID;\n\n\t\t\t\t\tvar loginJson = {\n\t\t\t\t\t\tgrant_type: 'password',\n\t\t\t\t\t\tusername: userId,\n\t\t\t\t\t\tpassword: pwd,\n\t\t\t\t\t\ttimestamp: +new Date()\n\t\t\t\t\t};\n\t\t\t\t\tvar loginfo = _utils.stringify(loginJson);\n\n\t\t\t\t\tvar options2 = {\n\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/token',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: loginfo,\n\t\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t\t};\n\t\t\t\t\t_utils.ajax(options2);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * attach to xmpp server for BOSH\n * @private\n */\n\t\t\tconnection.prototype.attach = function (options) {\n\t\t\t\tvar pass = _validCheck(options, this);\n\n\t\t\t\tif (!pass) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\toptions = options || {};\n\n\t\t\t\tvar accessToken = options.accessToken || '';\n\t\t\t\tif (accessToken == '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar sid = options.sid || '';\n\t\t\t\tif (sid === '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar rid = options.rid || '';\n\t\t\t\tif (rid === '') {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstropheConn = this.getStrophe();\n\n\t\t\t\tthis.context.accessToken = accessToken;\n\t\t\t\tthis.context.stropheConn = stropheConn;\n\t\t\t\tthis.context.status = _code.STATUS_DOLOGIN_IM;\n\n\t\t\t\tvar conn = this;\n\t\t\t\tvar callback = function callback(status, msg) {\n\t\t\t\t\t_loginCallback(status, msg, conn);\n\t\t\t\t};\n\n\t\t\t\tvar jid = this.context.jid;\n\t\t\t\tvar wait = this.wait;\n\t\t\t\tvar hold = this.hold;\n\t\t\t\tvar wind = this.wind || 5;\n\t\t\t\tstropheConn.attach(jid, sid, rid, callback, wait, hold, wind);\n\t\t\t};\n\n\t\t\t/**\n * close connection\n * @param {String} reason\n */\n\t\t\tconnection.prototype.close = function (reason) {\n\t\t\t\tthis.logOut = true;\n\t\t\t\tthis.stopHeartBeat();\n\n\t\t\t\tvar status = this.context.status;\n\t\t\t\tif (status == _code.STATUS_INIT) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.isClosed() || this.isClosing()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.context.status = _code.STATUS_CLOSING;\n\t\t\t\tthis.context.stropheConn.disconnect(reason);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.addHandler = function (handler, ns, name, type, id, from, options) {\n\t\t\t\tthis.context.stropheConn.addHandler(handler, ns, name, type, id, from, options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.notifyVersion = function (suc, fail) {\n\t\t\t\tvar jid = stropheConn.getJid();\n\t\t\t\tthis.context.jid = jid;\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: jid || '',\n\t\t\t\t\tto: this.domain,\n\t\t\t\t\ttype: 'result'\n\t\t\t\t}).c('query', { xmlns: 'jabber:iq:version' }).c('name').t('easemob').up().c('version').t(_version).up().c('os').t('webim');\n\n\t\t\t\tvar suc = suc || _utils.emptyfn;\n\t\t\t\tvar error = fail || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_NOTIFYVERSION_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), suc, failFn);\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\t/**\n * handle all types of presence message\n * @private\n */\n\t\t\tconnection.prototype.handlePresence = function (msginfo) {\n\t\t\t\tconsole.log('Info: ', typeof msginfo === 'undefined' ? 'undefined' : _typeof(msginfo));\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar from = msginfo.getAttribute('from') || '';\n\t\t\t\tvar to = msginfo.getAttribute('to') || '';\n\t\t\t\tvar type = msginfo.getAttribute('type') || '';\n\t\t\t\tvar presence_type = msginfo.getAttribute('presence_type') || '';\n\t\t\t\tvar fromUser = _parseNameFromJidFn(from);\n\t\t\t\tvar toUser = _parseNameFromJidFn(to);\n\t\t\t\tvar isCreate = false;\n\t\t\t\tvar isMemberJoin = false;\n\t\t\t\tvar isDecline = false;\n\t\t\t\tvar isApply = false;\n\t\t\t\tvar info = {\n\t\t\t\t\tfrom: fromUser,\n\t\t\t\t\tto: toUser,\n\t\t\t\t\tfromJid: from,\n\t\t\t\t\ttoJid: to,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tchatroom: msginfo.getElementsByTagName('roomtype').length ? true : false\n\t\t\t\t};\n\n\t\t\t\tvar showTags = msginfo.getElementsByTagName('show');\n\t\t\t\tif (showTags && showTags.length > 0) {\n\t\t\t\t\tvar showTag = showTags[0];\n\t\t\t\t\tinfo.show = Strophe.getText(showTag);\n\t\t\t\t}\n\t\t\t\tvar statusTags = msginfo.getElementsByTagName('status');\n\t\t\t\tif (statusTags && statusTags.length > 0) {\n\t\t\t\t\tvar statusTag = statusTags[0];\n\t\t\t\t\tinfo.status = Strophe.getText(statusTag);\n\t\t\t\t\tinfo.code = statusTag.getAttribute('code');\n\t\t\t\t}\n\n\t\t\t\tvar priorityTags = msginfo.getElementsByTagName('priority');\n\t\t\t\tif (priorityTags && priorityTags.length > 0) {\n\t\t\t\t\tvar priorityTag = priorityTags[0];\n\t\t\t\t\tinfo.priority = Strophe.getText(priorityTag);\n\t\t\t\t}\n\n\t\t\t\tvar error = msginfo.getElementsByTagName('error');\n\t\t\t\tif (error && error.length > 0) {\n\t\t\t\t\tvar error = error[0];\n\t\t\t\t\tinfo.error = {\n\t\t\t\t\t\tcode: error.getAttribute('code')\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tvar destroy = msginfo.getElementsByTagName('destroy');\n\t\t\t\tif (destroy && destroy.length > 0) {\n\t\t\t\t\tvar destroy = destroy[0];\n\t\t\t\t\tinfo.destroy = true;\n\n\t\t\t\t\tvar reason = destroy.getElementsByTagName('reason');\n\t\t\t\t\tif (reason && reason.length > 0) {\n\t\t\t\t\t\tinfo.reason = Strophe.getText(reason[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar members = msginfo.getElementsByTagName('item');\n\t\t\t\tif (members && members.length > 0) {\n\t\t\t\t\tvar member = members[0];\n\t\t\t\t\tvar role = member.getAttribute('role');\n\t\t\t\t\tvar jid = member.getAttribute('jid');\n\t\t\t\t\tvar affiliation = member.getAttribute('affiliation');\n\t\t\t\t\t// dismissed by group\n\t\t\t\t\tif (role == 'none' && jid) {\n\t\t\t\t\t\tvar kickedMember = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tvar actor = member.getElementsByTagName('actor')[0];\n\t\t\t\t\t\tvar actorNick = actor.getAttribute('nick');\n\t\t\t\t\t\tinfo.actor = actorNick;\n\t\t\t\t\t\tinfo.kicked = kickedMember;\n\t\t\t\t\t}\n\t\t\t\t\t// Service Acknowledges Room Creation `createGroupACK`\n\t\t\t\t\tif (role == 'moderator' && info.code == '201') {\n\t\t\t\t\t\tif (affiliation === 'owner') {\n\t\t\t\t\t\t\tinfo.type = 'createGroupACK';\n\t\t\t\t\t\t\tisCreate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// else\n\t\t\t\t\t\t// info.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar x = msginfo.getElementsByTagName('x');\n\t\t\t\tif (x && x.length > 0) {\n\t\t\t\t\t// 加群申请\n\t\t\t\t\tvar apply = x[0].getElementsByTagName('apply');\n\t\t\t\t\t// 加群成功\n\t\t\t\t\tvar accept = x[0].getElementsByTagName('accept');\n\t\t\t\t\t// 同意加群后用户进群通知\n\t\t\t\t\tvar item = x[0].getElementsByTagName('item');\n\t\t\t\t\t// 加群被拒绝\n\t\t\t\t\tvar decline = x[0].getElementsByTagName('decline');\n\t\t\t\t\t// 被设为管理员\n\t\t\t\t\tvar addAdmin = x[0].getElementsByTagName('add_admin');\n\t\t\t\t\t// 被取消管理员\n\t\t\t\t\tvar removeAdmin = x[0].getElementsByTagName('remove_admin');\n\t\t\t\t\t// 被禁言\n\t\t\t\t\tvar addMute = x[0].getElementsByTagName('add_mute');\n\t\t\t\t\t// 取消禁言\n\t\t\t\t\tvar removeMute = x[0].getElementsByTagName('remove_mute');\n\n\t\t\t\t\tif (apply && apply.length > 0) {\n\t\t\t\t\t\tisApply = true;\n\t\t\t\t\t\tinfo.toNick = apply[0].getAttribute('toNick');\n\t\t\t\t\t\tinfo.type = 'joinGroupNotifications';\n\t\t\t\t\t\tvar groupJid = apply[0].getAttribute('to');\n\t\t\t\t\t\tvar gid = groupJid.split('@')[0].split('_');\n\t\t\t\t\t\tgid = gid[gid.length - 1];\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t} else if (accept && accept.length > 0) {\n\t\t\t\t\t\tinfo.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t} else if (item && item.length > 0) {\n\t\t\t\t\t\tvar affiliation = item[0].getAttribute('affiliation'),\n\t\t\t\t\t\t role = item[0].getAttribute('role');\n\t\t\t\t\t\tif (affiliation == 'member' || role == 'participant') {\n\t\t\t\t\t\t\tisMemberJoin = true;\n\t\t\t\t\t\t\tinfo.mid = info.fromJid.split('/');\n\t\t\t\t\t\t\tinfo.mid = info.mid[info.mid.length - 1];\n\t\t\t\t\t\t\tinfo.type = 'memberJoinPublicGroupSuccess';\n\t\t\t\t\t\t\tvar roomtype = msginfo.getElementsByTagName('roomtype');\n\t\t\t\t\t\t\tif (roomtype && roomtype.length > 0) {\n\t\t\t\t\t\t\t\tvar type = roomtype[0].getAttribute('type');\n\t\t\t\t\t\t\t\tif (type == 'chatroom') {\n\t\t\t\t\t\t\t\t\tinfo.type = 'memberJoinChatRoomSuccess';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (decline && decline.length) {\n\t\t\t\t\t\tisDecline = true;\n\t\t\t\t\t\tvar gid = decline[0].getAttribute(\"fromNick\");\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(decline[0].getAttribute(\"from\"));\n\t\t\t\t\t\tinfo.type = \"joinPublicGroupDeclined\";\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t} else if (addAdmin && addAdmin.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(addAdmin[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(addAdmin[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"addAdmin\";\n\t\t\t\t\t} else if (removeAdmin && removeAdmin.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(removeAdmin[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(removeAdmin[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"removeAdmin\";\n\t\t\t\t\t} else if (addMute && addMute.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(addMute[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(addMute[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"addMute\";\n\t\t\t\t\t} else if (removeMute && removeMute.length > 0) {\n\t\t\t\t\t\tvar gid = _parseNameFromJidFn(removeMute[0].getAttribute('mucjid'));\n\t\t\t\t\t\tvar owner = _parseNameFromJidFn(removeMute[0].getAttribute('from'));\n\t\t\t\t\t\tinfo.owner = owner;\n\t\t\t\t\t\tinfo.gid = gid;\n\t\t\t\t\t\tinfo.type = \"removeMute\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (info.chatroom) {\n\t\t\t\t\t// diff the\n\t\t\t\t\tinfo.presence_type = presence_type;\n\t\t\t\t\tinfo.original_type = info.type;\n\t\t\t\t\tvar reflectUser = from.slice(from.lastIndexOf('/') + 1);\n\n\t\t\t\t\tif (reflectUser === this.context.userId) {\n\t\t\t\t\t\tif (info.type === '' && !info.code) {\n\t\t\t\t\t\t\tinfo.type = 'joinChatRoomSuccess';\n\t\t\t\t\t\t} else if (presence_type === 'unavailable' || info.type === 'unavailable') {\n\t\t\t\t\t\t\tif (!info.status) {\n\t\t\t\t\t\t\t\t// logout successfully.\n\t\t\t\t\t\t\t\tinfo.type = 'leaveChatRoom';\n\t\t\t\t\t\t\t} else if (info.code == 110) {\n\t\t\t\t\t\t\t\t// logout or dismissied by admin.\n\t\t\t\t\t\t\t\tinfo.type = 'leaveChatRoom';\n\t\t\t\t\t\t\t} else if (info.error && info.error.code == 406) {\n\t\t\t\t\t\t\t\t// The chat room is full.\n\t\t\t\t\t\t\t\tinfo.type = 'reachChatRoomCapacity';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tinfo.presence_type = presence_type;\n\t\t\t\t\tinfo.original_type = type;\n\n\t\t\t\t\tif (/subscribe/.test(info.type)) {\n\t\t\t\t\t\t//subscribe | subscribed | unsubscribe | unsubscribed\n\t\t\t\t\t} else if (type == \"\" && !info.status && !info.error && !isCreate && !isApply && !isMemberJoin && !isDecline) {\n\t\t\t\t\t\tconsole.log(2222222, msginfo, info, isApply);\n\t\t\t\t\t\t// info.type = 'joinPublicGroupSuccess';\n\t\t\t\t\t} else if (presence_type === 'unavailable' || type === 'unavailable') {\n\t\t\t\t\t\t// There is no roomtype when a chat room is deleted.\n\t\t\t\t\t\tif (info.destroy) {\n\t\t\t\t\t\t\t// Group or Chat room Deleted.\n\t\t\t\t\t\t\tinfo.type = 'deleteGroupChat';\n\t\t\t\t\t\t} else if (info.code == 307 || info.code == 321) {\n\t\t\t\t\t\t\t// Dismissed by group.\n\t\t\t\t\t\t\tvar nick = msginfo.getAttribute('nick');\n\t\t\t\t\t\t\tif (!nick) info.type = 'leaveGroup';else info.type = 'removedFromGroup';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.onPresence(info, msginfo);\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handlePing = function (e) {\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar id = e.getAttribute('id');\n\t\t\t\tvar from = e.getAttribute('from');\n\t\t\t\tvar to = e.getAttribute('to');\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: to,\n\t\t\t\t\tto: from,\n\t\t\t\t\tid: id,\n\t\t\t\t\ttype: 'result'\n\t\t\t\t});\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIq = function (iq) {\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIqPrivacy = function (msginfo) {\n\t\t\t\tvar list = msginfo.getElementsByTagName('list');\n\t\t\t\tif (list.length == 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.getBlacklist();\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleIqRoster = function (e) {\n\t\t\t\tvar id = e.getAttribute('id');\n\t\t\t\tvar from = e.getAttribute('from') || '';\n\t\t\t\tvar name = _parseNameFromJidFn(from);\n\t\t\t\tvar curJid = this.context.jid;\n\t\t\t\tvar curUser = this.context.userId;\n\n\t\t\t\tvar iqresult = $iq({ type: 'result', id: id, from: curJid });\n\t\t\t\tthis.sendCommand(iqresult.tree());\n\n\t\t\t\tvar msgBodies = e.getElementsByTagName('query');\n\t\t\t\tif (msgBodies && msgBodies.length > 0) {\n\t\t\t\t\tvar queryTag = msgBodies[0];\n\t\t\t\t\tvar rouster = _parseFriend(queryTag, this, from);\n\t\t\t\t\tthis.onRoster(rouster);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleMessage = function (msginfo) {\n\t\t\t\tvar self = this;\n\t\t\t\tif (this.isClosed()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar id = msginfo.getAttribute('id') || '';\n\n\t\t\t\t// cache ack into sendQueue first , handelSendQueue will do the send thing with the speed of 5/s\n\t\t\t\tthis.cacheReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t\tvar parseMsgData = _parseResponseMessage(msginfo);\n\t\t\t\tif (parseMsgData.errorMsg) {\n\t\t\t\t\tthis.handlePresence(msginfo);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// send error\n\t\t\t\tvar error = msginfo.getElementsByTagName('error');\n\t\t\t\tvar errorCode = '';\n\t\t\t\tvar errorText = '';\n\t\t\t\tvar errorBool = false;\n\t\t\t\tif (error.length > 0) {\n\t\t\t\t\terrorBool = true;\n\t\t\t\t\terrorCode = error[0].getAttribute('code');\n\t\t\t\t\tvar textDOM = error[0].getElementsByTagName('text');\n\t\t\t\t\terrorText = textDOM[0].textContent || textDOM[0].text;\n\t\t\t\t}\n\n\t\t\t\tvar msgDatas = parseMsgData.data;\n\t\t\t\tfor (var i in msgDatas) {\n\t\t\t\t\tif (!msgDatas.hasOwnProperty(i)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar msg = msgDatas[i];\n\t\t\t\t\tif (!msg.from || !msg.to) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar from = (msg.from + '').toLowerCase();\n\t\t\t\t\tvar too = (msg.to + '').toLowerCase();\n\t\t\t\t\tvar extmsg = msg.ext || {};\n\t\t\t\t\tvar chattype = '';\n\t\t\t\t\tvar typeEl = msginfo.getElementsByTagName('roomtype');\n\t\t\t\t\tif (typeEl.length) {\n\t\t\t\t\t\tchattype = typeEl[0].getAttribute('type') || 'chat';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchattype = msginfo.getAttribute('type') || 'chat';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar msgBodies = msg.bodies;\n\t\t\t\t\tif (!msgBodies || msgBodies.length == 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar msgBody = msg.bodies[0];\n\t\t\t\t\tvar type = msgBody.type;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\t\tcase 'txt':\n\t\t\t\t\t\t\t\tvar receiveMsg = msgBody.msg;\n\t\t\t\t\t\t\t\tif (self.encrypt.type === 'base64') {\n\t\t\t\t\t\t\t\t\treceiveMsg = atob(receiveMsg);\n\t\t\t\t\t\t\t\t} else if (self.encrypt.type === 'aes') {\n\t\t\t\t\t\t\t\t\tvar key = CryptoJS.enc.Utf8.parse(self.encrypt.key);\n\t\t\t\t\t\t\t\t\tvar iv = CryptoJS.enc.Utf8.parse(self.encrypt.iv);\n\t\t\t\t\t\t\t\t\tvar mode = self.encrypt.mode.toLowerCase();\n\t\t\t\t\t\t\t\t\tvar option = {};\n\t\t\t\t\t\t\t\t\tif (mode === 'cbc') {\n\t\t\t\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\t\t\t\tiv: iv,\n\t\t\t\t\t\t\t\t\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\t\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t} else if (mode === 'ebc') {\n\t\t\t\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\t\t\t\tmode: CryptoJS.mode.ECB,\n\t\t\t\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar encryptedBase64Str = receiveMsg;\n\t\t\t\t\t\t\t\t\tvar decryptedData = CryptoJS.AES.decrypt(encryptedBase64Str, key, option);\n\t\t\t\t\t\t\t\t\tvar decryptedStr = decryptedData.toString(CryptoJS.enc.Utf8);\n\t\t\t\t\t\t\t\t\treceiveMsg = decryptedStr;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar emojibody = _utils.parseTextMessage(receiveMsg, WebIM.Emoji);\n\t\t\t\t\t\t\t\tif (emojibody.isemoji) {\n\t\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp,\n\t\t\t\t\t\t\t\t\t\tdata: emojibody.body,\n\t\t\t\t\t\t\t\t\t\text: extmsg\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\t\tthis.onEmojiMessage(msg);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp,\n\t\t\t\t\t\t\t\t\t\tdata: receiveMsg,\n\t\t\t\t\t\t\t\t\t\text: extmsg\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\t\tthis.onTextMessage(msg);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'img':\n\t\t\t\t\t\t\t\tvar rwidth = 0;\n\t\t\t\t\t\t\t\tvar rheight = 0;\n\t\t\t\t\t\t\t\tif (msgBody.size) {\n\t\t\t\t\t\t\t\t\trwidth = msgBody.size.width;\n\t\t\t\t\t\t\t\t\trheight = msgBody.size.height;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tthumb: msgBody.thumb,\n\t\t\t\t\t\t\t\t\tthumb_secret: msgBody.thumb_secret,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length || '',\n\t\t\t\t\t\t\t\t\twidth: rwidth,\n\t\t\t\t\t\t\t\t\theight: rheight,\n\t\t\t\t\t\t\t\t\tfiletype: msgBody.filetype || '',\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onPictureMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'audio':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tlength: msgBody.length || '',\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length || '',\n\t\t\t\t\t\t\t\t\tfiletype: msgBody.filetype || '',\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onAudioMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length,\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onFileMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'loc':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\taddr: msgBody.addr,\n\t\t\t\t\t\t\t\t\tlat: msgBody.lat,\n\t\t\t\t\t\t\t\t\tlng: msgBody.lng,\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onLocationMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'video':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\ttype: chattype,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\n\t\t\t\t\t\t\t\t\turl: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf(\"/\", 9)) : msgBody.url,\n\t\t\t\t\t\t\t\t\tsecret: msgBody.secret,\n\t\t\t\t\t\t\t\t\tfilename: msgBody.filename,\n\t\t\t\t\t\t\t\t\tfile_length: msgBody.file_length,\n\t\t\t\t\t\t\t\t\taccessToken: this.context.accessToken || '',\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onVideoMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'cmd':\n\t\t\t\t\t\t\t\tvar msg = {\n\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\tfrom: from,\n\t\t\t\t\t\t\t\t\tto: too,\n\t\t\t\t\t\t\t\t\taction: msgBody.action,\n\t\t\t\t\t\t\t\t\text: extmsg,\n\t\t\t\t\t\t\t\t\tdelay: parseMsgData.delayTimeStamp\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t!msg.delay && delete msg.delay;\n\t\t\t\t\t\t\t\tmsg.error = errorBool;\n\t\t\t\t\t\t\t\tmsg.errorText = errorText;\n\t\t\t\t\t\t\t\tmsg.errorCode = errorCode;\n\t\t\t\t\t\t\t\tthis.onCmdMessage(msg);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t;\n\t\t\t\t\t\tif (self.delivery) {\n\t\t\t\t\t\t\tvar msgId = self.getUniqueId();\n\t\t\t\t\t\t\tvar bodyId = msg.id;\n\t\t\t\t\t\t\tvar deliverMessage = new WebIM.message('delivery', msgId);\n\t\t\t\t\t\t\tdeliverMessage.set({\n\t\t\t\t\t\t\t\tid: bodyId,\n\t\t\t\t\t\t\t\tto: msg.from\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tself.send(deliverMessage.body);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleDeliveredMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tvar body = message.getElementsByTagName('body');\n\t\t\t\tvar mid = 0;\n\t\t\t\tif (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML;\n\t\t\t\tvar msg = {\n\t\t\t\t\tmid: mid\n\t\t\t\t};\n\t\t\t\tthis.onDeliverdMessage(msg);\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleAckedMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tvar body = message.getElementsByTagName('body');\n\t\t\t\tvar mid = 0;\n\t\t\t\tif (isNaN(body[0].innerHTML)) mid = body[1].innerHTML;else mid = body[0].innerHTML;\n\t\t\t\tvar msg = {\n\t\t\t\t\tmid: mid\n\t\t\t\t};\n\t\t\t\tthis.onReadMessage(msg);\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleReceivedMessage = function (message) {\n\t\t\t\ttry {\n\t\t\t\t\tvar received = message.getElementsByTagName(\"received\");\n\t\t\t\t\tvar mid = received[0].getAttribute('mid');\n\t\t\t\t\tvar body = message.getElementsByTagName(\"body\");\n\t\t\t\t\tvar id = body[0].innerHTML;\n\t\t\t\t\tvar msg = {\n\t\t\t\t\t\tmid: mid,\n\t\t\t\t\t\tid: id\n\t\t\t\t\t};\n\t\t\t\t\tthis.onReceivedMessage(msg);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\tdata: e\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tvar rcv = message.getElementsByTagName('received'),\n\t\t\t\t id,\n\t\t\t\t mid;\n\n\t\t\t\tif (rcv.length > 0) {\n\t\t\t\t\tif (rcv[0].childNodes && rcv[0].childNodes.length > 0) {\n\t\t\t\t\t\tid = rcv[0].childNodes[0].nodeValue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tid = rcv[0].innerHTML || rcv[0].innerText;\n\t\t\t\t\t}\n\t\t\t\t\tmid = rcv[0].getAttribute('mid');\n\t\t\t\t}\n\n\t\t\t\tif (_msgHash[id]) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t_msgHash[id].msg.success instanceof Function && _msgHash[id].msg.success(id, mid);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tthis.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tdelete _msgHash[id];\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleInviteMessage = function (message) {\n\t\t\t\tvar form = null;\n\t\t\t\tvar invitemsg = message.getElementsByTagName('invite');\n\t\t\t\tvar reasonDom = message.getElementsByTagName('reason')[0];\n\t\t\t\tvar reasonMsg = reasonDom.textContent;\n\t\t\t\tvar id = message.getAttribute('id') || '';\n\t\t\t\tthis.sendReceiptsMessage({\n\t\t\t\t\tid: id\n\t\t\t\t});\n\n\t\t\t\tif (invitemsg && invitemsg.length > 0) {\n\t\t\t\t\tvar fromJid = invitemsg[0].getAttribute('from');\n\t\t\t\t\tform = _parseNameFromJidFn(fromJid);\n\t\t\t\t}\n\t\t\t\tvar xmsg = message.getElementsByTagName('x');\n\t\t\t\tvar roomid = null;\n\t\t\t\tif (xmsg && xmsg.length > 0) {\n\t\t\t\t\tfor (var i = 0; i < xmsg.length; i++) {\n\t\t\t\t\t\tif ('jabber:x:conference' === xmsg[i].namespaceURI) {\n\t\t\t\t\t\t\tvar roomjid = xmsg[i].getAttribute('jid');\n\t\t\t\t\t\t\troomid = _parseNameFromJidFn(roomjid);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.onInviteMessage({\n\t\t\t\t\ttype: 'invite',\n\t\t\t\t\tfrom: form,\n\t\t\t\t\troomid: roomid,\n\t\t\t\t\treason: reasonMsg\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.handleMutedMessage = function (message) {\n\t\t\t\tvar id = message.id;\n\t\t\t\tthis.onMutedMessage({\n\t\t\t\t\tmid: id\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * @private\n */\n\t\t\tconnection.prototype.sendCommand = function (dom, id) {\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.send(dom);\n\t\t\t\t} else {\n\t\t\t\t\tthis.unSendMsgArr.push(dom);\n\t\t\t\t\tif (!this.offLineSendConnecting && !this.logOut) {\n\t\t\t\t\t\tthis.offLineSendConnecting = true;\n\t\t\t\t\t\tthis.reconnect();\n\t\t\t\t\t}\n\t\t\t\t\tthis.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED,\n\t\t\t\t\t\treconnect: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * gen uuid with customized prefix\n * @param {String} prefix\n * @returns {string}\n */\n\t\t\tconnection.prototype.getUniqueId = function (prefix) {\n\t\t\t\t// fix: too frequently msg sending will make same id\n\t\t\t\tif (this.autoIncrement) {\n\t\t\t\t\tthis.autoIncrement++;\n\t\t\t\t} else {\n\t\t\t\t\tthis.autoIncrement = 1;\n\t\t\t\t}\n\t\t\t\tvar cdate = new Date();\n\t\t\t\tvar offdate = new Date(2010, 1, 1);\n\t\t\t\tvar offset = cdate.getTime() - offdate.getTime();\n\t\t\t\tvar hexd = parseFloat(offset).toString(16) + this.autoIncrement;\n\n\t\t\t\tif (typeof prefix === 'string' || typeof prefix === 'number') {\n\t\t\t\t\treturn prefix + '_' + hexd;\n\t\t\t\t} else {\n\t\t\t\t\treturn 'WEBIM_' + hexd;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * send message\n * @param {Object} messageSource\n */\n\t\t\tconnection.prototype.send = function (messageSource) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar message = messageSource;\n\t\t\t\tif (message.type === 'txt') {\n\t\t\t\t\tif (this.encrypt.type === 'base64') {\n\t\t\t\t\t\tmessage = _.clone(messageSource);\n\t\t\t\t\t\tmessage.msg = btoa(message.msg);\n\t\t\t\t\t} else if (this.encrypt.type === 'aes') {\n\t\t\t\t\t\tmessage = _.clone(messageSource);\n\t\t\t\t\t\tvar key = CryptoJS.enc.Utf8.parse(this.encrypt.key);\n\t\t\t\t\t\tvar iv = CryptoJS.enc.Utf8.parse(this.encrypt.iv);\n\t\t\t\t\t\tvar mode = this.encrypt.mode.toLowerCase();\n\t\t\t\t\t\tvar option = {};\n\t\t\t\t\t\tif (mode === 'cbc') {\n\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\tiv: iv,\n\t\t\t\t\t\t\t\tmode: CryptoJS.mode.CBC,\n\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if (mode === 'ebc') {\n\t\t\t\t\t\t\toption = {\n\t\t\t\t\t\t\t\tmode: CryptoJS.mode.ECB,\n\t\t\t\t\t\t\t\tpadding: CryptoJS.pad.Pkcs7\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar encryptedData = CryptoJS.AES.encrypt(message.msg, key, option);\n\n\t\t\t\t\t\tmessage.msg = encryptedData.toString();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.isWindowSDK) {\n\t\t\t\t\tWebIM.doQuery('{\"type\":\"sendMessage\",\"to\":\"' + message.to + '\",\"message_type\":\"' + message.type + '\",\"msg\":\"' + encodeURI(message.msg) + '\",\"chatType\":\"' + message.chatType + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\tdata: \"send\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttype: _code.WEBIM_MESSAGE_SED_ERROR\n\t\t\t\t\t\t};\n\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (Object.prototype.toString.call(message) === '[object Object]') {\n\t\t\t\t\t\tvar appKey = this.context.appKey || '';\n\t\t\t\t\t\tvar toJid = appKey + '_' + message.to + '@' + this.domain;\n\n\t\t\t\t\t\tif (message.group) {\n\t\t\t\t\t\t\ttoJid = appKey + '_' + message.to + '@conference.' + this.domain;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.resource) {\n\t\t\t\t\t\t\ttoJid = toJid + '/' + message.resource;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmessage.toJid = toJid;\n\t\t\t\t\t\tmessage.id = message.id || this.getUniqueId();\n\t\t\t\t\t\t_msgHash[message.id] = new _message(message);\n\t\t\t\t\t\t_msgHash[message.id].send(this);\n\t\t\t\t\t} else if (typeof message === 'string') {\n\t\t\t\t\t\t_msgHash[message] && _msgHash[message].send(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 添加联系人\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.addRoster = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar name = options.name || '';\n\t\t\t\tvar groups = options.groups || '';\n\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tiq.c('query', { xmlns: 'jabber:iq:roster' });\n\t\t\t\tiq.c('item', { jid: jid, name: name });\n\n\t\t\t\tif (groups) {\n\t\t\t\t\tfor (var i = 0; i < groups.length; i++) {\n\t\t\t\t\t\tiq.c('group').t(groups[i]).up();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || _utils.emptyfn;\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, error);\n\t\t\t};\n\n\t\t\t/**\n * 删除联系人\n * @param {Object} options\n */\n\t\t\tconnection.prototype.removeRoster = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar iq = $iq({ type: 'set' }).c('query', { xmlns: 'jabber:iq:roster' }).c('item', {\n\t\t\t\t\tjid: jid,\n\t\t\t\t\tsubscription: 'remove'\n\t\t\t\t});\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || _utils.emptyfn;\n\t\t\t\tthis.context.stropheConn.sendIQ(iq, suc, error);\n\t\t\t};\n\n\t\t\t/**\n * 获取联系人\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getRoster = function (options) {\n\t\t\t\tvar conn = this;\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: 'jabber:iq:roster' });\n\n\t\t\t\tvar options = options || {};\n\t\t\t\tvar suc = options.success || this.onRoster;\n\t\t\t\tvar completeFn = function completeFn(ele) {\n\t\t\t\t\tvar rouster = [];\n\t\t\t\t\tvar msgBodies = ele.getElementsByTagName('query');\n\t\t\t\t\tif (msgBodies && msgBodies.length > 0) {\n\t\t\t\t\t\tvar queryTag = msgBodies[0];\n\t\t\t\t\t\trouster = _parseFriend(queryTag);\n\t\t\t\t\t}\n\t\t\t\t\tsuc(rouster, ele);\n\t\t\t\t};\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROSTER_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), completeFn, failFn);\n\t\t\t\t} else {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 订阅\n * @param {Object} options\n */\n\t\t\tconnection.prototype.subscribe = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'subscribe' });\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tif (options.nick) {\n\t\t\t\t\tpres.c('nick', { 'xmlns': 'http://jabber.org/protocol/nick' }).t(options.nick);\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 订阅成功\n * @param {Object} options\n */\n\t\t\tconnection.prototype.subscribed = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'subscribed' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 取消订阅成功\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.unsubscribe = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'unsubscribe' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message);\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 取消订阅成功\n * @param {Object} options\n */\n\t\t\tconnection.prototype.unsubscribed = function (options) {\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar pres = $pres({ to: jid, type: 'unsubscribed' });\n\n\t\t\t\tif (options.message) {\n\t\t\t\t\tpres.c('status').t(options.message).up();\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\n\t\t\t/**\n * 加入公开群组\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.joinPublicGroup = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_JOINROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室列表\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.listRooms = function (options) {\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: options.server || 'conference.' + this.domain,\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.DISCO_ITEMS });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar rooms = [];\n\t\t\t\t\trooms = _parseRoom(result);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuc(rooms);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\terror({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOM_ERROR,\n\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室成员列表\n * @param {Object} options\n */\n\t\t\tconnection.prototype.queryRoomMember = function (options) {\n\t\t\t\tvar domain = this.domain;\n\t\t\t\tvar members = [];\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.MUC + '#admin' }).c('item', { affiliation: 'member' });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar items = result.getElementsByTagName('item');\n\n\t\t\t\t\tif (items) {\n\t\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\t\tvar mem = {\n\t\t\t\t\t\t\t\tjid: item.getAttribute('jid'),\n\t\t\t\t\t\t\t\taffiliation: 'member'\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tmembers.push(mem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsuc(members);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室信息\n * @param {Object} options\n */\n\t\t\tconnection.prototype.queryRoomInfo = function (options) {\n\t\t\t\tvar domain = this.domain;\n\t\t\t\tvar iq = $iq({\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', { xmlns: Strophe.NS.DISCO_INFO });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar members = [];\n\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar settings = '';\n\t\t\t\t\tvar features = result.getElementsByTagName('feature');\n\t\t\t\t\tif (features) {\n\t\t\t\t\t\tsettings = features[1].getAttribute('var') + '|' + features[3].getAttribute('var') + '|' + features[4].getAttribute('var');\n\t\t\t\t\t}\n\t\t\t\t\tswitch (settings) {\n\t\t\t\t\t\tcase 'muc_public|muc_membersonly|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PUBLIC_JOIN_APPROVAL';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_public|muc_open|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PUBLIC_JOIN_OPEN';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_hidden|muc_membersonly|muc_allowinvites':\n\t\t\t\t\t\t\tsettings = 'PRIVATE_MEMBER_INVITE';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'muc_hidden|muc_membersonly|muc_notallowinvites':\n\t\t\t\t\t\t\tsettings = 'PRIVATE_OWNER_INVITE';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar owner = '';\n\t\t\t\t\tvar fields = result.getElementsByTagName('field');\n\t\t\t\t\tvar fieldValues = {};\n\t\t\t\t\tif (fields) {\n\t\t\t\t\t\tfor (var i = 0; i < fields.length; i++) {\n\t\t\t\t\t\t\tvar field = fields[i];\n\t\t\t\t\t\t\tvar fieldVar = field.getAttribute('var');\n\t\t\t\t\t\t\tvar fieldSimplify = fieldVar.split('_')[1];\n\t\t\t\t\t\t\tswitch (fieldVar) {\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_occupants':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_maxusers':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_affiliations':\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_description':\n\t\t\t\t\t\t\t\t\tfieldValues[fieldSimplify] = field.textContent || field.text || '';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'muc#roominfo_owner':\n\t\t\t\t\t\t\t\t\tvar mem = {\n\t\t\t\t\t\t\t\t\t\tjid: (field.textContent || field.text) + '@' + domain,\n\t\t\t\t\t\t\t\t\t\taffiliation: 'owner'\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tmembers.push(mem);\n\t\t\t\t\t\t\t\t\tfieldValues[fieldSimplify] = field.textContent || field.text;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// if (field.getAttribute('label') === 'owner') {\n\t\t\t\t\t\t\t// var mem = {\n\t\t\t\t\t\t\t// jid: (field.textContent || field.text) + '@' + domain\n\t\t\t\t\t\t\t// , affiliation: 'owner'\n\t\t\t\t\t\t\t// };\n\t\t\t\t\t\t\t// members.push(mem);\n\t\t\t\t\t\t\t// break;\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfieldValues['name'] = result.getElementsByTagName('identity')[0].getAttribute('name');\n\t\t\t\t\t}\n\t\t\t\t\tsuc(settings, members, fieldValues);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMINFO_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室管理员\n * @param {Object} options\n * @deprecated\n */\n\t\t\tconnection.prototype.queryRoomOccupants = function (options) {\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar completeFn = function completeFn(result) {\n\t\t\t\t\tvar occupants = [];\n\t\t\t\t\toccupants = _parseRoomOccupants(result);\n\t\t\t\t\tsuc(occupants);\n\t\t\t\t};\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar attrs = {\n\t\t\t\t\txmlns: Strophe.NS.DISCO_ITEMS\n\t\t\t\t};\n\t\t\t\tvar info = $iq({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('query', attrs);\n\t\t\t\tthis.context.stropheConn.sendIQ(info.tree(), completeFn, errorFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @deprecated\n * @private\n */\n\t\t\tconnection.prototype.setUserSig = function (desc) {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tdesc = desc || '';\n\t\t\t\tdom.c('status').t(desc);\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tconnection.prototype.setPresence = function (type, status) {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tif (type) {\n\t\t\t\t\tif (status) {\n\t\t\t\t\t\tdom.c('show').t(type);\n\t\t\t\t\t\tdom.up().c('status').t(status);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdom.c('show').t(type);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.getPresence = function () {\n\t\t\t\tvar dom = $pres({ xmlns: 'jabber:client' });\n\t\t\t\tvar conn = this;\n\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.ping = function (options) {\n\t\t\t\tvar options = options || {};\n\t\t\t\tvar jid = _getJid(options, this);\n\n\t\t\t\tvar dom = $iq({\n\t\t\t\t\tfrom: this.context.jid || '',\n\t\t\t\t\tto: jid,\n\t\t\t\t\ttype: 'get'\n\t\t\t\t}).c('ping', { xmlns: 'urn:xmpp:ping' });\n\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar error = options.error || this.onError;\n\t\t\t\tvar failFn = function failFn(ele) {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_PING_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tif (this.isOpened()) {\n\t\t\t\t\tthis.context.stropheConn.sendIQ(dom.tree(), suc, failFn);\n\t\t\t\t} else {\n\t\t\t\t\terror({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_DISCONNECTED\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isOpened = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_OPENED;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isOpening = function () {\n\t\t\t\tvar status = this.context.status;\n\t\t\t\treturn status == _code.STATUS_DOLOGIN_USERGRID || status == _code.STATUS_DOLOGIN_IM;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isClosing = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_CLOSING;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.isClosed = function () {\n\t\t\t\treturn this.context.status == _code.STATUS_CLOSED;\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.clear = function () {\n\t\t\t\tvar key = this.context.appKey;\n\t\t\t\tif (this.errorType != _code.WEBIM_CONNCTION_DISCONNECTED) {\n\t\t\t\t\tif (this.logOut) {\n\t\t\t\t\t\tthis.unSendMsgArr = [];\n\t\t\t\t\t\tthis.offLineSendConnecting = false;\n\t\t\t\t\t\tthis.context = {\n\t\t\t\t\t\t\tstatus: _code.STATUS_INIT,\n\t\t\t\t\t\t\tappKey: key\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.intervalId) {\n\t\t\t\t\tclearInterval(this.intervalId);\n\t\t\t\t}\n\t\t\t\tthis.restIndex = 0;\n\t\t\t\tthis.xmppIndex = 0;\n\n\t\t\t\tif (this.errorType == _code.WEBIM_CONNCTION_CLIENT_LOGOUT || this.errorType == -1) {\n\t\t\t\t\tvar message = {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tdata: \"logout\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CLIENT_LOGOUT\n\t\t\t\t\t};\n\t\t\t\t\tthis.onError(message);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 获取聊天室列表\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getChatRooms = function (options) {\n\n\t\t\t\tvar conn = this,\n\t\t\t\t token = options.accessToken || this.context.accessToken;\n\n\t\t\t\tif (!_utils.isCanSetRequestHeader) {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (token) {\n\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\tvar appName = this.context.appName;\n\t\t\t\t\tvar orgName = this.context.orgName;\n\n\t\t\t\t\tif (!appName || !orgName) {\n\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AUTH_ERROR\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar suc = function suc(data, xhr) {\n\t\t\t\t\t\ttypeof options.success === 'function' && options.success(data);\n\t\t\t\t\t};\n\n\t\t\t\t\tvar error = function error(res, xhr, msg) {\n\t\t\t\t\t\tif (res.error && res.error_description) {\n\t\t\t\t\t\t\tconn.onError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,\n\t\t\t\t\t\t\t\tmsg: res.error_description,\n\t\t\t\t\t\t\t\tdata: res,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tvar pageInfo = {\n\t\t\t\t\t\tpagenum: parseInt(options.pagenum) || 1,\n\t\t\t\t\t\tpagesize: parseInt(options.pagesize) || 20\n\t\t\t\t\t};\n\n\t\t\t\t\tvar opts = {\n\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/chatrooms',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\theaders: { 'Authorization': 'Bearer ' + token },\n\t\t\t\t\t\tdata: pageInfo,\n\t\t\t\t\t\tsuccess: suc || _utils.emptyfn,\n\t\t\t\t\t\terror: error || _utils.emptyfn\n\t\t\t\t\t};\n\t\t\t\t\t_utils.ajax(opts);\n\t\t\t\t} else {\n\t\t\t\t\tconn.onError({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n * 加入聊天室\n * @param {Object} options\n */\n\t\t\tconnection.prototype.joinChatRoom = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_JOINCHATROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'member', role: 'participant' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * 退出聊天室\n * @param {Object} options\n */\n\t\t\tconnection.prototype.quitChatRoom = function (options) {\n\t\t\t\tvar roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain;\n\t\t\t\tvar room_nick = roomJid + '/' + this.context.userId;\n\t\t\t\tvar suc = options.success || _utils.emptyfn;\n\t\t\t\tvar err = options.error || _utils.emptyfn;\n\t\t\t\tvar errorFn = function errorFn(ele) {\n\t\t\t\t\terr({\n\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_QUITCHATROOM_ERROR,\n\t\t\t\t\t\tdata: ele\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tvar iq = $pres({\n\t\t\t\t\tfrom: this.context.jid,\n\t\t\t\t\tto: room_nick,\n\t\t\t\t\ttype: 'unavailable'\n\t\t\t\t}).c('x', { xmlns: Strophe.NS.MUC + '#user' }).c('item', { affiliation: 'none', role: 'none' }).up().up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), suc, errorFn);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar self = this;\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation\",\n\t\t\t\t\tmsg: info.user + \" invites you to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"acceptInvitationFromGroup\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"acceptInvitationFromGroup error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\treject: function reject() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"declineInvitationFromGroup\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"declineInvitationFromGroup error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteAcceptionFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation response\",\n\t\t\t\t\tmsg: info.user + \" agreed to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveInviteDeclineFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation response\",\n\t\t\t\t\tmsg: info.user + \" rejected to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onAutoAcceptInvitationFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group invitation\",\n\t\t\t\t\tmsg: \"You had joined into the group:\" + info.group_name + \" automatically.Inviter:\" + info.user,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onLeaveGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You have been out of the group:\" + info.group_id + \".Reason:\" + info.msg,\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveJoinGroupApplication = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar self = this;\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group join application\",\n\t\t\t\t\tmsg: info.user + \" applys to join into group:\" + info.group_id,\n\t\t\t\t\tagree: function agree() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"acceptJoinGroupApplication\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"acceptJoinGroupApplication error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\treject: function reject() {\n\t\t\t\t\t\tWebIM.doQuery('{\"type\":\"declineJoinGroupApplication\",\"id\":\"' + info.group_id + '\",\"user\":\"' + info.user + '\"}', function (response) {}, function (code, msg) {\n\t\t\t\t\t\t\tvar message = {\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tdata: \"declineJoinGroupApplication error:\" + msg\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tself.onError(message);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveAcceptionFromGroup = function (info) {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You had joined into the group:\" + info.group_name + \".\",\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onReceiveRejectionFromGroup = function () {\n\t\t\t\tinfo = eval('(' + info + ')');\n\t\t\t\tvar options = {\n\t\t\t\t\ttitle: \"Group notification\",\n\t\t\t\t\tmsg: \"You have been rejected to join into the group:\" + info.group_name + \".\",\n\t\t\t\t\tagree: function agree() {}\n\t\t\t\t};\n\t\t\t\tthis.onConfirmPop(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onUpdateMyGroupList = function (options) {\n\t\t\t\tthis.onUpdateMyGroupList(options);\n\t\t\t};\n\n\t\t\t/**\n * for windowSDK\n * @private\n *\n */\n\t\t\tconnection.prototype._onUpdateMyRoster = function (options) {\n\t\t\t\tthis.onUpdateMyRoster(options);\n\t\t\t};\n\n\t\t\t/**\n * @private\n *\n */\n\t\t\tconnection.prototype.reconnect = function () {\n\t\t\t\tvar that = this;\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t_login(that.context.restTokenData, that);\n\t\t\t\t}, (this.autoReconnectNumTotal == 0 ? 0 : this.autoReconnectInterval) * 1000);\n\t\t\t\tthis.autoReconnectNumTotal++;\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n * @deprecated\n */\n\t\t\tconnection.prototype.closed = function () {\n\t\t\t\tvar message = {\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tdata: \"Closed error\"\n\t\t\t\t\t},\n\t\t\t\t\ttype: _code.WEBIM_CONNECTION_CLOSED\n\t\t\t\t};\n\t\t\t\tthis.onError(message);\n\t\t\t};\n\n\t\t\t/**\n * used for blacklist\n * @private\n *\n */\n\t\t\tfunction _parsePrivacy(iq) {\n\t\t\t\tvar list = [];\n\t\t\t\tvar items = iq.getElementsByTagName('item');\n\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('value');\n\t\t\t\t\t\tvar order = item.getAttribute('order');\n\t\t\t\t\t\tvar type = item.getAttribute('type');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tlist[n] = {\n\t\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\t\torder: order,\n\t\t\t\t\t\t\tjid: jid,\n\t\t\t\t\t\t\tname: n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn list;\n\t\t\t};\n\n\t\t\t/**\n * 获取好友黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.getBlacklist = function (options) {\n\t\t\t\toptions = options || {};\n\t\t\t\tvar iq = $iq({ type: 'get' });\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar me = this;\n\n\t\t\t\tiq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (iq) {\n\t\t\t\t\tme.onBlacklistUpdate(_parsePrivacy(iq));\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\tme.onBlacklistUpdate([]);\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 加入好友黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.addToBlackList = function (options) {\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tvar blacklist = options.list || {};\n\t\t\t\tvar type = options.type || 'jid';\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tvar keys = Object.keys(blacklist);\n\t\t\t\tvar len = keys.length;\n\t\t\t\tvar order = 2;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar item = blacklist[keys[i]];\n\t\t\t\t\tvar type = item.type || 'jid';\n\t\t\t\t\tvar jid = item.jid;\n\n\t\t\t\t\tpiece = piece.c('item', { action: 'deny', order: order++, type: type, value: jid }).c('message');\n\t\t\t\t\tif (i !== len - 1) {\n\t\t\t\t\t\tpiece = piece.up().up();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// console.log('addToBlackList', blacklist, piece.tree());\n\t\t\t\tthis.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n * 从好友黑名单删除\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.removeFromBlackList = function (options) {\n\n\t\t\t\tvar iq = $iq({ type: 'set' });\n\t\t\t\tvar blacklist = options.list || {};\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'jabber:iq:privacy' }).c('list', { name: 'special' });\n\n\t\t\t\tvar keys = Object.keys(blacklist);\n\t\t\t\tvar len = keys.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar item = blacklist[keys[i]];\n\t\t\t\t\tvar type = item.type || 'jid';\n\t\t\t\t\tvar jid = item.jid;\n\t\t\t\t\tvar order = item.order;\n\n\t\t\t\t\tpiece = piece.c('item', { action: 'deny', order: order, type: type, value: jid }).c('message');\n\t\t\t\t\tif (i !== len - 1) {\n\t\t\t\t\t\tpiece = piece.up().up();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// console.log('removeFromBlackList', blacklist, piece.tree());\n\t\t\t\tthis.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tconnection.prototype._getGroupJid = function (to) {\n\t\t\t\tvar appKey = this.context.appKey || '';\n\t\t\t\treturn appKey + '_' + to + '@conference.' + this.domain;\n\t\t\t};\n\n\t\t\t/**\n * 加入群组黑名单\n * @param {Object} options\n *\n */\n\t\t\tconnection.prototype.addToGroupBlackList = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'outcast',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), sucFn, errFn);\n\t\t\t};\n\n\t\t\t/**\n *\n * @private\n */\n\t\t\tfunction _parseGroupBlacklist(iq) {\n\t\t\t\tvar list = {};\n\t\t\t\tvar items = iq.getElementsByTagName('item');\n\n\t\t\t\tif (items) {\n\t\t\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\t\t\tvar item = items[i];\n\t\t\t\t\t\tvar jid = item.getAttribute('jid');\n\t\t\t\t\t\tvar affiliation = item.getAttribute('affiliation');\n\t\t\t\t\t\tvar nick = item.getAttribute('nick');\n\t\t\t\t\t\tif (!jid) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar n = _parseNameFromJidFn(jid);\n\t\t\t\t\t\tlist[n] = {\n\t\t\t\t\t\t\tjid: jid,\n\t\t\t\t\t\t\taffiliation: affiliation,\n\t\t\t\t\t\t\tnick: nick,\n\t\t\t\t\t\t\tname: n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\n\t\t\t/**\n * 获取群组黑名单\n * @param {Object} options\n */\n\t\t\tconnection.prototype.getGroupBlacklist = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// var jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'get', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'outcast'\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn(_parseGroupBlacklist(msginfo));\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 从群组黑名单删除\n * @param {Object} options\n */\n\t\t\tconnection.prototype.removeGroupMemberFromBlacklist = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin'; //options.affiliation || 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 修改群名称\n *\n * @param {Object} options -\n * @example\n \n \n \n http://jabber.org/protocol/muc#roomconfig\n Room Name\n \n \n \n */\n\t\t\tconnection.prototype.changeGroupSubject = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar affiliation = 'owner';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('x', { type: 'submit', xmlns: 'jabber:x:data' }).c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up().c('field', { 'var': 'muc#roomconfig_roomname' }).c('value').t(options.subject).up().up().c('field', { 'var': 'muc#roomconfig_roomdesc' }).c('value').t(options.description);\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 删除群组\n *\n * @param {Object} options -\n * @example\n \n \n \n xxx destory group yyy\n \n \n \n */\n\t\t\tconnection.prototype.destroyGroup = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar affiliation = 'owner';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('destroy').c('reason').t(options.reason || '');\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msginfo) {\n\t\t\t\t\tsucFn();\n\t\t\t\t}, function () {\n\t\t\t\t\terrFn();\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 主动离开群组\n *\n * @param {Object} options -\n * @example\n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.leaveGroupBySelf = function (options) {\n\t\t\t\tvar self = this;\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\n\t\t\t\t// must be `owner`\n\t\t\t\tvar jid = _getJid(options, this);\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\n\t\t\t\tiq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation }).c('item', {\n\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\tjid: jid\n\t\t\t\t});\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t\tvar pres = $pres({ type: 'unavailable', to: to + '/' + self.context.userId });\n\t\t\t\t\tself.sendCommand(pres.tree());\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 被踢出群组\n *\n * @param {Object} options -\n * @example\n \n \n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.leaveGroup = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar list = options.list || [];\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation });\n\t\t\t\tvar keys = Object.keys(list);\n\t\t\t\tvar len = keys.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\tvar name = list[keys[i]];\n\t\t\t\t\tvar jid = _getJidByName(name, this);\n\n\t\t\t\t\tpiece = piece.c('item', {\n\t\t\t\t\t\taffiliation: 'none',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up().c('item', {\n\t\t\t\t\t\trole: 'none',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up();\n\t\t\t\t}\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 添加群组成员\n *\n * @param {Object} options -\n * @example\n Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发)\n \n \n \n \n liuwz invite you to join group '谢谢'\n \n \n \n \n \n \n \n \n \n */\n\t\t\tconnection.prototype.addGroupMembers = function (options) {\n\t\t\t\tvar sucFn = options.success || _utils.emptyfn;\n\t\t\t\tvar errFn = options.error || _utils.emptyfn;\n\t\t\t\tvar list = options.list || [];\n\t\t\t\tvar affiliation = 'admin';\n\t\t\t\tvar to = this._getGroupJid(options.roomId);\n\t\t\t\tvar iq = $iq({ type: 'set', to: to });\n\t\t\t\tvar piece = iq.c('query', { xmlns: 'http://jabber.org/protocol/muc#' + affiliation });\n\t\t\t\tvar len = list.length;\n\n\t\t\t\tfor (var i = 0; i < len; i++) {\n\n\t\t\t\t\tvar name = list[i];\n\t\t\t\t\tvar jid = _getJidByName(name, this);\n\n\t\t\t\t\tpiece = piece.c('item', {\n\t\t\t\t\t\taffiliation: 'member',\n\t\t\t\t\t\tjid: jid\n\t\t\t\t\t}).up();\n\n\t\t\t\t\tvar dom = $msg({\n\t\t\t\t\t\tto: to\n\t\t\t\t\t}).c('x', {\n\t\t\t\t\t\txmlns: 'http://jabber.org/protocol/muc#user'\n\t\t\t\t\t}).c('invite', {\n\t\t\t\t\t\tto: jid\n\t\t\t\t\t}).c('reason').t(options.reason || '');\n\n\t\t\t\t\tthis.sendCommand(dom.tree());\n\t\t\t\t}\n\n\t\t\t\tthis.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\tsucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\terrFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 接受加入申请\n *\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.acceptInviteFromGroup = function (options) {\n\t\t\t\toptions.success = function () {\n\t\t\t\t\t// then send sendAcceptInviteMessage\n\t\t\t\t\t// connection.prototype.sendAcceptInviteMessage(optoins);\n\t\t\t\t};\n\t\t\t\tthis.addGroupMembers(options);\n\t\t\t};\n\n\t\t\t/**\n * 拒绝入群申请\n * @param {Object} options -\n * @example\n throw request for now 暂时不处理,直接丢弃\n \t \n \n \n reject\n \n \n \n */\n\t\t\tconnection.prototype.rejectInviteFromGroup = function (options) {\n\t\t\t\t// var from = _getJidByName(options.from, this);\n\t\t\t\t// var dom = $msg({\n\t\t\t\t// from: from,\n\t\t\t\t// to: _getJidByName(options.to, this)\n\t\t\t\t// }).c('x', {\n\t\t\t\t// xmlns: 'http://jabber.org/protocol/muc#user'\n\t\t\t\t// }).c('apply', {\n\t\t\t\t// from: from,\n\t\t\t\t// to: this._getGroupJid(options.groupId),\n\t\t\t\t// toNick: options.groupName\n\t\t\t\t// }).c('reason').t(options.reason || '');\n\t\t\t\t//\n\t\t\t\t// this.sendCommand(dom.tree());\n\t\t\t};\n\n\t\t\t/**\n * 创建群组-异步\n * @param {Object} p -\n */\n\t\t\tconnection.prototype.createGroupAsync = function (p) {\n\t\t\t\tvar roomId = p.from;\n\t\t\t\tvar me = this;\n\t\t\t\tvar toRoom = this._getGroupJid(roomId);\n\t\t\t\tvar to = toRoom + '/' + this.context.userId;\n\t\t\t\tvar options = this.groupOption;\n\t\t\t\tvar suc = p.success || _utils.emptyfn;\n\n\t\t\t\t// Creating a Reserved Room\n\t\t\t\tvar iq = $iq({ type: 'get', to: toRoom }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });\n\n\t\t\t\t// Strophe.info('step 1 ----------');\n\t\t\t\t// Strophe.info(options);\n\t\t\t\tme.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\t// console.log(msgInfo);\n\n\t\t\t\t\t// for ie hack\n\t\t\t\t\tif ('setAttribute' in msgInfo) {\n\t\t\t\t\t\t// Strophe.info('step 3 ----------');\n\t\t\t\t\t\tvar x = msgInfo.getElementsByTagName('x')[0];\n\t\t\t\t\t\tx.setAttribute('type', 'submit');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Strophe.info('step 4 ----------');\n\t\t\t\t\t\tStrophe.forEachChild(msgInfo, 'x', function (field) {\n\t\t\t\t\t\t\tfield.setAttribute('type', 'submit');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tStrophe.info('step 5 ----------');\n\t\t\t\t\tStrophe.forEachChild(x, 'field', function (field) {\n\t\t\t\t\t\tvar fieldVar = field.getAttribute('var');\n\t\t\t\t\t\tvar valueDom = field.getElementsByTagName('value')[0];\n\t\t\t\t\t\tStrophe.info(fieldVar);\n\t\t\t\t\t\tswitch (fieldVar) {\n\t\t\t\t\t\t\tcase 'muc#roomconfig_maxusers':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.optionsMaxUsers || 200);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_roomname':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.subject || '');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_roomdesc':\n\t\t\t\t\t\t\t\t_setText(valueDom, options.description || '');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_publicroom':\n\t\t\t\t\t\t\t\t// public 1\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsPublic);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_membersonly':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsMembersOnly);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_moderatedroom':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsModerate);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_persistentroom':\n\t\t\t\t\t\t\t\t_setText(valueDom, 1);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowinvites':\n\t\t\t\t\t\t\t\t_setText(valueDom, +options.optionsAllowInvites);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowvisitornickchange':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'muc#roomconfig_allowvisitorstatus':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'allow_private_messages':\n\t\t\t\t\t\t\t\t_setText(valueDom, 0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'allow_private_messages_from_visitors':\n\t\t\t\t\t\t\t\t_setText(valueDom, 'nobody');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tvar iq = $iq({ to: toRoom, type: 'set' }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }).cnode(x);\n\n\t\t\t\t\tme.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) {\n\t\t\t\t\t\tme.addGroupMembers({\n\t\t\t\t\t\t\tlist: options.members,\n\t\t\t\t\t\t\troomId: roomId\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsuc(options);\n\t\t\t\t\t}, function (errInfo) {\n\t\t\t\t\t\t// errFn(errInfo);\n\t\t\t\t\t});\n\t\t\t\t\t// sucFn(msgInfo);\n\t\t\t\t}, function (errInfo) {\n\t\t\t\t\t// errFn(errInfo);\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**\n * 创建群组\n * @param {Object} options -\n * @example\n * 1. 创建申请 -> 得到房主身份\n * 2. 获取房主信息 -> 得到房间form\n * 3. 完善房间form -> 创建成功\n * 4. 添加房间成员\n * 5. 消息通知成员\n */\n\t\t\tconnection.prototype.createGroup = function (options) {\n\t\t\t\tthis.groupOption = options;\n\t\t\t\tvar roomId = +new Date();\n\t\t\t\tvar toRoom = this._getGroupJid(roomId);\n\t\t\t\tvar to = toRoom + '/' + this.context.userId;\n\n\t\t\t\tvar pres = $pres({ to: to }).c('x', { xmlns: 'http://jabber.org/protocol/muc' }).up().c('create', { xmlns: 'http://jabber.org/protocol/muc' }).up();\n\n\t\t\t\t// createGroupACK\n\t\t\t\tthis.sendCommand(pres.tree());\n\t\t\t};\n\t\t\t// 通过RestFul API接口创建群组\n\t\t\tconnection.prototype.createGroupNew = function (opt) {\n\t\t\t\topt.data.owner = this.user;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: JSON.stringify(opt.data),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = function (respData) {\n\t\t\t\t\topt.success(respData);\n\t\t\t\t\tthis.onCreateGroup(respData);\n\t\t\t\t}.bind(this);\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API屏蔽群组\n * @param {Object} options -\n */\n\t\t\tconnection.prototype.blockGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tgroupId = 'notification_ignore_' + groupId;\n\t\t\t\tvar data = {\n\t\t\t\t\tentities: []\n\t\t\t\t};\n\t\t\t\tdata.entities[0] = {};\n\t\t\t\tdata.entities[0][groupId] = true;\n\t\t\t\tvar options = {\n\t\t\t\t\ttype: 'PUT',\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user,\n\t\t\t\t\tdata: JSON.stringify(data),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API发出入群申请\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.joinGroup = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + opt.groupId + '/' + 'apply',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组列表\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.listGroups = function (opt) {\n\t\t\t\tvar requestData = [];\n\t\t\t\trequestData['limit'] = opt.limit;\n\t\t\t\trequestData['cursor'] = opt.cursor;\n\t\t\t\tif (!requestData['cursor']) delete requestData['cursor'];\n\t\t\t\tif (isNaN(opt.limit)) {\n\t\t\t\t\tthrow 'The parameter \\\"limit\\\" should be a number';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/publicchatgroups',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: requestData,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API根据groupid获取群组详情\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupInfo = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups/' + opt.groupId,\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API列出某用户所加入的所有群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroup = function (opt) {\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'users' + '/' + this.user + '/' + 'joined_chatgroups',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API列出群组的所有成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.listGroupMember = function (opt) {\n\t\t\t\tif (isNaN(opt.pageNum) || opt.pageNum <= 0) {\n\t\t\t\t\tthrow 'The parameter \\\"pageNum\\\" should be a positive number';\n\t\t\t\t\treturn;\n\t\t\t\t} else if (isNaN(opt.pageSize) || opt.pageSize <= 0) {\n\t\t\t\t\tthrow 'The parameter \\\"pageSize\\\" should be a positive number';\n\t\t\t\t\treturn;\n\t\t\t\t} else if (opt.groupId === null && typeof opt.groupId === 'undefined') {\n\t\t\t\t\tthrow 'The parameter \\\"groupId\\\" should be added';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar requestData = [],\n\t\t\t\t groupId = opt.groupId;\n\t\t\t\trequestData['pagenum'] = opt.pageNum;\n\t\t\t\trequestData['pagesize'] = opt.pageSize;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/users',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdata: requestData,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API禁止群用户发言\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.mute = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"usernames\": [opt.username],\n\t\t\t\t\t\"mute_duration\": opt.muteDuration\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t},\n\t\t\t\t\tdata: JSON.stringify(requestData)\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API取消对用户禁言\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeMute = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'mute' + '/' + username,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组下所有管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/admin',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组下所有被禁言成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getMuted = function (opt) {\n\t\t\t\tvar groupId = opt.groupId;\n\t\t\t\tvar options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/chatgroups' + '/' + groupId + '/mute',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API设置群管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.setAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\tnewadmin: opt.username\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin',\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API取消群管理员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeAdmin = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'admin' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API同意用户加入群\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.agreeJoinGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"applicant\": opt.applicant,\n\t\t\t\t\t\"verifyResult\": true,\n\t\t\t\t\t\"reason\": \"no clue\"\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API拒绝用户加入群\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.rejectJoinGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\t\"applicant\": opt.applicant,\n\t\t\t\t\t\"verifyResult\": false,\n\t\t\t\t\t\"reason\": \"no clue\"\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'apply_verify',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API添加用户至群组黑名单(单个)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.groupBlockSingle = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API添加用户至群组黑名单(批量)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.groupBlockMulti = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t usernames = opt.usernames,\n\t\t\t\t requestData = {\n\t\t\t\t\tusernames: usernames\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API将用户从群黑名单移除(单个)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeGroupBlockSingle = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API将用户从群黑名单移除(批量)\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeGroupBlockMulti = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username.join(','),\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API解散群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.dissolveGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '?version=v3',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API获取群组黑名单\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.getGroupBlacklistNew = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'blocks' + '/' + 'users',\n\t\t\t\t\ttype: 'GET',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API离开群组\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.quitGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'quit',\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API修改群信息\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.modifyGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t requestData = {\n\t\t\t\t\tgroupname: opt.groupName,\n\t\t\t\t\tdescription: opt.description\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId,\n\t\t\t\t\ttype: 'PUT',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API删除单个群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeSingleGroupMember = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t username = opt.username,\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + username,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API删除多个群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.removeMultiGroupMember = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t users = opt.users.join(','),\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'users' + '/' + users,\n\t\t\t\t\ttype: 'DELETE',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\t/**\n * 通过RestFul API邀请群成员\n * @param {Object} opt -\n */\n\t\t\tconnection.prototype.inviteToGroup = function (opt) {\n\t\t\t\tvar groupId = opt.groupId,\n\t\t\t\t users = opt.users,\n\t\t\t\t requestData = {\n\t\t\t\t\tusernames: users\n\t\t\t\t},\n\t\t\t\t options = {\n\t\t\t\t\turl: this.apiUrl + '/' + this.orgName + '/' + this.appName + '/' + 'chatgroups' + '/' + groupId + '/' + 'invite',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: JSON.stringify(requestData),\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Authorization': 'Bearer ' + this.token,\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\toptions.success = opt.success || _utils.emptyfn;\n\t\t\t\toptions.error = opt.error || _utils.emptyfn;\n\t\t\t\tWebIM.utils.ajax(options);\n\t\t\t};\n\n\t\t\tfunction _setText(valueDom, v) {\n\t\t\t\tif ('textContent' in valueDom) {\n\t\t\t\t\tvalueDom.textContent = v;\n\t\t\t\t} else if ('text' in valueDom) {\n\t\t\t\t\tvalueDom.text = v;\n\t\t\t\t} else {\n\t\t\t\t\t// Strophe.info('_setText 4 ----------');\n\t\t\t\t\t// valueDom.innerHTML = v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar WebIM = window.WebIM || {};\n\t\t\tWebIM.connection = connection;\n\t\t\tWebIM.utils = _utils;\n\t\t\tWebIM.statusCode = _code;\n\t\t\tWebIM.message = _msg.message;\n\t\t\tWebIM.doQuery = function (str, suc, fail) {\n\t\t\t\tif (typeof window.cefQuery === 'undefined') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twindow.cefQuery({\n\t\t\t\t\trequest: str,\n\t\t\t\t\tpersistent: false,\n\t\t\t\t\tonSuccess: suc,\n\t\t\t\t\tonFailure: fail\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t/**************************** debug ****************************/\n\t\t\tfunction logMessage(message) {\n\t\t\t\tWebIM && WebIM.config.isDebug && console.log(WebIM.utils.ts() + '[recv] ', message.data);\n\t\t\t}\n\n\t\t\tif (WebIM && WebIM.config.isDebug) {\n\t\t\t\tStrophe.Connection.prototype.rawOutput = function (data) {\n\t\t\t\t\tconsole.log('%c ' + WebIM.utils.ts() + '[send] ' + data, \"background-color: #e2f7da\");\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (WebIM && WebIM.config && WebIM.config.isSandBox) {\n\t\t\t\tWebIM.config.xmppURL = WebIM.config.xmppURL.replace('.easemob.', '-sandbox.easemob.');\n\t\t\t\tWebIM.config.apiURL = WebIM.config.apiURL.replace('.easemob.', '-sdb.easemob.');\n\t\t\t}\n\n\t\t\tmodule.exports = WebIM;\n\n\t\t\tif (false) {\n\t\t\t\tmodule.hot.accept();\n\t\t\t}\n\n\t\t\t/***/\n\t\t},\n\t\t/* 2 */\n\t\t/***/function (module, exports) {\n\n\t\t\t;\n\t\t\t(function () {\n\n\t\t\t\texports.code = {\n\t\t\t\t\tWEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0,\n\t\t\t\t\tWEBIM_CONNCTION_OPEN_ERROR: 1,\n\t\t\t\t\tWEBIM_CONNCTION_AUTH_ERROR: 2,\n\t\t\t\t\tWEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3,\n\t\t\t\t\tWEBIM_CONNCTION_ATTACH_ERROR: 4,\n\t\t\t\t\tWEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5,\n\t\t\t\t\tWEBIM_CONNCTION_REOPEN_ERROR: 6,\n\t\t\t\t\tWEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7, //7: client-side network offline (net::ERR_INTERNET_DISCONNECTED)\n\t\t\t\t\tWEBIM_CONNCTION_SERVER_ERROR: 8, //8: offline by multi login\n\t\t\t\t\tWEBIM_CONNCTION_IQ_ERROR: 9,\n\n\t\t\t\t\tWEBIM_CONNCTION_PING_ERROR: 10,\n\t\t\t\t\tWEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11,\n\t\t\t\t\tWEBIM_CONNCTION_GETROSTER_ERROR: 12,\n\t\t\t\t\tWEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13,\n\t\t\t\t\tWEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14,\n\t\t\t\t\tWEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15,\n\t\t\t\t\tWEBIM_CONNCTION_DISCONNECTED: 16, //16: server-side close the websocket connection\n\t\t\t\t\tWEBIM_CONNCTION_AJAX_ERROR: 17,\n\t\t\t\t\tWEBIM_CONNCTION_JOINROOM_ERROR: 18,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOM_ERROR: 19,\n\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMINFO_ERROR: 20,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21,\n\t\t\t\t\tWEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22,\n\t\t\t\t\tWEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23,\n\t\t\t\t\tWEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24,\n\t\t\t\t\tWEBIM_CONNCTION_JOINCHATROOM_ERROR: 25,\n\t\t\t\t\tWEBIM_CONNCTION_QUITCHATROOM_ERROR: 26,\n\t\t\t\t\tWEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27,\n\t\t\t\t\tWEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28,\n\t\t\t\t\tWEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29,\n\n\t\t\t\t\tWEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30,\n\t\t\t\t\tWEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31, //31: 处理下行消息出错 try/catch抛出异常\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_OFFLINE: 32, //32: client offline\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_LOGOUT: 33, //33: client logout\n\t\t\t\t\tWEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34, // 34: Over amount of the tabs a user opened in the same browser\n\t\t\t\t\tWEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35,\n\t\t\t\t\tWEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36,\n\t\t\t\t\tWEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37,\n\t\t\t\t\tWEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38,\n\t\t\t\t\tWEBIM_CONNECTION_CLOSED: 39,\n\n\t\t\t\t\tWEBIM_UPLOADFILE_BROWSER_ERROR: 100,\n\t\t\t\t\tWEBIM_UPLOADFILE_ERROR: 101,\n\t\t\t\t\tWEBIM_UPLOADFILE_NO_LOGIN: 102,\n\t\t\t\t\tWEBIM_UPLOADFILE_NO_FILE: 103,\n\n\t\t\t\t\tWEBIM_DOWNLOADFILE_ERROR: 200,\n\t\t\t\t\tWEBIM_DOWNLOADFILE_NO_LOGIN: 201,\n\t\t\t\t\tWEBIM_DOWNLOADFILE_BROWSER_ERROR: 202,\n\n\t\t\t\t\tWEBIM_MESSAGE_REC_TEXT: 300,\n\t\t\t\t\tWEBIM_MESSAGE_REC_TEXT_ERROR: 301,\n\t\t\t\t\tWEBIM_MESSAGE_REC_EMOTION: 302,\n\t\t\t\t\tWEBIM_MESSAGE_REC_PHOTO: 303,\n\t\t\t\t\tWEBIM_MESSAGE_REC_AUDIO: 304,\n\t\t\t\t\tWEBIM_MESSAGE_REC_AUDIO_FILE: 305,\n\t\t\t\t\tWEBIM_MESSAGE_REC_VEDIO: 306,\n\t\t\t\t\tWEBIM_MESSAGE_REC_VEDIO_FILE: 307,\n\t\t\t\t\tWEBIM_MESSAGE_REC_FILE: 308,\n\t\t\t\t\tWEBIM_MESSAGE_SED_TEXT: 309,\n\t\t\t\t\tWEBIM_MESSAGE_SED_EMOTION: 310,\n\t\t\t\t\tWEBIM_MESSAGE_SED_PHOTO: 311,\n\t\t\t\t\tWEBIM_MESSAGE_SED_AUDIO: 312,\n\t\t\t\t\tWEBIM_MESSAGE_SED_AUDIO_FILE: 313,\n\t\t\t\t\tWEBIM_MESSAGE_SED_VEDIO: 314,\n\t\t\t\t\tWEBIM_MESSAGE_SED_VEDIO_FILE: 315,\n\t\t\t\t\tWEBIM_MESSAGE_SED_FILE: 316,\n\t\t\t\t\tWEBIM_MESSAGE_SED_ERROR: 317,\n\n\t\t\t\t\tSTATUS_INIT: 400,\n\t\t\t\t\tSTATUS_DOLOGIN_USERGRID: 401,\n\t\t\t\t\tSTATUS_DOLOGIN_IM: 402,\n\t\t\t\t\tSTATUS_OPENED: 403,\n\t\t\t\t\tSTATUS_CLOSING: 404,\n\t\t\t\t\tSTATUS_CLOSED: 405,\n\t\t\t\t\tSTATUS_ERROR: 406\n\t\t\t\t};\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 3 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;\n\t\t\t(function () {\n\n\t\t\t\tvar EMPTYFN = function EMPTYFN() {};\n\t\t\t\tvar _code = __webpack_require__(2).code;\n\t\t\t\tvar WEBIM_FILESIZE_LIMIT = 10485760;\n\n\t\t\t\tvar _createStandardXHR = function _createStandardXHR() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn new window.XMLHttpRequest();\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tvar _createActiveXHR = function _createActiveXHR() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn new window.ActiveXObject('Microsoft.XMLHTTP');\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tvar _xmlrequest = function _xmlrequest(crossDomain) {\n\t\t\t\t\tcrossDomain = crossDomain || true;\n\t\t\t\t\tvar temp = _createStandardXHR() || _createActiveXHR();\n\n\t\t\t\t\tif ('withCredentials' in temp) {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tif (!crossDomain) {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof window.XDomainRequest === 'undefined') {\n\t\t\t\t\t\treturn temp;\n\t\t\t\t\t}\n\t\t\t\t\tvar xhr = new XDomainRequest();\n\t\t\t\t\txhr.readyState = 0;\n\t\t\t\t\txhr.status = 100;\n\t\t\t\t\txhr.onreadystatechange = EMPTYFN;\n\t\t\t\t\txhr.onload = function () {\n\t\t\t\t\t\txhr.readyState = 4;\n\t\t\t\t\t\txhr.status = 200;\n\n\t\t\t\t\t\tvar xmlDoc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\t\t\txmlDoc.async = 'false';\n\t\t\t\t\t\txmlDoc.loadXML(xhr.responseText);\n\t\t\t\t\t\txhr.responseXML = xmlDoc;\n\t\t\t\t\t\txhr.response = xhr.responseText;\n\t\t\t\t\t\txhr.onreadystatechange();\n\t\t\t\t\t};\n\t\t\t\t\txhr.ontimeout = xhr.onerror = function () {\n\t\t\t\t\t\txhr.readyState = 4;\n\t\t\t\t\t\txhr.status = 500;\n\t\t\t\t\t\txhr.onreadystatechange();\n\t\t\t\t\t};\n\t\t\t\t\treturn xhr;\n\t\t\t\t};\n\n\t\t\t\tvar _hasFlash = function () {\n\t\t\t\t\tif ('ActiveXObject' in window) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treturn new ActiveXObject('ShockwaveFlash.ShockwaveFlash');\n\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (navigator.plugins && navigator.plugins.length > 0) {\n\t\t\t\t\t\t\treturn navigator.plugins['Shockwave Flash'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}();\n\n\t\t\t\tvar _tmpUtilXHR = _xmlrequest(),\n\t\t\t\t _hasFormData = typeof FormData !== 'undefined',\n\t\t\t\t _hasBlob = typeof Blob !== 'undefined',\n\t\t\t\t _isCanSetRequestHeader = _tmpUtilXHR.setRequestHeader || false,\n\t\t\t\t _hasOverrideMimeType = _tmpUtilXHR.overrideMimeType || false,\n\t\t\t\t _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData,\n\t\t\t\t _isCanUploadFile = _isCanUploadFileAsync || _hasFlash,\n\t\t\t\t _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType);\n\n\t\t\t\tif (!Object.keys) {\n\t\t\t\t\tObject.keys = function () {\n\t\t\t\t\t\t'use strict';\n\n\t\t\t\t\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\n\t\t\t\t\t\t hasDontEnumBug = !{ toString: null }.propertyIsEnumerable('toString'),\n\t\t\t\t\t\t dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],\n\t\t\t\t\t\t dontEnumsLength = dontEnums.length;\n\n\t\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\t\tif ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && (typeof obj !== 'function' || obj === null)) {\n\t\t\t\t\t\t\t\tthrow new TypeError('Object.keys called on non-object');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar result = [],\n\t\t\t\t\t\t\t prop,\n\t\t\t\t\t\t\t i;\n\n\t\t\t\t\t\t\tfor (prop in obj) {\n\t\t\t\t\t\t\t\tif (hasOwnProperty.call(obj, prop)) {\n\t\t\t\t\t\t\t\t\tresult.push(prop);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hasDontEnumBug) {\n\t\t\t\t\t\t\t\tfor (i = 0; i < dontEnumsLength; i++) {\n\t\t\t\t\t\t\t\t\tif (hasOwnProperty.call(obj, dontEnums[i])) {\n\t\t\t\t\t\t\t\t\t\tresult.push(dontEnums[i]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\t\t\t\t}\n\n\t\t\t\tvar utils = {\n\t\t\t\t\thasFormData: _hasFormData,\n\n\t\t\t\t\thasBlob: _hasBlob,\n\n\t\t\t\t\temptyfn: EMPTYFN,\n\n\t\t\t\t\tisCanSetRequestHeader: _isCanSetRequestHeader,\n\n\t\t\t\t\thasOverrideMimeType: _hasOverrideMimeType,\n\n\t\t\t\t\tisCanUploadFileAsync: _isCanUploadFileAsync,\n\n\t\t\t\t\tisCanUploadFile: _isCanUploadFile,\n\n\t\t\t\t\tisCanDownLoadFile: _isCanDownLoadFile,\n\n\t\t\t\t\tisSupportWss: function () {\n\t\t\t\t\t\tvar notSupportList = [\n\t\t\t\t\t\t//1: QQ browser X5 core\n\t\t\t\t\t\t/MQQBrowser[\\/]5([.]\\d+)?\\sTBS/\n\n\t\t\t\t\t\t//2: etc.\n\t\t\t\t\t\t//...\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (!window.WebSocket) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar ua = window.navigator.userAgent;\n\t\t\t\t\t\tfor (var i = 0, l = notSupportList.length; i < l; i++) {\n\t\t\t\t\t\t\tif (notSupportList[i].test(ua)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}(),\n\n\t\t\t\t\tgetIEVersion: function () {\n\t\t\t\t\t\tvar ua = navigator.userAgent,\n\t\t\t\t\t\t matches,\n\t\t\t\t\t\t tridentMap = { '4': 8, '5': 9, '6': 10, '7': 11 };\n\n\t\t\t\t\t\tmatches = ua.match(/MSIE (\\d+)/i);\n\n\t\t\t\t\t\tif (matches && matches[1]) {\n\t\t\t\t\t\t\treturn +matches[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatches = ua.match(/Trident\\/(\\d+)/i);\n\t\t\t\t\t\tif (matches && matches[1]) {\n\t\t\t\t\t\t\treturn tridentMap[matches[1]] || null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}(),\n\n\t\t\t\t\tstringify: function stringify(json) {\n\t\t\t\t\t\tif (typeof JSON !== 'undefined' && JSON.stringify) {\n\t\t\t\t\t\t\treturn JSON.stringify(json);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar s = '',\n\t\t\t\t\t\t\t arr = [];\n\n\t\t\t\t\t\t\tvar iterate = function iterate(json) {\n\t\t\t\t\t\t\t\tvar isArr = false;\n\n\t\t\t\t\t\t\t\tif (Object.prototype.toString.call(json) === '[object Array]') {\n\t\t\t\t\t\t\t\t\tarr.push(']', '[');\n\t\t\t\t\t\t\t\t\tisArr = true;\n\t\t\t\t\t\t\t\t} else if (Object.prototype.toString.call(json) === '[object Object]') {\n\t\t\t\t\t\t\t\t\tarr.push('}', '{');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tfor (var o in json) {\n\t\t\t\t\t\t\t\t\tif (Object.prototype.toString.call(json[o]) === '[object Null]') {\n\t\t\t\t\t\t\t\t\t\tjson[o] = 'null';\n\t\t\t\t\t\t\t\t\t} else if (Object.prototype.toString.call(json[o]) === '[object Undefined]') {\n\t\t\t\t\t\t\t\t\t\tjson[o] = 'undefined';\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (json[o] && _typeof(json[o]) === 'object') {\n\t\t\t\t\t\t\t\t\t\ts += ',' + (isArr ? '' : '\"' + o + '\":' + (isArr ? '\"' : '')) + iterate(json[o]) + '';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\ts += ',\"' + (isArr ? '' : o + '\":\"') + json[o] + '\"';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (s != '') {\n\t\t\t\t\t\t\t\t\ts = s.slice(1);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn arr.pop() + s + arr.pop();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn iterate(json);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tlogin: function login(options) {\n\t\t\t\t\t\tvar options = options || {};\n\t\t\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\t\t\tvar err = options.error || EMPTYFN;\n\n\t\t\t\t\t\tvar appKey = options.appKey || '';\n\t\t\t\t\t\tvar devInfos = appKey.split('#');\n\t\t\t\t\t\tif (devInfos.length !== 2) {\n\t\t\t\t\t\t\terr({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar orgName = devInfos[0];\n\t\t\t\t\t\tvar appName = devInfos[1];\n\t\t\t\t\t\tvar https = https || options.https;\n\t\t\t\t\t\tvar user = options.user || '';\n\t\t\t\t\t\tvar pwd = options.pwd || '';\n\n\t\t\t\t\t\tvar apiUrl = options.apiUrl;\n\n\t\t\t\t\t\tvar loginJson = {\n\t\t\t\t\t\t\tgrant_type: 'password',\n\t\t\t\t\t\t\tusername: user,\n\t\t\t\t\t\t\tpassword: pwd,\n\t\t\t\t\t\t\ttimestamp: +new Date()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar loginfo = utils.stringify(loginJson);\n\n\t\t\t\t\t\tvar options = {\n\t\t\t\t\t\t\turl: apiUrl + '/' + orgName + '/' + appName + '/token',\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tdata: loginfo,\n\t\t\t\t\t\t\tsuccess: suc,\n\t\t\t\t\t\t\terror: err\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn utils.ajax(options);\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileUrl: function getFileUrl(fileInputId) {\n\t\t\t\t\t\tvar uri = {\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tfilename: '',\n\t\t\t\t\t\t\tfiletype: '',\n\t\t\t\t\t\t\tdata: ''\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar fileObj = typeof fileInputId === 'string' ? document.getElementById(fileInputId) : fileInputId;\n\n\t\t\t\t\t\tif (!utils.isCanUploadFileAsync || !fileObj) {\n\t\t\t\t\t\t\treturn uri;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (window.URL.createObjectURL) {\n\t\t\t\t\t\t\t\tvar fileItems = fileObj.files;\n\t\t\t\t\t\t\t\tif (fileItems.length > 0) {\n\t\t\t\t\t\t\t\t\tvar u = fileItems.item(0);\n\t\t\t\t\t\t\t\t\turi.data = u;\n\t\t\t\t\t\t\t\t\turi.url = window.URL.createObjectURL(u);\n\t\t\t\t\t\t\t\t\turi.filename = u.name || '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// IE\n\t\t\t\t\t\t\t\tvar u = document.getElementById(fileInputId).value;\n\t\t\t\t\t\t\t\turi.url = u;\n\t\t\t\t\t\t\t\tvar pos1 = u.lastIndexOf('/');\n\t\t\t\t\t\t\t\tvar pos2 = u.lastIndexOf('\\\\');\n\t\t\t\t\t\t\t\tvar pos = Math.max(pos1, pos2);\n\t\t\t\t\t\t\t\tif (pos < 0) uri.filename = u;else uri.filename = u.substring(pos + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar index = uri.filename.lastIndexOf('.');\n\t\t\t\t\t\t\tif (index != -1) {\n\t\t\t\t\t\t\t\turi.filetype = uri.filename.substring(index + 1).toLowerCase();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn uri;\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthrow e;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileSize: function getFileSize(file) {\n\t\t\t\t\t\tvar fileSize = this.getFileLength(file);\n\t\t\t\t\t\tif (fileSize > 10000000) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar kb = Math.round(fileSize / 1000);\n\t\t\t\t\t\tif (kb < 1000) {\n\t\t\t\t\t\t\tfileSize = kb + ' KB';\n\t\t\t\t\t\t} else if (kb >= 1000) {\n\t\t\t\t\t\t\tvar mb = kb / 1000;\n\t\t\t\t\t\t\tif (mb < 1000) {\n\t\t\t\t\t\t\t\tfileSize = mb.toFixed(1) + ' MB';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar gb = mb / 1000;\n\t\t\t\t\t\t\t\tfileSize = gb.toFixed(1) + ' GB';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fileSize;\n\t\t\t\t\t},\n\n\t\t\t\t\tgetFileLength: function getFileLength(file) {\n\t\t\t\t\t\tvar fileLength = 0;\n\t\t\t\t\t\tif (file) {\n\t\t\t\t\t\t\tif (file.files) {\n\t\t\t\t\t\t\t\tif (file.files.length > 0) {\n\t\t\t\t\t\t\t\t\tfileLength = file.files[0].size;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (file.select && 'ActiveXObject' in window) {\n\t\t\t\t\t\t\t\tfile.select();\n\t\t\t\t\t\t\t\tvar fileobject = new ActiveXObject('Scripting.FileSystemObject');\n\t\t\t\t\t\t\t\tvar file = fileobject.GetFile(file.value);\n\t\t\t\t\t\t\t\tfileLength = file.Size;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fileLength;\n\t\t\t\t\t},\n\n\t\t\t\t\thasFlash: _hasFlash,\n\n\t\t\t\t\ttrim: function trim(str) {\n\n\t\t\t\t\t\tstr = typeof str === 'string' ? str : '';\n\n\t\t\t\t\t\treturn str.trim ? str.trim() : str.replace(/^\\s|\\s$/g, '');\n\t\t\t\t\t},\n\n\t\t\t\t\tparseEmoji: function parseEmoji(msg) {\n\t\t\t\t\t\tif (typeof WebIM.Emoji === 'undefined' || typeof WebIM.Emoji.map === 'undefined') {\n\t\t\t\t\t\t\treturn msg;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar emoji = WebIM.Emoji,\n\t\t\t\t\t\t\t reg = null;\n\n\t\t\t\t\t\t\tfor (var face in emoji.map) {\n\t\t\t\t\t\t\t\tif (emoji.map.hasOwnProperty(face)) {\n\t\t\t\t\t\t\t\t\twhile (msg.indexOf(face) > -1) {\n\t\t\t\t\t\t\t\t\t\tmsg = msg.replace(face, '');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn msg;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\tparseLink: function parseLink(msg) {\n\n\t\t\t\t\t\tvar reg = /(https?\\:\\/\\/|www\\.)([a-zA-Z0-9-]+(\\.[a-zA-Z0-9]+)+)(\\:[0-9]{2,4})?\\/?((\\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\\/?)*\\??[:_#@*&%0-9a-zA-Z-/=]*/gm;\n\n\t\t\t\t\t\tmsg = msg.replace(reg, function (v) {\n\n\t\t\t\t\t\t\tvar prefix = /^https?/gm.test(v);\n\n\t\t\t\t\t\t\treturn \"
\" + v + \"\";\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn msg;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseJSON: function parseJSON(data) {\n\n\t\t\t\t\t\tif (window.JSON && window.JSON.parse) {\n\t\t\t\t\t\t\treturn window.JSON.parse(data + '');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar requireNonComma,\n\t\t\t\t\t\t depth = null,\n\t\t\t\t\t\t str = utils.trim(data + '');\n\n\t\t\t\t\t\treturn str && !utils.trim(str.replace(/(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g, function (token, comma, open, close) {\n\n\t\t\t\t\t\t\tif (requireNonComma && comma) {\n\t\t\t\t\t\t\t\tdepth = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\t\treturn token;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trequireNonComma = open || comma;\n\t\t\t\t\t\t\tdepth += !close - !open;\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t})) ? Function('return ' + str)() : Function('Invalid JSON: ' + data)();\n\t\t\t\t\t},\n\n\t\t\t\t\tparseUploadResponse: function parseUploadResponse(response) {\n\t\t\t\t\t\treturn response.indexOf('callback') > -1 ? //lte ie9\n\t\t\t\t\t\tresponse.slice(9, -1) : response;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseDownloadResponse: function parseDownloadResponse(response) {\n\t\t\t\t\t\treturn response && response.type && response.type === 'application/json' || 0 > Object.prototype.toString.call(response).indexOf('Blob') ? this.url + '?token=' : window.URL.createObjectURL(response);\n\t\t\t\t\t},\n\n\t\t\t\t\tuploadFile: function uploadFile(options) {\n\t\t\t\t\t\tvar options = options || {};\n\t\t\t\t\t\toptions.onFileUploadProgress = options.onFileUploadProgress || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadComplete = options.onFileUploadComplete || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadError = options.onFileUploadError || EMPTYFN;\n\t\t\t\t\t\toptions.onFileUploadCanceled = options.onFileUploadCanceled || EMPTYFN;\n\n\t\t\t\t\t\tvar acc = options.accessToken || this.context.accessToken;\n\t\t\t\t\t\tif (!acc) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_NO_LOGIN,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar orgName, appName, devInfos;\n\t\t\t\t\t\tvar appKey = options.appKey || this.context.appKey || '';\n\n\t\t\t\t\t\tif (appKey) {\n\t\t\t\t\t\t\tdevInfos = appKey.split('#');\n\t\t\t\t\t\t\torgName = devInfos[0];\n\t\t\t\t\t\t\tappName = devInfos[1];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!orgName && !appName) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar apiUrl = options.apiUrl;\n\t\t\t\t\t\tvar uploadUrl = apiUrl + '/' + orgName + '/' + appName + '/chatfiles';\n\n\t\t\t\t\t\tif (!utils.isCanUploadFileAsync) {\n\t\t\t\t\t\t\tif (utils.hasFlash && typeof options.flashUpload === 'function') {\n\t\t\t\t\t\t\t\toptions.flashUpload && options.flashUpload(uploadUrl, options);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_BROWSER_ERROR,\n\t\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar fileSize = options.file.data ? options.file.data.size : undefined;\n\t\t\t\t\t\tif (fileSize > WEBIM_FILESIZE_LIMIT) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else if (fileSize <= 0) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\t\t\t\t\t\tvar onError = function onError(e) {\n\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (xhr.upload) {\n\t\t\t\t\t\t\txhr.upload.addEventListener('progress', options.onFileUploadProgress, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (xhr.addEventListener) {\n\t\t\t\t\t\t\txhr.addEventListener('abort', options.onFileUploadCanceled, false);\n\t\t\t\t\t\t\txhr.addEventListener('load', function (e) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadComplete(json);\n\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t\txhr.addEventListener('error', onError, false);\n\t\t\t\t\t\t} else if (xhr.onreadystatechange) {\n\t\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\t\tif (ajax.status === 200) {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\toptions.onFileUploadComplete(json);\n\t\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toptions.onFileUploadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_UPLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText,\n\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t\t\toptions.onFileUploadCanceled();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\txhr.open('POST', uploadUrl);\n\n\t\t\t\t\t\txhr.setRequestHeader('restrict-access', 'true');\n\t\t\t\t\t\txhr.setRequestHeader('Accept', '*/*'); // Android QQ browser has some problem with this attribute.\n\t\t\t\t\t\txhr.setRequestHeader('Authorization', 'Bearer ' + acc);\n\n\t\t\t\t\t\tvar formData = new FormData();\n\t\t\t\t\t\tformData.append('file', options.file.data);\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(formData);\n\t\t\t\t\t},\n\n\t\t\t\t\tdownload: function download(options) {\n\t\t\t\t\t\toptions.onFileDownloadComplete = options.onFileDownloadComplete || EMPTYFN;\n\t\t\t\t\t\toptions.onFileDownloadError = options.onFileDownloadError || EMPTYFN;\n\n\t\t\t\t\t\tvar accessToken = options.accessToken || this.context.accessToken;\n\t\t\t\t\t\tif (!accessToken) {\n\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_NO_LOGIN,\n\t\t\t\t\t\t\t\tid: options.id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar onError = function onError(e) {\n\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!utils.isCanDownLoadFile) {\n\t\t\t\t\t\t\toptions.onFileDownloadComplete();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\t\t\t\t\t\tif ('addEventListener' in xhr) {\n\t\t\t\t\t\t\txhr.addEventListener('load', function (e) {\n\t\t\t\t\t\t\t\toptions.onFileDownloadComplete(xhr.response, xhr);\n\t\t\t\t\t\t\t}, false);\n\t\t\t\t\t\t\txhr.addEventListener('error', onError, false);\n\t\t\t\t\t\t} else if ('onreadystatechange' in xhr) {\n\t\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\t\tif (ajax.status === 200) {\n\t\t\t\t\t\t\t\t\t\toptions.onFileDownloadComplete(xhr.response, xhr);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t\t\toptions.onFileDownloadError({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_DOWNLOADFILE_ERROR,\n\t\t\t\t\t\t\t\t\t\tid: options.id,\n\t\t\t\t\t\t\t\t\t\txhr: xhr\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar method = options.method || 'GET';\n\t\t\t\t\t\tvar resType = options.responseType || 'blob';\n\t\t\t\t\t\tvar mimeType = options.mimeType || 'text/plain; charset=x-user-defined';\n\t\t\t\t\t\txhr.open(method, options.url);\n\t\t\t\t\t\tif (typeof Blob !== 'undefined') {\n\t\t\t\t\t\t\txhr.responseType = resType;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\txhr.overrideMimeType(mimeType);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar innerHeaer = {\n\t\t\t\t\t\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t\t\t\t\t\t'Accept': 'application/octet-stream',\n\t\t\t\t\t\t\t'share-secret': options.secret,\n\t\t\t\t\t\t\t'Authorization': 'Bearer ' + accessToken\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar headers = options.headers || {};\n\t\t\t\t\t\tfor (var key in headers) {\n\t\t\t\t\t\t\tinnerHeaer[key] = headers[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var key in innerHeaer) {\n\t\t\t\t\t\t\tif (innerHeaer[key]) {\n\t\t\t\t\t\t\t\txhr.setRequestHeader(key, innerHeaer[key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(null);\n\t\t\t\t\t},\n\n\t\t\t\t\tparseTextMessage: function parseTextMessage(message, faces) {\n\t\t\t\t\t\tif (typeof message !== 'string') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (Object.prototype.toString.call(faces) !== '[object Object]') {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar receiveMsg = message;\n\t\t\t\t\t\tvar emessage = [];\n\t\t\t\t\t\tvar expr = /\\[[^[\\]]{2,3}\\]/mg;\n\t\t\t\t\t\tvar emoji = receiveMsg.match(expr);\n\n\t\t\t\t\t\tif (!emoji || emoji.length < 1) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar isemoji = false;\n\t\t\t\t\t\tfor (var i = 0; i < emoji.length; i++) {\n\t\t\t\t\t\t\tvar tmsg = receiveMsg.substring(0, receiveMsg.indexOf(emoji[i])),\n\t\t\t\t\t\t\t existEmoji = WebIM.Emoji.map[emoji[i]];\n\n\t\t\t\t\t\t\tif (tmsg) {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: tmsg\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!existEmoji) {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: emoji[i]\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar emojiStr = WebIM.Emoji.map ? WebIM.Emoji.path + existEmoji : null;\n\n\t\t\t\t\t\t\tif (emojiStr) {\n\t\t\t\t\t\t\t\tisemoji = true;\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'emoji',\n\t\t\t\t\t\t\t\t\tdata: emojiStr\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\t\tdata: emoji[i]\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar restMsgIndex = receiveMsg.indexOf(emoji[i]) + emoji[i].length;\n\t\t\t\t\t\t\treceiveMsg = receiveMsg.substring(restMsgIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (receiveMsg) {\n\t\t\t\t\t\t\temessage.push({\n\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\tdata: receiveMsg\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isemoji) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tisemoji: isemoji,\n\t\t\t\t\t\t\t\tbody: emessage\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tisemoji: false,\n\t\t\t\t\t\t\tbody: [{\n\t\t\t\t\t\t\t\ttype: 'txt',\n\t\t\t\t\t\t\t\tdata: message\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\n\t\t\t\t\tparseUri: function parseUri() {\n\t\t\t\t\t\tvar pattern = /([^\\?|&])\\w+=([^&]+)/g;\n\t\t\t\t\t\tvar uri = {};\n\t\t\t\t\t\tif (window.location.search) {\n\t\t\t\t\t\t\tvar args = window.location.search.match(pattern);\n\t\t\t\t\t\t\tfor (var i in args) {\n\t\t\t\t\t\t\t\tvar str = args[i];\n\t\t\t\t\t\t\t\tvar eq = str.indexOf('=');\n\t\t\t\t\t\t\t\tvar key = str.substr(0, eq);\n\t\t\t\t\t\t\t\tvar value = str.substr(eq + 1);\n\t\t\t\t\t\t\t\turi[key] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn uri;\n\t\t\t\t\t},\n\n\t\t\t\t\tparseHrefHash: function parseHrefHash() {\n\t\t\t\t\t\tvar pattern = /([^\\#|&])\\w+=([^&]+)/g;\n\t\t\t\t\t\tvar uri = {};\n\t\t\t\t\t\tif (window.location.hash) {\n\t\t\t\t\t\t\tvar args = window.location.hash.match(pattern);\n\t\t\t\t\t\t\tfor (var i in args) {\n\t\t\t\t\t\t\t\tvar str = args[i];\n\t\t\t\t\t\t\t\tvar eq = str.indexOf('=');\n\t\t\t\t\t\t\t\tvar key = str.substr(0, eq);\n\t\t\t\t\t\t\t\tvar value = str.substr(eq + 1);\n\t\t\t\t\t\t\t\turi[key] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn uri;\n\t\t\t\t\t},\n\n\t\t\t\t\txmlrequest: _xmlrequest,\n\n\t\t\t\t\tgetXmlFirstChild: function getXmlFirstChild(data, tagName) {\n\t\t\t\t\t\tvar children = data.getElementsByTagName(tagName);\n\t\t\t\t\t\tif (children.length == 0) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn children[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tajax: function ajax(options) {\n\t\t\t\t\t\tvar dataType = options.dataType || 'text';\n\t\t\t\t\t\tvar suc = options.success || EMPTYFN;\n\t\t\t\t\t\tvar error = options.error || EMPTYFN;\n\t\t\t\t\t\tvar xhr = utils.xmlrequest();\n\n\t\t\t\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\t\t\tvar status = xhr.status || 0;\n\t\t\t\t\t\t\t\tif (status === 200) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tswitch (dataType) {\n\t\t\t\t\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\t\t\t\t\tsuc(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\tcase 'json':\n\t\t\t\t\t\t\t\t\t\t\t\tvar json = utils.parseJSON(xhr.responseText);\n\t\t\t\t\t\t\t\t\t\t\t\tsuc(json, xhr);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\tcase 'xml':\n\t\t\t\t\t\t\t\t\t\t\t\tif (xhr.responseXML && xhr.responseXML.documentElement) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuc(xhr.responseXML.documentElement, xhr);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tsuc(xhr.response || xhr.responseText, xhr);\n\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\t\tdata: e\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (xhr.readyState === 0) {\n\t\t\t\t\t\t\t\terror({\n\t\t\t\t\t\t\t\t\ttype: _code.WEBIM_CONNCTION_AJAX_ERROR,\n\t\t\t\t\t\t\t\t\tdata: xhr.responseText\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (options.responseType) {\n\t\t\t\t\t\t\tif (xhr.responseType) {\n\t\t\t\t\t\t\t\txhr.responseType = options.responseType;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (options.mimeType) {\n\t\t\t\t\t\t\tif (utils.hasOverrideMimeType) {\n\t\t\t\t\t\t\t\txhr.overrideMimeType(options.mimeType);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar type = options.type || 'POST',\n\t\t\t\t\t\t data = options.data || null,\n\t\t\t\t\t\t tempData = '';\n\n\t\t\t\t\t\tif (type.toLowerCase() === 'get' && data) {\n\t\t\t\t\t\t\tfor (var o in data) {\n\t\t\t\t\t\t\t\tif (data.hasOwnProperty(o)) {\n\t\t\t\t\t\t\t\t\ttempData += o + '=' + data[o] + '&';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttempData = tempData ? tempData.slice(0, -1) : tempData;\n\t\t\t\t\t\t\toptions.url += (options.url.indexOf('?') > 0 ? '&' : '?') + (tempData ? tempData + '&' : tempData) + '_v=' + new Date().getTime();\n\t\t\t\t\t\t\tdata = null;\n\t\t\t\t\t\t\ttempData = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\txhr.open(type, options.url, utils.isCanSetRequestHeader);\n\n\t\t\t\t\t\tif (utils.isCanSetRequestHeader) {\n\t\t\t\t\t\t\tvar headers = options.headers || {};\n\t\t\t\t\t\t\tfor (var key in headers) {\n\t\t\t\t\t\t\t\tif (headers.hasOwnProperty(key)) {\n\t\t\t\t\t\t\t\t\txhr.setRequestHeader(key, headers[key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// fix: ie8 status error\n\t\t\t\t\t\twindow.XDomainRequest && (xhr.readyState = 2);\n\t\t\t\t\t\txhr.send(data);\n\t\t\t\t\t\treturn xhr;\n\t\t\t\t\t},\n\t\t\t\t\tts: function ts() {\n\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\tvar Hours = d.getHours(); //获取当前小时数(0-23)\n\t\t\t\t\t\tvar Minutes = d.getMinutes(); //获取当前分钟数(0-59)\n\t\t\t\t\t\tvar Seconds = d.getSeconds(); //获取当前秒数(0-59)\n\t\t\t\t\t\tvar Milliseconds = d.getMilliseconds(); //获取当前毫秒\n\t\t\t\t\t\treturn (Hours < 10 ? \"0\" + Hours : Hours) + ':' + (Minutes < 10 ? \"0\" + Minutes : Minutes) + ':' + (Seconds < 10 ? \"0\" + Seconds : Seconds) + ':' + Milliseconds + ' ';\n\t\t\t\t\t},\n\n\t\t\t\t\tgetObjectKey: function getObjectKey(obj, val) {\n\t\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\t\tif (obj[key] == val) {\n\t\t\t\t\t\t\t\treturn key;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t},\n\n\t\t\t\t\tsprintf: function sprintf() {\n\t\t\t\t\t\tvar arg = arguments,\n\t\t\t\t\t\t str = arg[0] || '',\n\t\t\t\t\t\t i,\n\t\t\t\t\t\t len;\n\t\t\t\t\t\tfor (i = 1, len = arg.length; i < len; i++) {\n\t\t\t\t\t\t\tstr = str.replace(/%s/, arg[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str;\n\t\t\t\t\t},\n\n\t\t\t\t\tsetCookie: function setCookie(name, value, days) {\n\t\t\t\t\t\tvar cookie = name + '=' + encodeURIComponent(value);\n\t\t\t\t\t\tif (typeof days == 'number') {\n\t\t\t\t\t\t\tcookie += '; max-age: ' + days * 60 * 60 * 24;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.cookie = cookie;\n\t\t\t\t\t},\n\n\t\t\t\t\tgetCookie: function getCookie() {\n\t\t\t\t\t\tvar allCookie = {};\n\t\t\t\t\t\tvar all = document.cookie;\n\t\t\t\t\t\tif (all === \"\") {\n\t\t\t\t\t\t\treturn allCookie;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar list = all.split(\"; \");\n\t\t\t\t\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\t\t\t\t\tvar cookie = list[i];\n\t\t\t\t\t\t\tvar p = cookie.indexOf('=');\n\t\t\t\t\t\t\tvar name = cookie.substring(0, p);\n\t\t\t\t\t\t\tvar value = cookie.substring(p + 1);\n\t\t\t\t\t\t\tvalue = decodeURIComponent(value);\n\t\t\t\t\t\t\tallCookie[name] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn allCookie;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\texports.utils = utils;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 4 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar CryptoJS = __webpack_require__(5);\n\t\t\t;(function () {\n\t\t\t\t'use strict';\n\n\t\t\t\tvar _utils = __webpack_require__(3).utils;\n\t\t\t\tvar Message = function Message(type, id) {\n\t\t\t\t\tif (!this instanceof Message) {\n\t\t\t\t\t\treturn new Message(type);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._msg = {};\n\n\t\t\t\t\tif (typeof Message[type] === 'function') {\n\t\t\t\t\t\tMessage[type].prototype.setGroup = this.setGroup;\n\t\t\t\t\t\tthis._msg = new Message[type](id);\n\t\t\t\t\t}\n\t\t\t\t\treturn this._msg;\n\t\t\t\t};\n\t\t\t\tMessage.prototype.setGroup = function (group) {\n\t\t\t\t\tthis.body.group = group;\n\t\t\t\t};\n\n\t\t\t\t/*\n * Read Message\n */\n\t\t\t\tMessage.read = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'read';\n\t\t\t\t};\n\n\t\t\t\tMessage.read.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tackId: opt.id,\n\t\t\t\t\t\tto: opt.to\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * deliver message\n */\n\t\t\t\tMessage.delivery = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'delivery';\n\t\t\t\t};\n\n\t\t\t\tMessage.delivery.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tbodyId: opt.id,\n\t\t\t\t\t\tto: opt.to\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * text message\n */\n\t\t\t\tMessage.txt = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'txt';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.txt.prototype.set = function (opt) {\n\t\t\t\t\tthis.value = opt.msg;\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\tmsg: this.value,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail\n\t\t\t\t\t};\n\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * cmd message\n */\n\t\t\t\tMessage.cmd = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'cmd';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.cmd.prototype.set = function (opt) {\n\t\t\t\t\tthis.value = '';\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\taction: opt.action,\n\t\t\t\t\t\tmsg: this.value,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tsuccess: opt.success\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * loc message\n */\n\t\t\t\tMessage.location = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'loc';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.location.prototype.set = function (opt) {\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\taddr: opt.addr,\n\t\t\t\t\t\tlat: opt.lat,\n\t\t\t\t\t\tlng: opt.lng,\n\t\t\t\t\t\text: opt.ext || {}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t/*\n * img message\n */\n\t\t\t\tMessage.img = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'img';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.img.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\twidth: opt.width,\n\t\t\t\t\t\theight: opt.height,\n\t\t\t\t\t\tbody: opt.body,\n\t\t\t\t\t\tuploadError: opt.uploadError,\n\t\t\t\t\t\tuploadComplete: opt.uploadComplete\n\t\t\t\t\t};\n\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * audio message\n */\n\t\t\t\tMessage.audio = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'audio';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.audio.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\t\t\t\t\tthis.filename = opt.filename || this.value.filename;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tfilename: this.filename,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\tlength: opt.length || 0,\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tfile_length: opt.file_length,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\tbody: opt.body\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * file message\n */\n\t\t\t\tMessage.file = function (id) {\n\t\t\t\t\tthis.id = id;\n\t\t\t\t\tthis.type = 'file';\n\t\t\t\t\tthis.body = {};\n\t\t\t\t};\n\t\t\t\tMessage.file.prototype.set = function (opt) {\n\t\t\t\t\topt.file = opt.file || _utils.getFileUrl(opt.fileInputId);\n\n\t\t\t\t\tthis.value = opt.file;\n\t\t\t\t\tthis.filename = opt.filename || this.value.filename;\n\n\t\t\t\t\tthis.body = {\n\t\t\t\t\t\tid: this.id,\n\t\t\t\t\t\tfile: this.value,\n\t\t\t\t\t\tfilename: this.filename,\n\t\t\t\t\t\tapiUrl: opt.apiUrl,\n\t\t\t\t\t\tto: opt.to,\n\t\t\t\t\t\ttype: this.type,\n\t\t\t\t\t\text: opt.ext || {},\n\t\t\t\t\t\troomType: opt.roomType,\n\t\t\t\t\t\tonFileUploadError: opt.onFileUploadError,\n\t\t\t\t\t\tonFileUploadComplete: opt.onFileUploadComplete,\n\t\t\t\t\t\tsuccess: opt.success,\n\t\t\t\t\t\tfail: opt.fail,\n\t\t\t\t\t\tflashUpload: opt.flashUpload,\n\t\t\t\t\t\tbody: opt.body\n\t\t\t\t\t};\n\t\t\t\t\t!opt.roomType && delete this.body.roomType;\n\t\t\t\t};\n\n\t\t\t\t/*\n * video message\n */\n\t\t\t\tMessage.video = function (id) {};\n\t\t\t\tMessage.video.prototype.set = function (opt) {};\n\n\t\t\t\tvar _Message = function _Message(message) {\n\n\t\t\t\t\tif (!this instanceof _Message) {\n\t\t\t\t\t\treturn new _Message(message, conn);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.msg = message;\n\t\t\t\t};\n\n\t\t\t\t_Message.prototype.send = function (conn) {\n\t\t\t\t\tvar me = this;\n\n\t\t\t\t\tvar _send = function _send(message) {\n\n\t\t\t\t\t\tmessage.ext = message.ext || {};\n\t\t\t\t\t\tmessage.ext.weichat = message.ext.weichat || {};\n\t\t\t\t\t\tmessage.ext.weichat.originType = message.ext.weichat.originType || 'webim';\n\n\t\t\t\t\t\tvar dom;\n\t\t\t\t\t\tvar json = {\n\t\t\t\t\t\t\tfrom: conn.context.userId || '',\n\t\t\t\t\t\t\tto: message.to,\n\t\t\t\t\t\t\tbodies: [message.body],\n\t\t\t\t\t\t\text: message.ext || {}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tvar jsonstr = _utils.stringify(json);\n\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\ttype: message.group || 'chat',\n\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t}).c('body').t(jsonstr);\n\n\t\t\t\t\t\tif (message.roomType) {\n\t\t\t\t\t\t\tdom.up().c('roomtype', { xmlns: 'easemob:x:roomtype', type: 'chatroom' });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.bodyId) {\n\t\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\t\tfrom: conn.context.jid || '',\n\t\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t\t}).c('body').t(message.bodyId);\n\t\t\t\t\t\t\tvar delivery = {\n\t\t\t\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\t\t\t\tid: message.bodyId\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdom.up().c('delivery', delivery);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (message.ackId) {\n\n\t\t\t\t\t\t\tif (conn.context.jid.indexOf(message.toJid) >= 0) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdom = $msg({\n\t\t\t\t\t\t\t\tfrom: conn.context.jid || '',\n\t\t\t\t\t\t\t\tto: message.toJid,\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\txmlns: 'jabber:client'\n\t\t\t\t\t\t\t}).c('body').t(message.ackId);\n\t\t\t\t\t\t\tvar read = {\n\t\t\t\t\t\t\t\txmlns: 'urn:xmpp:receipts',\n\t\t\t\t\t\t\t\tid: message.ackId\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdom.up().c('acked', read);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tif (typeof _msgHash !== 'undefined' && _msgHash[message.id]) {\n\t\t\t\t\t\t\t\t_msgHash[message.id].msg.fail instanceof Function && _msgHash[message.id].msg.fail(message.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 60000);\n\t\t\t\t\t\tconn.sendCommand(dom.tree(), message.id);\n\t\t\t\t\t};\n\n\t\t\t\t\tif (me.msg.file) {\n\t\t\t\t\t\tif (me.msg.body && me.msg.body.url) {\n\t\t\t\t\t\t\t// Only send msg\n\t\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar _tmpComplete = me.msg.onFileUploadComplete;\n\t\t\t\t\t\tvar _complete = function _complete(data) {\n\t\t\t\t\t\t\tif (data.entities[0]['file-metadata']) {\n\t\t\t\t\t\t\t\tvar file_len = data.entities[0]['file-metadata']['content-length'];\n\t\t\t\t\t\t\t\t// me.msg.file_length = file_len;\n\t\t\t\t\t\t\t\tme.msg.filetype = data.entities[0]['file-metadata']['content-type'];\n\t\t\t\t\t\t\t\tif (file_len > 204800) {\n\t\t\t\t\t\t\t\t\tme.msg.thumbnail = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tme.msg.body = {\n\t\t\t\t\t\t\t\ttype: me.msg.type || 'file',\n\n\t\t\t\t\t\t\t\turl: (location.protocol != 'https:' && conn.isHttpDNS ? conn.apiUrl + data.uri.substr(data.uri.indexOf(\"/\", 9)) : data.uri) + '/' + data.entities[0]['uuid'],\n\t\t\t\t\t\t\t\tsecret: data.entities[0]['share-secret'],\n\t\t\t\t\t\t\t\tfilename: me.msg.file.filename || me.msg.filename,\n\t\t\t\t\t\t\t\tsize: {\n\t\t\t\t\t\t\t\t\twidth: me.msg.width || 0,\n\t\t\t\t\t\t\t\t\theight: me.msg.height || 0\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tlength: me.msg.length || 0,\n\t\t\t\t\t\t\t\tfile_length: me.msg.ext.file_length || 0,\n\t\t\t\t\t\t\t\tfiletype: me.msg.filetype\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t\t\t_tmpComplete instanceof Function && _tmpComplete(data, me.msg.id);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tme.msg.onFileUploadComplete = _complete;\n\t\t\t\t\t\t_utils.uploadFile.call(conn, me.msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tme.msg.body = {\n\t\t\t\t\t\t\ttype: me.msg.type === 'chat' ? 'txt' : me.msg.type,\n\t\t\t\t\t\t\tmsg: me.msg.msg\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (me.msg.type === 'cmd') {\n\t\t\t\t\t\t\tme.msg.body.action = me.msg.action;\n\t\t\t\t\t\t} else if (me.msg.type === 'loc') {\n\t\t\t\t\t\t\tme.msg.body.addr = me.msg.addr;\n\t\t\t\t\t\t\tme.msg.body.lat = me.msg.lat;\n\t\t\t\t\t\t\tme.msg.body.lng = me.msg.lng;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_send(me.msg);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\texports._msg = _Message;\n\t\t\t\texports.message = Message;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 5 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(8), __webpack_require__(9), __webpack_require__(10), __webpack_require__(11), __webpack_require__(12), __webpack_require__(13), __webpack_require__(14), __webpack_require__(15), __webpack_require__(16), __webpack_require__(17), __webpack_require__(18), __webpack_require__(19), __webpack_require__(20), __webpack_require__(21), __webpack_require__(22), __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(26), __webpack_require__(27), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\", \"./lib-typedarrays\", \"./enc-utf16\", \"./enc-base64\", \"./md5\", \"./sha1\", \"./sha256\", \"./sha224\", \"./sha512\", \"./sha384\", \"./sha3\", \"./ripemd160\", \"./hmac\", \"./pbkdf2\", \"./evpkdf\", \"./cipher-core\", \"./mode-cfb\", \"./mode-ctr\", \"./mode-ctr-gladman\", \"./mode-ofb\", \"./mode-ecb\", \"./pad-ansix923\", \"./pad-iso10126\", \"./pad-iso97971\", \"./pad-zeropadding\", \"./pad-nopadding\", \"./format-hex\", \"./aes\", \"./tripledes\", \"./rc4\", \"./rabbit\", \"./rabbit-legacy\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\troot.CryptoJS = factory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 6 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory();\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\troot.CryptoJS = factory();\n\t\t\t\t}\n\t\t\t})(this, function () {\n\n\t\t\t\t/**\n * CryptoJS core components.\n */\n\t\t\t\tvar CryptoJS = CryptoJS || function (Math, undefined) {\n\t\t\t\t\t/*\n * Local polyfil of Object.create\n */\n\t\t\t\t\tvar create = Object.create || function () {\n\t\t\t\t\t\tfunction F() {};\n\n\t\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\t\tvar subtype;\n\n\t\t\t\t\t\t\tF.prototype = obj;\n\n\t\t\t\t\t\t\tsubtype = new F();\n\n\t\t\t\t\t\t\tF.prototype = null;\n\n\t\t\t\t\t\t\treturn subtype;\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * CryptoJS namespace.\n */\n\t\t\t\t\tvar C = {};\n\n\t\t\t\t\t/**\n * Library namespace.\n */\n\t\t\t\t\tvar C_lib = C.lib = {};\n\n\t\t\t\t\t/**\n * Base object for prototypal inheritance.\n */\n\t\t\t\t\tvar Base = C_lib.Base = function () {\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t/**\n * Creates a new object that inherits from this object.\n *\n * @param {Object} overrides Properties to copy into the new object.\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * field: 'value',\n *\n * method: function () {\n * }\n * });\n */\n\t\t\t\t\t\t\textend: function extend(overrides) {\n\t\t\t\t\t\t\t\t// Spawn\n\t\t\t\t\t\t\t\tvar subtype = create(this);\n\n\t\t\t\t\t\t\t\t// Augment\n\t\t\t\t\t\t\t\tif (overrides) {\n\t\t\t\t\t\t\t\t\tsubtype.mixIn(overrides);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Create default initializer\n\t\t\t\t\t\t\t\tif (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t\t\t\t\t\t\t\t\tsubtype.init = function () {\n\t\t\t\t\t\t\t\t\t\tsubtype.$super.init.apply(this, arguments);\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Initializer's prototype is the subtype object\n\t\t\t\t\t\t\t\tsubtype.init.prototype = subtype;\n\n\t\t\t\t\t\t\t\t// Reference supertype\n\t\t\t\t\t\t\t\tsubtype.$super = this;\n\n\t\t\t\t\t\t\t\treturn subtype;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Extends this object and runs the init method.\n * Arguments to create() will be passed to init().\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var instance = MyType.create();\n */\n\t\t\t\t\t\t\tcreate: function create() {\n\t\t\t\t\t\t\t\tvar instance = this.extend();\n\t\t\t\t\t\t\t\tinstance.init.apply(instance, arguments);\n\n\t\t\t\t\t\t\t\treturn instance;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Initializes a newly created object.\n * Override this method to add some logic when your objects are created.\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * init: function () {\n * // ...\n * }\n * });\n */\n\t\t\t\t\t\t\tinit: function init() {},\n\n\t\t\t\t\t\t\t/**\n * Copies properties into this object.\n *\n * @param {Object} properties The properties to mix in.\n *\n * @example\n *\n * MyType.mixIn({\n * field: 'value'\n * });\n */\n\t\t\t\t\t\t\tmixIn: function mixIn(properties) {\n\t\t\t\t\t\t\t\tfor (var propertyName in properties) {\n\t\t\t\t\t\t\t\t\tif (properties.hasOwnProperty(propertyName)) {\n\t\t\t\t\t\t\t\t\t\tthis[propertyName] = properties[propertyName];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// IE won't copy toString using the loop above\n\t\t\t\t\t\t\t\tif (properties.hasOwnProperty('toString')) {\n\t\t\t\t\t\t\t\t\tthis.toString = properties.toString;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t/**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = instance.clone();\n */\n\t\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\t\treturn this.init.prototype.extend(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * An array of 32-bit words.\n *\n * @property {Array} words The array of 32-bit words.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\n\t\t\t\t\tvar WordArray = C_lib.WordArray = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of 32-bit words.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.create();\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n */\n\t\t\t\t\t\tinit: function init(words, sigBytes) {\n\t\t\t\t\t\t\twords = this.words = words || [];\n\n\t\t\t\t\t\t\tif (sigBytes != undefined) {\n\t\t\t\t\t\t\t\tthis.sigBytes = sigBytes;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.sigBytes = words.length * 4;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this word array to a string.\n *\n * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n *\n * @return {string} The stringified word array.\n *\n * @example\n *\n * var string = wordArray + '';\n * var string = wordArray.toString();\n * var string = wordArray.toString(CryptoJS.enc.Utf8);\n */\n\t\t\t\t\t\ttoString: function toString(encoder) {\n\t\t\t\t\t\t\treturn (encoder || Hex).stringify(this);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Concatenates a word array to this word array.\n *\n * @param {WordArray} wordArray The word array to append.\n *\n * @return {WordArray} This word array.\n *\n * @example\n *\n * wordArray1.concat(wordArray2);\n */\n\t\t\t\t\t\tconcat: function concat(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar thisWords = this.words;\n\t\t\t\t\t\t\tvar thatWords = wordArray.words;\n\t\t\t\t\t\t\tvar thisSigBytes = this.sigBytes;\n\t\t\t\t\t\t\tvar thatSigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\tthis.clamp();\n\n\t\t\t\t\t\t\t// Concat\n\t\t\t\t\t\t\tif (thisSigBytes % 4) {\n\t\t\t\t\t\t\t\t// Copy one byte at a time\n\t\t\t\t\t\t\t\tfor (var i = 0; i < thatSigBytes; i++) {\n\t\t\t\t\t\t\t\t\tvar thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\t\tthisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Copy one word at a time\n\t\t\t\t\t\t\t\tfor (var i = 0; i < thatSigBytes; i += 4) {\n\t\t\t\t\t\t\t\t\tthisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.sigBytes += thatSigBytes;\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Removes insignificant bits.\n *\n * @example\n *\n * wordArray.clamp();\n */\n\t\t\t\t\t\tclamp: function clamp() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = this.words;\n\t\t\t\t\t\t\tvar sigBytes = this.sigBytes;\n\n\t\t\t\t\t\t\t// Clamp\n\t\t\t\t\t\t\twords[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;\n\t\t\t\t\t\t\twords.length = Math.ceil(sigBytes / 4);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this word array.\n *\n * @return {WordArray} The clone.\n *\n * @example\n *\n * var clone = wordArray.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\t\t\t\t\t\t\tclone.words = this.words.slice(0);\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a word array filled with random bytes.\n *\n * @param {number} nBytes The number of random bytes to generate.\n *\n * @return {WordArray} The random word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.random(16);\n */\n\t\t\t\t\t\trandom: function random(nBytes) {\n\t\t\t\t\t\t\tvar words = [];\n\n\t\t\t\t\t\t\tvar r = function r(m_w) {\n\t\t\t\t\t\t\t\tvar m_w = m_w;\n\t\t\t\t\t\t\t\tvar m_z = 0x3ade68b1;\n\t\t\t\t\t\t\t\tvar mask = 0xffffffff;\n\n\t\t\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\t\t\tm_z = 0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10) & mask;\n\t\t\t\t\t\t\t\t\tm_w = 0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10) & mask;\n\t\t\t\t\t\t\t\t\tvar result = (m_z << 0x10) + m_w & mask;\n\t\t\t\t\t\t\t\t\tresult /= 0x100000000;\n\t\t\t\t\t\t\t\t\tresult += 0.5;\n\t\t\t\t\t\t\t\t\treturn result * (Math.random() > .5 ? 1 : -1);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfor (var i = 0, rcache; i < nBytes; i += 4) {\n\t\t\t\t\t\t\t\tvar _r = r((rcache || Math.random()) * 0x100000000);\n\n\t\t\t\t\t\t\t\trcache = _r() * 0x3ade67b7;\n\t\t\t\t\t\t\t\twords.push(_r() * 0x100000000 | 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, nBytes);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Encoder namespace.\n */\n\t\t\t\t\tvar C_enc = C.enc = {};\n\n\t\t\t\t\t/**\n * Hex encoding strategy.\n */\n\t\t\t\t\tvar Hex = C_enc.Hex = {\n\t\t\t\t\t\t/**\n * Converts a word array to a hex string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The hex string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar hexChars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i++) {\n\t\t\t\t\t\t\t\tvar bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\thexChars.push((bite >>> 4).toString(16));\n\t\t\t\t\t\t\t\thexChars.push((bite & 0x0f).toString(16));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn hexChars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a hex string to a word array.\n *\n * @param {string} hexStr The hex string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n */\n\t\t\t\t\t\tparse: function parse(hexStr) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hexStrLength = hexStr.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < hexStrLength; i += 2) {\n\t\t\t\t\t\t\t\twords[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, hexStrLength / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Latin1 encoding strategy.\n */\n\t\t\t\t\tvar Latin1 = C_enc.Latin1 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a Latin1 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Latin1 string.\n *\n * @static\n *\n * @example\n *\n * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar latin1Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i++) {\n\t\t\t\t\t\t\t\tvar bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tlatin1Chars.push(String.fromCharCode(bite));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn latin1Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a Latin1 string to a word array.\n *\n * @param {string} latin1Str The Latin1 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n */\n\t\t\t\t\t\tparse: function parse(latin1Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar latin1StrLength = latin1Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < latin1StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn new WordArray.init(words, latin1StrLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * UTF-8 encoding strategy.\n */\n\t\t\t\t\tvar Utf8 = C_enc.Utf8 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-8 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-8 string.\n *\n * @static\n *\n * @example\n *\n * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\treturn decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tthrow new Error('Malformed UTF-8 data');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-8 string to a word array.\n *\n * @param {string} utf8Str The UTF-8 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n */\n\t\t\t\t\t\tparse: function parse(utf8Str) {\n\t\t\t\t\t\t\treturn Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Abstract buffered block algorithm template.\n *\n * The property blockSize must be implemented in a concrete subtype.\n *\n * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n */\n\t\t\t\t\tvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t\t\t\t\t\t/**\n * Resets this block algorithm's data buffer to its initial state.\n *\n * @example\n *\n * bufferedBlockAlgorithm.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tthis._data = new WordArray.init();\n\t\t\t\t\t\t\tthis._nDataBytes = 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Adds new data to this block algorithm's buffer.\n *\n * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n *\n * @example\n *\n * bufferedBlockAlgorithm._append('data');\n * bufferedBlockAlgorithm._append(wordArray);\n */\n\t\t\t\t\t\t_append: function _append(data) {\n\t\t\t\t\t\t\t// Convert string to WordArray, else assume WordArray already\n\t\t\t\t\t\t\tif (typeof data == 'string') {\n\t\t\t\t\t\t\t\tdata = Utf8.parse(data);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._data.concat(data);\n\t\t\t\t\t\t\tthis._nDataBytes += data.sigBytes;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Processes available data blocks.\n *\n * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n *\n * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n *\n * @return {WordArray} The processed data.\n *\n * @example\n *\n * var processedData = bufferedBlockAlgorithm._process();\n * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n */\n\t\t\t\t\t\t_process: function _process(doFlush) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\t\t\t\t\t\t\tvar dataSigBytes = data.sigBytes;\n\t\t\t\t\t\t\tvar blockSize = this.blockSize;\n\t\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t\t// Count blocks ready\n\t\t\t\t\t\t\tvar nBlocksReady = dataSigBytes / blockSizeBytes;\n\t\t\t\t\t\t\tif (doFlush) {\n\t\t\t\t\t\t\t\t// Round up to include partial blocks\n\t\t\t\t\t\t\t\tnBlocksReady = Math.ceil(nBlocksReady);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Round down to include only full blocks,\n\t\t\t\t\t\t\t\t// less the number of blocks that must remain in the buffer\n\t\t\t\t\t\t\t\tnBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Count words ready\n\t\t\t\t\t\t\tvar nWordsReady = nBlocksReady * blockSize;\n\n\t\t\t\t\t\t\t// Count bytes ready\n\t\t\t\t\t\t\tvar nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t\t\t\t\t\t\t// Process blocks\n\t\t\t\t\t\t\tif (nWordsReady) {\n\t\t\t\t\t\t\t\tfor (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t\t\t\t\t\t\t\t\t// Perform concrete-algorithm logic\n\t\t\t\t\t\t\t\t\tthis._doProcessBlock(dataWords, offset);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Remove processed words\n\t\t\t\t\t\t\t\tvar processedWords = dataWords.splice(0, nWordsReady);\n\t\t\t\t\t\t\t\tdata.sigBytes -= nBytesReady;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return processed words\n\t\t\t\t\t\t\treturn new WordArray.init(processedWords, nBytesReady);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = bufferedBlockAlgorithm.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\t\t\t\t\t\t\tclone._data = this._data.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_minBufferSize: 0\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Abstract hasher template.\n *\n * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n */\n\t\t\t\t\tvar Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n */\n\t\t\t\t\t\tcfg: Base.extend(),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created hasher.\n *\n * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n *\n * @example\n *\n * var hasher = CryptoJS.algo.SHA256.create();\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this hasher to its initial state.\n *\n * @example\n *\n * hasher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset data buffer\n\t\t\t\t\t\t\tBufferedBlockAlgorithm.reset.call(this);\n\n\t\t\t\t\t\t\t// Perform concrete-hasher logic\n\t\t\t\t\t\t\tthis._doReset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Updates this hasher with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {Hasher} This hasher.\n *\n * @example\n *\n * hasher.update('message');\n * hasher.update(wordArray);\n */\n\t\t\t\t\t\tupdate: function update(messageUpdate) {\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._append(messageUpdate);\n\n\t\t\t\t\t\t\t// Update the hash\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the hash computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The hash.\n *\n * @example\n *\n * var hash = hasher.finalize();\n * var hash = hasher.finalize('message');\n * var hash = hasher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(messageUpdate) {\n\t\t\t\t\t\t\t// Final message update\n\t\t\t\t\t\t\tif (messageUpdate) {\n\t\t\t\t\t\t\t\tthis._append(messageUpdate);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Perform concrete-hasher logic\n\t\t\t\t\t\t\tvar hash = this._doFinalize();\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 512 / 32,\n\n\t\t\t\t\t\t/**\n * Creates a shortcut function to a hasher's object interface.\n *\n * @param {Hasher} hasher The hasher to create a helper for.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n */\n\t\t\t\t\t\t_createHelper: function _createHelper(hasher) {\n\t\t\t\t\t\t\treturn function (message, cfg) {\n\t\t\t\t\t\t\t\treturn new hasher.init(cfg).finalize(message);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a shortcut function to the HMAC's object interface.\n *\n * @param {Hasher} hasher The hasher to use in this HMAC helper.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n */\n\t\t\t\t\t\t_createHmacHelper: function _createHmacHelper(hasher) {\n\t\t\t\t\t\t\treturn function (message, key) {\n\t\t\t\t\t\t\t\treturn new C_algo.HMAC.init(hasher, key).finalize(message);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Algorithm namespace.\n */\n\t\t\t\t\tvar C_algo = C.algo = {};\n\n\t\t\t\t\treturn C;\n\t\t\t\t}(Math);\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 7 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar X32WordArray = C_lib.WordArray;\n\n\t\t\t\t\t/**\n * x64 namespace.\n */\n\t\t\t\t\tvar C_x64 = C.x64 = {};\n\n\t\t\t\t\t/**\n * A 64-bit word.\n */\n\t\t\t\t\tvar X64Word = C_x64.Word = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created 64-bit word.\n *\n * @param {number} high The high 32 bits.\n * @param {number} low The low 32 bits.\n *\n * @example\n *\n * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n */\n\t\t\t\t\t\tinit: function init(high, low) {\n\t\t\t\t\t\t\tthis.high = high;\n\t\t\t\t\t\t\tthis.low = low;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n * Bitwise NOTs this word.\n *\n * @return {X64Word} A new x64-Word object after negating.\n *\n * @example\n *\n * var negated = x64Word.not();\n */\n\t\t\t\t\t\t// not: function () {\n\t\t\t\t\t\t// var high = ~this.high;\n\t\t\t\t\t\t// var low = ~this.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise ANDs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to AND with this word.\n *\n * @return {X64Word} A new x64-Word object after ANDing.\n *\n * @example\n *\n * var anded = x64Word.and(anotherX64Word);\n */\n\t\t\t\t\t\t// and: function (word) {\n\t\t\t\t\t\t// var high = this.high & word.high;\n\t\t\t\t\t\t// var low = this.low & word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise ORs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to OR with this word.\n *\n * @return {X64Word} A new x64-Word object after ORing.\n *\n * @example\n *\n * var ored = x64Word.or(anotherX64Word);\n */\n\t\t\t\t\t\t// or: function (word) {\n\t\t\t\t\t\t// var high = this.high | word.high;\n\t\t\t\t\t\t// var low = this.low | word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Bitwise XORs this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to XOR with this word.\n *\n * @return {X64Word} A new x64-Word object after XORing.\n *\n * @example\n *\n * var xored = x64Word.xor(anotherX64Word);\n */\n\t\t\t\t\t\t// xor: function (word) {\n\t\t\t\t\t\t// var high = this.high ^ word.high;\n\t\t\t\t\t\t// var low = this.low ^ word.low;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Shifts this word n bits to the left.\n *\n * @param {number} n The number of bits to shift.\n *\n * @return {X64Word} A new x64-Word object after shifting.\n *\n * @example\n *\n * var shifted = x64Word.shiftL(25);\n */\n\t\t\t\t\t\t// shiftL: function (n) {\n\t\t\t\t\t\t// if (n < 32) {\n\t\t\t\t\t\t// var high = (this.high << n) | (this.low >>> (32 - n));\n\t\t\t\t\t\t// var low = this.low << n;\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t// var high = this.low << (n - 32);\n\t\t\t\t\t\t// var low = 0;\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Shifts this word n bits to the right.\n *\n * @param {number} n The number of bits to shift.\n *\n * @return {X64Word} A new x64-Word object after shifting.\n *\n * @example\n *\n * var shifted = x64Word.shiftR(7);\n */\n\t\t\t\t\t\t// shiftR: function (n) {\n\t\t\t\t\t\t// if (n < 32) {\n\t\t\t\t\t\t// var low = (this.low >>> n) | (this.high << (32 - n));\n\t\t\t\t\t\t// var high = this.high >>> n;\n\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t// var low = this.high >>> (n - 32);\n\t\t\t\t\t\t// var high = 0;\n\t\t\t\t\t\t// }\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Rotates this word n bits to the left.\n *\n * @param {number} n The number of bits to rotate.\n *\n * @return {X64Word} A new x64-Word object after rotating.\n *\n * @example\n *\n * var rotated = x64Word.rotL(25);\n */\n\t\t\t\t\t\t// rotL: function (n) {\n\t\t\t\t\t\t// return this.shiftL(n).or(this.shiftR(64 - n));\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Rotates this word n bits to the right.\n *\n * @param {number} n The number of bits to rotate.\n *\n * @return {X64Word} A new x64-Word object after rotating.\n *\n * @example\n *\n * var rotated = x64Word.rotR(7);\n */\n\t\t\t\t\t\t// rotR: function (n) {\n\t\t\t\t\t\t// return this.shiftR(n).or(this.shiftL(64 - n));\n\t\t\t\t\t\t// },\n\n\t\t\t\t\t\t/**\n * Adds this word with the passed word.\n *\n * @param {X64Word} word The x64-Word to add with this word.\n *\n * @return {X64Word} A new x64-Word object after adding.\n *\n * @example\n *\n * var added = x64Word.add(anotherX64Word);\n */\n\t\t\t\t\t\t// add: function (word) {\n\t\t\t\t\t\t// var low = (this.low + word.low) | 0;\n\t\t\t\t\t\t// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;\n\t\t\t\t\t\t// var high = (this.high + word.high + carry) | 0;\n\n\t\t\t\t\t\t// return X64Word.create(high, low);\n\t\t\t\t\t\t// }\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * An array of 64-bit words.\n *\n * @property {Array} words The array of CryptoJS.x64.Word objects.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.x64.WordArray.create();\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ]);\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ], 10);\n */\n\t\t\t\t\t\tinit: function init(words, sigBytes) {\n\t\t\t\t\t\t\twords = this.words = words || [];\n\n\t\t\t\t\t\t\tif (sigBytes != undefined) {\n\t\t\t\t\t\t\t\tthis.sigBytes = sigBytes;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.sigBytes = words.length * 8;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this 64-bit word array to a 32-bit word array.\n *\n * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n *\n * @example\n *\n * var x32WordArray = x64WordArray.toX32();\n */\n\t\t\t\t\t\ttoX32: function toX32() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar x64Words = this.words;\n\t\t\t\t\t\t\tvar x64WordsLength = x64Words.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar x32Words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < x64WordsLength; i++) {\n\t\t\t\t\t\t\t\tvar x64Word = x64Words[i];\n\t\t\t\t\t\t\t\tx32Words.push(x64Word.high);\n\t\t\t\t\t\t\t\tx32Words.push(x64Word.low);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn X32WordArray.create(x32Words, this.sigBytes);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates a copy of this word array.\n *\n * @return {X64WordArray} The clone.\n *\n * @example\n *\n * var clone = x64WordArray.clone();\n */\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Base.clone.call(this);\n\n\t\t\t\t\t\t\t// Clone \"words\" array\n\t\t\t\t\t\t\tvar words = clone.words = this.words.slice(0);\n\n\t\t\t\t\t\t\t// Clone each X64Word object\n\t\t\t\t\t\t\tvar wordsLength = words.length;\n\t\t\t\t\t\t\tfor (var i = 0; i < wordsLength; i++) {\n\t\t\t\t\t\t\t\twords[i] = words[i].clone();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 8 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Check if typed arrays are supported\n\t\t\t\t\tif (typeof ArrayBuffer != 'function') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\n\t\t\t\t\t// Reference original init\n\t\t\t\t\tvar superInit = WordArray.init;\n\n\t\t\t\t\t// Augment WordArray.init to handle typed arrays\n\t\t\t\t\tvar subInit = WordArray.init = function (typedArray) {\n\t\t\t\t\t\t// Convert buffers to uint8\n\t\t\t\t\t\tif (typedArray instanceof ArrayBuffer) {\n\t\t\t\t\t\t\ttypedArray = new Uint8Array(typedArray);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Convert other array views to uint8\n\t\t\t\t\t\tif (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== \"undefined\" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {\n\t\t\t\t\t\t\ttypedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle Uint8Array\n\t\t\t\t\t\tif (typedArray instanceof Uint8Array) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar typedArrayByteLength = typedArray.byteLength;\n\n\t\t\t\t\t\t\t// Extract bytes\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < typedArrayByteLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Initialize this word array\n\t\t\t\t\t\t\tsuperInit.call(this, words, typedArrayByteLength);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Else call normal init\n\t\t\t\t\t\t\tsuperInit.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tsubInit.prototype = WordArray;\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.lib.WordArray;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 9 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_enc = C.enc;\n\n\t\t\t\t\t/**\n * UTF-16 BE encoding strategy.\n */\n\t\t\t\t\tvar Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-16 BE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 BE string.\n *\n * @static\n *\n * @example\n *\n * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar utf16Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 2) {\n\t\t\t\t\t\t\t\tvar codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff;\n\t\t\t\t\t\t\t\tutf16Chars.push(String.fromCharCode(codePoint));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn utf16Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-16 BE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 BE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);\n */\n\t\t\t\t\t\tparse: function parse(utf16Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar utf16StrLength = utf16Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < utf16StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn WordArray.create(words, utf16StrLength * 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * UTF-16 LE encoding strategy.\n */\n\t\t\t\t\tC_enc.Utf16LE = {\n\t\t\t\t\t\t/**\n * Converts a word array to a UTF-16 LE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 LE string.\n *\n * @static\n *\n * @example\n *\n * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar utf16Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 2) {\n\t\t\t\t\t\t\t\tvar codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff);\n\t\t\t\t\t\t\t\tutf16Chars.push(String.fromCharCode(codePoint));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn utf16Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a UTF-16 LE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 LE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);\n */\n\t\t\t\t\t\tparse: function parse(utf16Str) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar utf16StrLength = utf16Str.length;\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < utf16StrLength; i++) {\n\t\t\t\t\t\t\t\twords[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn WordArray.create(words, utf16StrLength * 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tfunction swapEndian(word) {\n\t\t\t\t\t\treturn word << 8 & 0xff00ff00 | word >>> 8 & 0x00ff00ff;\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.enc.Utf16;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 10 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_enc = C.enc;\n\n\t\t\t\t\t/**\n * Base64 encoding strategy.\n */\n\t\t\t\t\tvar Base64 = C_enc.Base64 = {\n\t\t\t\t\t\t/**\n * Converts a word array to a Base64 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Base64 string.\n *\n * @static\n *\n * @example\n *\n * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n */\n\t\t\t\t\t\tstringify: function stringify(wordArray) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar words = wordArray.words;\n\t\t\t\t\t\t\tvar sigBytes = wordArray.sigBytes;\n\t\t\t\t\t\t\tvar map = this._map;\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\twordArray.clamp();\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\tvar base64Chars = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < sigBytes; i += 3) {\n\t\t\t\t\t\t\t\tvar byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tvar byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff;\n\t\t\t\t\t\t\t\tvar byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff;\n\n\t\t\t\t\t\t\t\tvar triplet = byte1 << 16 | byte2 << 8 | byte3;\n\n\t\t\t\t\t\t\t\tfor (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {\n\t\t\t\t\t\t\t\t\tbase64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tvar paddingChar = map.charAt(64);\n\t\t\t\t\t\t\tif (paddingChar) {\n\t\t\t\t\t\t\t\twhile (base64Chars.length % 4) {\n\t\t\t\t\t\t\t\t\tbase64Chars.push(paddingChar);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn base64Chars.join('');\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a Base64 string to a word array.\n *\n * @param {string} base64Str The Base64 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n */\n\t\t\t\t\t\tparse: function parse(base64Str) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar base64StrLength = base64Str.length;\n\t\t\t\t\t\t\tvar map = this._map;\n\t\t\t\t\t\t\tvar reverseMap = this._reverseMap;\n\n\t\t\t\t\t\t\tif (!reverseMap) {\n\t\t\t\t\t\t\t\treverseMap = this._reverseMap = [];\n\t\t\t\t\t\t\t\tfor (var j = 0; j < map.length; j++) {\n\t\t\t\t\t\t\t\t\treverseMap[map.charCodeAt(j)] = j;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Ignore padding\n\t\t\t\t\t\t\tvar paddingChar = map.charAt(64);\n\t\t\t\t\t\t\tif (paddingChar) {\n\t\t\t\t\t\t\t\tvar paddingIndex = base64Str.indexOf(paddingChar);\n\t\t\t\t\t\t\t\tif (paddingIndex !== -1) {\n\t\t\t\t\t\t\t\t\tbase64StrLength = paddingIndex;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Convert\n\t\t\t\t\t\t\treturn parseLoop(base64Str, base64StrLength, reverseMap);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t\t\t\t\t};\n\n\t\t\t\t\tfunction parseLoop(base64Str, base64StrLength, reverseMap) {\n\t\t\t\t\t\tvar words = [];\n\t\t\t\t\t\tvar nBytes = 0;\n\t\t\t\t\t\tfor (var i = 0; i < base64StrLength; i++) {\n\t\t\t\t\t\t\tif (i % 4) {\n\t\t\t\t\t\t\t\tvar bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;\n\t\t\t\t\t\t\t\tvar bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;\n\t\t\t\t\t\t\t\twords[nBytes >>> 2] |= (bits1 | bits2) << 24 - nBytes % 4 * 8;\n\t\t\t\t\t\t\t\tnBytes++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn WordArray.create(words, nBytes);\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.enc.Base64;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 11 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants table\n\t\t\t\t\tvar T = [];\n\n\t\t\t\t\t// Compute constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 64; i++) {\n\t\t\t\t\t\t\tT[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * MD5 hash algorithm.\n */\n\t\t\t\t\tvar MD5 = C_algo.MD5 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar offset_i = offset + i;\n\t\t\t\t\t\t\t\tvar M_offset_i = M[offset_i];\n\n\t\t\t\t\t\t\t\tM[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\tvar M_offset_0 = M[offset + 0];\n\t\t\t\t\t\t\tvar M_offset_1 = M[offset + 1];\n\t\t\t\t\t\t\tvar M_offset_2 = M[offset + 2];\n\t\t\t\t\t\t\tvar M_offset_3 = M[offset + 3];\n\t\t\t\t\t\t\tvar M_offset_4 = M[offset + 4];\n\t\t\t\t\t\t\tvar M_offset_5 = M[offset + 5];\n\t\t\t\t\t\t\tvar M_offset_6 = M[offset + 6];\n\t\t\t\t\t\t\tvar M_offset_7 = M[offset + 7];\n\t\t\t\t\t\t\tvar M_offset_8 = M[offset + 8];\n\t\t\t\t\t\t\tvar M_offset_9 = M[offset + 9];\n\t\t\t\t\t\t\tvar M_offset_10 = M[offset + 10];\n\t\t\t\t\t\t\tvar M_offset_11 = M[offset + 11];\n\t\t\t\t\t\t\tvar M_offset_12 = M[offset + 12];\n\t\t\t\t\t\t\tvar M_offset_13 = M[offset + 13];\n\t\t\t\t\t\t\tvar M_offset_14 = M[offset + 14];\n\t\t\t\t\t\t\tvar M_offset_15 = M[offset + 15];\n\n\t\t\t\t\t\t\t// Working varialbes\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t\t\t\t\t\t\ta = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t\t\t\t\t\t\td = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t\t\t\t\t\t\tc = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t\t\t\t\t\t\tb = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t\t\t\t\t\t\ta = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t\t\t\t\t\t\td = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t\t\t\t\t\t\tc = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t\t\t\t\t\t\tb = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t\t\t\t\t\t\ta = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t\t\t\t\t\t\td = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t\t\t\t\t\t\tc = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t\t\t\t\t\t\tb = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t\t\t\t\t\t\ta = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t\t\t\t\t\t\td = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t\t\t\t\t\t\tc = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t\t\t\t\t\t\tb = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\n\t\t\t\t\t\t\tvar nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tvar nBitsTotalL = nBitsTotal;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\tdata.sigBytes = (dataWords.length + 1) * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hash = this._hash;\n\t\t\t\t\t\t\tvar H = hash.words;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar H_i = H[i];\n\n\t\t\t\t\t\t\t\tH[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction FF(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b & c | ~b & d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction GG(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b & d | c & ~d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction HH(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (b ^ c ^ d) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction II(a, b, c, d, x, s, t) {\n\t\t\t\t\t\tvar n = a + (c ^ (b | ~d)) + x + t;\n\t\t\t\t\t\treturn (n << s | n >>> 32 - s) + b;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.MD5('message');\n * var hash = CryptoJS.MD5(wordArray);\n */\n\t\t\t\t\tC.MD5 = Hasher._createHelper(MD5);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacMD5(message, key);\n */\n\t\t\t\t\tC.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.MD5;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 12 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable object\n\t\t\t\t\tvar W = [];\n\n\t\t\t\t\t/**\n * SHA-1 hash algorithm.\n */\n\t\t\t\t\tvar SHA1 = C_algo.SHA1 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\t\t\t\t\t\t\tvar e = H[4];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tW[i] = M[offset + i] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t\t\t\t\t\t\t\t\tW[i] = n << 1 | n >>> 31;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar t = (a << 5 | a >>> 27) + e + W[i];\n\t\t\t\t\t\t\t\tif (i < 20) {\n\t\t\t\t\t\t\t\t\tt += (b & c | ~b & d) + 0x5a827999;\n\t\t\t\t\t\t\t\t} else if (i < 40) {\n\t\t\t\t\t\t\t\t\tt += (b ^ c ^ d) + 0x6ed9eba1;\n\t\t\t\t\t\t\t\t} else if (i < 60) {\n\t\t\t\t\t\t\t\t\tt += (b & c | b & d | c & d) - 0x70e44324;\n\t\t\t\t\t\t\t\t} else /* if (i < 80) */{\n\t\t\t\t\t\t\t\t\t\tt += (b ^ c ^ d) - 0x359d3e2a;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\te = d;\n\t\t\t\t\t\t\t\td = c;\n\t\t\t\t\t\t\t\tc = b << 30 | b >>> 2;\n\t\t\t\t\t\t\t\tb = a;\n\t\t\t\t\t\t\t\ta = t;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t\tH[4] = H[4] + e | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn this._hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA1('message');\n * var hash = CryptoJS.SHA1(wordArray);\n */\n\t\t\t\t\tC.SHA1 = Hasher._createHelper(SHA1);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA1(message, key);\n */\n\t\t\t\t\tC.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA1;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 13 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Initialization and round constants tables\n\t\t\t\t\tvar H = [];\n\t\t\t\t\tvar K = [];\n\n\t\t\t\t\t// Compute constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfunction isPrime(n) {\n\t\t\t\t\t\t\tvar sqrtN = Math.sqrt(n);\n\t\t\t\t\t\t\tfor (var factor = 2; factor <= sqrtN; factor++) {\n\t\t\t\t\t\t\t\tif (!(n % factor)) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction getFractionalBits(n) {\n\t\t\t\t\t\t\treturn (n - (n | 0)) * 0x100000000 | 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar n = 2;\n\t\t\t\t\t\tvar nPrime = 0;\n\t\t\t\t\t\twhile (nPrime < 64) {\n\t\t\t\t\t\t\tif (isPrime(n)) {\n\t\t\t\t\t\t\t\tif (nPrime < 8) {\n\t\t\t\t\t\t\t\t\tH[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tK[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t\t\t\t\t\t\t\tnPrime++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tn++;\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Reusable object\n\t\t\t\t\tvar W = [];\n\n\t\t\t\t\t/**\n * SHA-256 hash algorithm.\n */\n\t\t\t\t\tvar SHA256 = C_algo.SHA256 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init(H.slice(0));\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar a = H[0];\n\t\t\t\t\t\t\tvar b = H[1];\n\t\t\t\t\t\t\tvar c = H[2];\n\t\t\t\t\t\t\tvar d = H[3];\n\t\t\t\t\t\t\tvar e = H[4];\n\t\t\t\t\t\t\tvar f = H[5];\n\t\t\t\t\t\t\tvar g = H[6];\n\t\t\t\t\t\t\tvar h = H[7];\n\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tfor (var i = 0; i < 64; i++) {\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tW[i] = M[offset + i] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar gamma0x = W[i - 15];\n\t\t\t\t\t\t\t\t\tvar gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;\n\n\t\t\t\t\t\t\t\t\tvar gamma1x = W[i - 2];\n\t\t\t\t\t\t\t\t\tvar gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;\n\n\t\t\t\t\t\t\t\t\tW[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar ch = e & f ^ ~e & g;\n\t\t\t\t\t\t\t\tvar maj = a & b ^ a & c ^ b & c;\n\n\t\t\t\t\t\t\t\tvar sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);\n\t\t\t\t\t\t\t\tvar sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);\n\n\t\t\t\t\t\t\t\tvar t1 = h + sigma1 + ch + K[i] + W[i];\n\t\t\t\t\t\t\t\tvar t2 = sigma0 + maj;\n\n\t\t\t\t\t\t\t\th = g;\n\t\t\t\t\t\t\t\tg = f;\n\t\t\t\t\t\t\t\tf = e;\n\t\t\t\t\t\t\t\te = d + t1 | 0;\n\t\t\t\t\t\t\t\td = c;\n\t\t\t\t\t\t\t\tc = b;\n\t\t\t\t\t\t\t\tb = a;\n\t\t\t\t\t\t\t\ta = t1 + t2 | 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH[0] = H[0] + a | 0;\n\t\t\t\t\t\t\tH[1] = H[1] + b | 0;\n\t\t\t\t\t\t\tH[2] = H[2] + c | 0;\n\t\t\t\t\t\t\tH[3] = H[3] + d | 0;\n\t\t\t\t\t\t\tH[4] = H[4] + e | 0;\n\t\t\t\t\t\t\tH[5] = H[5] + f | 0;\n\t\t\t\t\t\t\tH[6] = H[6] + g | 0;\n\t\t\t\t\t\t\tH[7] = H[7] + h | 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn this._hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA256('message');\n * var hash = CryptoJS.SHA256(wordArray);\n */\n\t\t\t\t\tC.SHA256 = Hasher._createHelper(SHA256);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA256(message, key);\n */\n\t\t\t\t\tC.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.SHA256;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 14 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(13));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha256\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA256 = C_algo.SHA256;\n\n\t\t\t\t\t/**\n * SHA-224 hash algorithm.\n */\n\t\t\t\t\tvar SHA224 = C_algo.SHA224 = SHA256.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new WordArray.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\tvar hash = SHA256._doFinalize.call(this);\n\n\t\t\t\t\t\t\thash.sigBytes -= 4;\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA224('message');\n * var hash = CryptoJS.SHA224(wordArray);\n */\n\t\t\t\t\tC.SHA224 = SHA256._createHelper(SHA224);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA224(message, key);\n */\n\t\t\t\t\tC.HmacSHA224 = SHA256._createHmacHelper(SHA224);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA224;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 15 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\tfunction X64Word_create() {\n\t\t\t\t\t\treturn X64Word.create.apply(X64Word, arguments);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Constants\n\t\t\t\t\tvar K = [X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)];\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar W = [];\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\tW[i] = X64Word_create();\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * SHA-512 hash algorithm.\n */\n\t\t\t\t\tvar SHA512 = C_algo.SHA512 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new X64WordArray.init([new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\n\t\t\t\t\t\t\tvar H0 = H[0];\n\t\t\t\t\t\t\tvar H1 = H[1];\n\t\t\t\t\t\t\tvar H2 = H[2];\n\t\t\t\t\t\t\tvar H3 = H[3];\n\t\t\t\t\t\t\tvar H4 = H[4];\n\t\t\t\t\t\t\tvar H5 = H[5];\n\t\t\t\t\t\t\tvar H6 = H[6];\n\t\t\t\t\t\t\tvar H7 = H[7];\n\n\t\t\t\t\t\t\tvar H0h = H0.high;\n\t\t\t\t\t\t\tvar H0l = H0.low;\n\t\t\t\t\t\t\tvar H1h = H1.high;\n\t\t\t\t\t\t\tvar H1l = H1.low;\n\t\t\t\t\t\t\tvar H2h = H2.high;\n\t\t\t\t\t\t\tvar H2l = H2.low;\n\t\t\t\t\t\t\tvar H3h = H3.high;\n\t\t\t\t\t\t\tvar H3l = H3.low;\n\t\t\t\t\t\t\tvar H4h = H4.high;\n\t\t\t\t\t\t\tvar H4l = H4.low;\n\t\t\t\t\t\t\tvar H5h = H5.high;\n\t\t\t\t\t\t\tvar H5l = H5.low;\n\t\t\t\t\t\t\tvar H6h = H6.high;\n\t\t\t\t\t\t\tvar H6l = H6.low;\n\t\t\t\t\t\t\tvar H7h = H7.high;\n\t\t\t\t\t\t\tvar H7l = H7.low;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar ah = H0h;\n\t\t\t\t\t\t\tvar al = H0l;\n\t\t\t\t\t\t\tvar bh = H1h;\n\t\t\t\t\t\t\tvar bl = H1l;\n\t\t\t\t\t\t\tvar ch = H2h;\n\t\t\t\t\t\t\tvar cl = H2l;\n\t\t\t\t\t\t\tvar dh = H3h;\n\t\t\t\t\t\t\tvar dl = H3l;\n\t\t\t\t\t\t\tvar eh = H4h;\n\t\t\t\t\t\t\tvar el = H4l;\n\t\t\t\t\t\t\tvar fh = H5h;\n\t\t\t\t\t\t\tvar fl = H5l;\n\t\t\t\t\t\t\tvar gh = H6h;\n\t\t\t\t\t\t\tvar gl = H6l;\n\t\t\t\t\t\t\tvar hh = H7h;\n\t\t\t\t\t\t\tvar hl = H7l;\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar Wi = W[i];\n\n\t\t\t\t\t\t\t\t// Extend message\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tvar Wih = Wi.high = M[offset + i * 2] | 0;\n\t\t\t\t\t\t\t\t\tvar Wil = Wi.low = M[offset + i * 2 + 1] | 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Gamma0\n\t\t\t\t\t\t\t\t\tvar gamma0x = W[i - 15];\n\t\t\t\t\t\t\t\t\tvar gamma0xh = gamma0x.high;\n\t\t\t\t\t\t\t\t\tvar gamma0xl = gamma0x.low;\n\t\t\t\t\t\t\t\t\tvar gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;\n\t\t\t\t\t\t\t\t\tvar gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);\n\n\t\t\t\t\t\t\t\t\t// Gamma1\n\t\t\t\t\t\t\t\t\tvar gamma1x = W[i - 2];\n\t\t\t\t\t\t\t\t\tvar gamma1xh = gamma1x.high;\n\t\t\t\t\t\t\t\t\tvar gamma1xl = gamma1x.low;\n\t\t\t\t\t\t\t\t\tvar gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;\n\t\t\t\t\t\t\t\t\tvar gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);\n\n\t\t\t\t\t\t\t\t\t// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n\t\t\t\t\t\t\t\t\tvar Wi7 = W[i - 7];\n\t\t\t\t\t\t\t\t\tvar Wi7h = Wi7.high;\n\t\t\t\t\t\t\t\t\tvar Wi7l = Wi7.low;\n\n\t\t\t\t\t\t\t\t\tvar Wi16 = W[i - 16];\n\t\t\t\t\t\t\t\t\tvar Wi16h = Wi16.high;\n\t\t\t\t\t\t\t\t\tvar Wi16l = Wi16.low;\n\n\t\t\t\t\t\t\t\t\tvar Wil = gamma0l + Wi7l;\n\t\t\t\t\t\t\t\t\tvar Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\t\tvar Wil = Wil + gamma1l;\n\t\t\t\t\t\t\t\t\tvar Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\t\tvar Wil = Wil + Wi16l;\n\t\t\t\t\t\t\t\t\tvar Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t\tWi.high = Wih;\n\t\t\t\t\t\t\t\t\tWi.low = Wil;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar chh = eh & fh ^ ~eh & gh;\n\t\t\t\t\t\t\t\tvar chl = el & fl ^ ~el & gl;\n\t\t\t\t\t\t\t\tvar majh = ah & bh ^ ah & ch ^ bh & ch;\n\t\t\t\t\t\t\t\tvar majl = al & bl ^ al & cl ^ bl & cl;\n\n\t\t\t\t\t\t\t\tvar sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);\n\t\t\t\t\t\t\t\tvar sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);\n\t\t\t\t\t\t\t\tvar sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);\n\t\t\t\t\t\t\t\tvar sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);\n\n\t\t\t\t\t\t\t\t// t1 = h + sigma1 + ch + K[i] + W[i]\n\t\t\t\t\t\t\t\tvar Ki = K[i];\n\t\t\t\t\t\t\t\tvar Kih = Ki.high;\n\t\t\t\t\t\t\t\tvar Kil = Ki.low;\n\n\t\t\t\t\t\t\t\tvar t1l = hl + sigma1l;\n\t\t\t\t\t\t\t\tvar t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + chl;\n\t\t\t\t\t\t\t\tvar t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + Kil;\n\t\t\t\t\t\t\t\tvar t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\t\tvar t1l = t1l + Wil;\n\t\t\t\t\t\t\t\tvar t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t// t2 = sigma0 + maj\n\t\t\t\t\t\t\t\tvar t2l = sigma0l + majl;\n\t\t\t\t\t\t\t\tvar t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);\n\n\t\t\t\t\t\t\t\t// Update working variables\n\t\t\t\t\t\t\t\thh = gh;\n\t\t\t\t\t\t\t\thl = gl;\n\t\t\t\t\t\t\t\tgh = fh;\n\t\t\t\t\t\t\t\tgl = fl;\n\t\t\t\t\t\t\t\tfh = eh;\n\t\t\t\t\t\t\t\tfl = el;\n\t\t\t\t\t\t\t\tel = dl + t1l | 0;\n\t\t\t\t\t\t\t\teh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\t\t\tdh = ch;\n\t\t\t\t\t\t\t\tdl = cl;\n\t\t\t\t\t\t\t\tch = bh;\n\t\t\t\t\t\t\t\tcl = bl;\n\t\t\t\t\t\t\t\tbh = ah;\n\t\t\t\t\t\t\t\tbl = al;\n\t\t\t\t\t\t\t\tal = t1l + t2l | 0;\n\t\t\t\t\t\t\t\tah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tH0l = H0.low = H0l + al;\n\t\t\t\t\t\t\tH0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH1l = H1.low = H1l + bl;\n\t\t\t\t\t\t\tH1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH2l = H2.low = H2l + cl;\n\t\t\t\t\t\t\tH2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH3l = H3.low = H3l + dl;\n\t\t\t\t\t\t\tH3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH4l = H4.low = H4l + el;\n\t\t\t\t\t\t\tH4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH5l = H5.low = H5l + fl;\n\t\t\t\t\t\t\tH5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH6l = H6.low = H6l + gl;\n\t\t\t\t\t\t\tH6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t\tH7l = H7.low = H7l + hl;\n\t\t\t\t\t\t\tH7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Convert hash to 32-bit word array before returning\n\t\t\t\t\t\t\tvar hash = this._hash.toX32();\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 1024 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA512('message');\n * var hash = CryptoJS.SHA512(wordArray);\n */\n\t\t\t\t\tC.SHA512 = Hasher._createHelper(SHA512);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA512(message, key);\n */\n\t\t\t\t\tC.HmacSHA512 = Hasher._createHmacHelper(SHA512);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA512;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 16 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7), __webpack_require__(15));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\", \"./sha512\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar X64WordArray = C_x64.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA512 = C_algo.SHA512;\n\n\t\t\t\t\t/**\n * SHA-384 hash algorithm.\n */\n\t\t\t\t\tvar SHA384 = C_algo.SHA384 = SHA512.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = new X64WordArray.init([new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\tvar hash = SHA512._doFinalize.call(this);\n\n\t\t\t\t\t\t\thash.sigBytes -= 16;\n\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA384('message');\n * var hash = CryptoJS.SHA384(wordArray);\n */\n\t\t\t\t\tC.SHA384 = SHA512._createHelper(SHA384);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA384(message, key);\n */\n\t\t\t\t\tC.HmacSHA384 = SHA512._createHmacHelper(SHA384);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.SHA384;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 17 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(7));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_x64 = C.x64;\n\t\t\t\t\tvar X64Word = C_x64.Word;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants tables\n\t\t\t\t\tvar RHO_OFFSETS = [];\n\t\t\t\t\tvar PI_INDEXES = [];\n\t\t\t\t\tvar ROUND_CONSTANTS = [];\n\n\t\t\t\t\t// Compute Constants\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t// Compute rho offset constants\n\t\t\t\t\t\tvar x = 1,\n\t\t\t\t\t\t y = 0;\n\t\t\t\t\t\tfor (var t = 0; t < 24; t++) {\n\t\t\t\t\t\t\tRHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;\n\n\t\t\t\t\t\t\tvar newX = y % 5;\n\t\t\t\t\t\t\tvar newY = (2 * x + 3 * y) % 5;\n\t\t\t\t\t\t\tx = newX;\n\t\t\t\t\t\t\ty = newY;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Compute pi index constants\n\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\tPI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Compute round constants\n\t\t\t\t\t\tvar LFSR = 0x01;\n\t\t\t\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\t\t\t\tvar roundConstantMsw = 0;\n\t\t\t\t\t\t\tvar roundConstantLsw = 0;\n\n\t\t\t\t\t\t\tfor (var j = 0; j < 7; j++) {\n\t\t\t\t\t\t\t\tif (LFSR & 0x01) {\n\t\t\t\t\t\t\t\t\tvar bitPosition = (1 << j) - 1;\n\t\t\t\t\t\t\t\t\tif (bitPosition < 32) {\n\t\t\t\t\t\t\t\t\t\troundConstantLsw ^= 1 << bitPosition;\n\t\t\t\t\t\t\t\t\t} else /* if (bitPosition >= 32) */{\n\t\t\t\t\t\t\t\t\t\t\troundConstantMsw ^= 1 << bitPosition - 32;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Compute next LFSR\n\t\t\t\t\t\t\t\tif (LFSR & 0x80) {\n\t\t\t\t\t\t\t\t\t// Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n\t\t\t\t\t\t\t\t\tLFSR = LFSR << 1 ^ 0x71;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tLFSR <<= 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Reusable objects for temporary values\n\t\t\t\t\tvar T = [];\n\t\t\t\t\t(function () {\n\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\tT[i] = X64Word.create();\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t/**\n * SHA-3 hash algorithm.\n */\n\t\t\t\t\tvar SHA3 = C_algo.SHA3 = Hasher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} outputLength\n * The desired number of bits in the output hash.\n * Only values permitted are: 224, 256, 384, 512.\n * Default: 512\n */\n\t\t\t\t\t\tcfg: Hasher.cfg.extend({\n\t\t\t\t\t\t\toutputLength: 512\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tvar state = this._state = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\t\tstate[i] = new X64Word.init();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar state = this._state;\n\t\t\t\t\t\t\tvar nBlockSizeLanes = this.blockSize / 2;\n\n\t\t\t\t\t\t\t// Absorb\n\t\t\t\t\t\t\tfor (var i = 0; i < nBlockSizeLanes; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar M2i = M[offset + 2 * i];\n\t\t\t\t\t\t\t\tvar M2i1 = M[offset + 2 * i + 1];\n\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tM2i = (M2i << 8 | M2i >>> 24) & 0x00ff00ff | (M2i << 24 | M2i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tM2i1 = (M2i1 << 8 | M2i1 >>> 24) & 0x00ff00ff | (M2i1 << 24 | M2i1 >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Absorb message into state\n\t\t\t\t\t\t\t\tvar lane = state[i];\n\t\t\t\t\t\t\t\tlane.high ^= M2i1;\n\t\t\t\t\t\t\t\tlane.low ^= M2i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 0; round < 24; round++) {\n\t\t\t\t\t\t\t\t// Theta\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\t// Mix column lanes\n\t\t\t\t\t\t\t\t\tvar tMsw = 0,\n\t\t\t\t\t\t\t\t\t tLsw = 0;\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\tvar lane = state[x + 5 * y];\n\t\t\t\t\t\t\t\t\t\ttMsw ^= lane.high;\n\t\t\t\t\t\t\t\t\t\ttLsw ^= lane.low;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Temporary values\n\t\t\t\t\t\t\t\t\tvar Tx = T[x];\n\t\t\t\t\t\t\t\t\tTx.high = tMsw;\n\t\t\t\t\t\t\t\t\tTx.low = tLsw;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\tvar Tx4 = T[(x + 4) % 5];\n\t\t\t\t\t\t\t\t\tvar Tx1 = T[(x + 1) % 5];\n\t\t\t\t\t\t\t\t\tvar Tx1Msw = Tx1.high;\n\t\t\t\t\t\t\t\t\tvar Tx1Lsw = Tx1.low;\n\n\t\t\t\t\t\t\t\t\t// Mix surrounding columns\n\t\t\t\t\t\t\t\t\tvar tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);\n\t\t\t\t\t\t\t\t\tvar tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\tvar lane = state[x + 5 * y];\n\t\t\t\t\t\t\t\t\t\tlane.high ^= tMsw;\n\t\t\t\t\t\t\t\t\t\tlane.low ^= tLsw;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Rho Pi\n\t\t\t\t\t\t\t\tfor (var laneIndex = 1; laneIndex < 25; laneIndex++) {\n\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\tvar lane = state[laneIndex];\n\t\t\t\t\t\t\t\t\tvar laneMsw = lane.high;\n\t\t\t\t\t\t\t\t\tvar laneLsw = lane.low;\n\t\t\t\t\t\t\t\t\tvar rhoOffset = RHO_OFFSETS[laneIndex];\n\n\t\t\t\t\t\t\t\t\t// Rotate lanes\n\t\t\t\t\t\t\t\t\tif (rhoOffset < 32) {\n\t\t\t\t\t\t\t\t\t\tvar tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\tvar tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;\n\t\t\t\t\t\t\t\t\t} else /* if (rhoOffset >= 32) */{\n\t\t\t\t\t\t\t\t\t\t\tvar tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\t\tvar tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Transpose lanes\n\t\t\t\t\t\t\t\t\tvar TPiLane = T[PI_INDEXES[laneIndex]];\n\t\t\t\t\t\t\t\t\tTPiLane.high = tMsw;\n\t\t\t\t\t\t\t\t\tTPiLane.low = tLsw;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Rho pi at x = y = 0\n\t\t\t\t\t\t\t\tvar T0 = T[0];\n\t\t\t\t\t\t\t\tvar state0 = state[0];\n\t\t\t\t\t\t\t\tT0.high = state0.high;\n\t\t\t\t\t\t\t\tT0.low = state0.low;\n\n\t\t\t\t\t\t\t\t// Chi\n\t\t\t\t\t\t\t\tfor (var x = 0; x < 5; x++) {\n\t\t\t\t\t\t\t\t\tfor (var y = 0; y < 5; y++) {\n\t\t\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\t\t\tvar laneIndex = x + 5 * y;\n\t\t\t\t\t\t\t\t\t\tvar lane = state[laneIndex];\n\t\t\t\t\t\t\t\t\t\tvar TLane = T[laneIndex];\n\t\t\t\t\t\t\t\t\t\tvar Tx1Lane = T[(x + 1) % 5 + 5 * y];\n\t\t\t\t\t\t\t\t\t\tvar Tx2Lane = T[(x + 2) % 5 + 5 * y];\n\n\t\t\t\t\t\t\t\t\t\t// Mix rows\n\t\t\t\t\t\t\t\t\t\tlane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;\n\t\t\t\t\t\t\t\t\t\tlane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Iota\n\t\t\t\t\t\t\t\tvar lane = state[0];\n\t\t\t\t\t\t\t\tvar roundConstant = ROUND_CONSTANTS[round];\n\t\t\t\t\t\t\t\tlane.high ^= roundConstant.high;\n\t\t\t\t\t\t\t\tlane.low ^= roundConstant.low;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\t\t\t\t\t\t\tvar blockSizeBits = this.blockSize * 32;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x1 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 0x80;\n\t\t\t\t\t\t\tdata.sigBytes = dataWords.length * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar state = this._state;\n\t\t\t\t\t\t\tvar outputLengthBytes = this.cfg.outputLength / 8;\n\t\t\t\t\t\t\tvar outputLengthLanes = outputLengthBytes / 8;\n\n\t\t\t\t\t\t\t// Squeeze\n\t\t\t\t\t\t\tvar hashWords = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < outputLengthLanes; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar lane = state[i];\n\t\t\t\t\t\t\t\tvar laneMsw = lane.high;\n\t\t\t\t\t\t\t\tvar laneLsw = lane.low;\n\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tlaneMsw = (laneMsw << 8 | laneMsw >>> 24) & 0x00ff00ff | (laneMsw << 24 | laneMsw >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tlaneLsw = (laneLsw << 8 | laneLsw >>> 24) & 0x00ff00ff | (laneLsw << 24 | laneLsw >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Squeeze state to retrieve hash\n\t\t\t\t\t\t\t\thashWords.push(laneLsw);\n\t\t\t\t\t\t\t\thashWords.push(laneMsw);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn new WordArray.init(hashWords, outputLengthBytes);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\n\t\t\t\t\t\t\tvar state = clone._state = this._state.slice(0);\n\t\t\t\t\t\t\tfor (var i = 0; i < 25; i++) {\n\t\t\t\t\t\t\t\tstate[i] = state[i].clone();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA3('message');\n * var hash = CryptoJS.SHA3(wordArray);\n */\n\t\t\t\t\tC.SHA3 = Hasher._createHelper(SHA3);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA3(message, key);\n */\n\t\t\t\t\tC.HmacSHA3 = Hasher._createHmacHelper(SHA3);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.SHA3;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 18 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/** @preserve\n (c) 2012 by Cédric Mesnil. All rights reserved.\n \tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n \t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n \tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n\t\t\t\t(function (Math) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar Hasher = C_lib.Hasher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Constants table\n\t\t\t\t\tvar _zl = WordArray.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]);\n\t\t\t\t\tvar _zr = WordArray.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]);\n\t\t\t\t\tvar _sl = WordArray.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]);\n\t\t\t\t\tvar _sr = WordArray.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]);\n\n\t\t\t\t\tvar _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\n\t\t\t\t\tvar _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\n\t\t\t\t\t/**\n * RIPEMD160 hash algorithm.\n */\n\t\t\t\t\tvar RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tthis._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar offset_i = offset + i;\n\t\t\t\t\t\t\t\tvar M_offset_i = M[offset_i];\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tM[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar H = this._hash.words;\n\t\t\t\t\t\t\tvar hl = _hl.words;\n\t\t\t\t\t\t\tvar hr = _hr.words;\n\t\t\t\t\t\t\tvar zl = _zl.words;\n\t\t\t\t\t\t\tvar zr = _zr.words;\n\t\t\t\t\t\t\tvar sl = _sl.words;\n\t\t\t\t\t\t\tvar sr = _sr.words;\n\n\t\t\t\t\t\t\t// Working variables\n\t\t\t\t\t\t\tvar al, bl, cl, dl, el;\n\t\t\t\t\t\t\tvar ar, br, cr, dr, er;\n\n\t\t\t\t\t\t\tar = al = H[0];\n\t\t\t\t\t\t\tbr = bl = H[1];\n\t\t\t\t\t\t\tcr = cl = H[2];\n\t\t\t\t\t\t\tdr = dl = H[3];\n\t\t\t\t\t\t\ter = el = H[4];\n\t\t\t\t\t\t\t// Computation\n\t\t\t\t\t\t\tvar t;\n\t\t\t\t\t\t\tfor (var i = 0; i < 80; i += 1) {\n\t\t\t\t\t\t\t\tt = al + M[offset + zl[i]] | 0;\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tt += f1(bl, cl, dl) + hl[0];\n\t\t\t\t\t\t\t\t} else if (i < 32) {\n\t\t\t\t\t\t\t\t\tt += f2(bl, cl, dl) + hl[1];\n\t\t\t\t\t\t\t\t} else if (i < 48) {\n\t\t\t\t\t\t\t\t\tt += f3(bl, cl, dl) + hl[2];\n\t\t\t\t\t\t\t\t} else if (i < 64) {\n\t\t\t\t\t\t\t\t\tt += f4(bl, cl, dl) + hl[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if (i<80) {\n\t\t\t\t\t\t\t\t\tt += f5(bl, cl, dl) + hl[4];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tt = t | 0;\n\t\t\t\t\t\t\t\tt = rotl(t, sl[i]);\n\t\t\t\t\t\t\t\tt = t + el | 0;\n\t\t\t\t\t\t\t\tal = el;\n\t\t\t\t\t\t\t\tel = dl;\n\t\t\t\t\t\t\t\tdl = rotl(cl, 10);\n\t\t\t\t\t\t\t\tcl = bl;\n\t\t\t\t\t\t\t\tbl = t;\n\n\t\t\t\t\t\t\t\tt = ar + M[offset + zr[i]] | 0;\n\t\t\t\t\t\t\t\tif (i < 16) {\n\t\t\t\t\t\t\t\t\tt += f5(br, cr, dr) + hr[0];\n\t\t\t\t\t\t\t\t} else if (i < 32) {\n\t\t\t\t\t\t\t\t\tt += f4(br, cr, dr) + hr[1];\n\t\t\t\t\t\t\t\t} else if (i < 48) {\n\t\t\t\t\t\t\t\t\tt += f3(br, cr, dr) + hr[2];\n\t\t\t\t\t\t\t\t} else if (i < 64) {\n\t\t\t\t\t\t\t\t\tt += f2(br, cr, dr) + hr[3];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if (i<80) {\n\t\t\t\t\t\t\t\t\tt += f1(br, cr, dr) + hr[4];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tt = t | 0;\n\t\t\t\t\t\t\t\tt = rotl(t, sr[i]);\n\t\t\t\t\t\t\t\tt = t + er | 0;\n\t\t\t\t\t\t\t\tar = er;\n\t\t\t\t\t\t\t\ter = dr;\n\t\t\t\t\t\t\t\tdr = rotl(cr, 10);\n\t\t\t\t\t\t\t\tcr = br;\n\t\t\t\t\t\t\t\tbr = t;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Intermediate hash value\n\t\t\t\t\t\t\tt = H[1] + cl + dr | 0;\n\t\t\t\t\t\t\tH[1] = H[2] + dl + er | 0;\n\t\t\t\t\t\t\tH[2] = H[3] + el + ar | 0;\n\t\t\t\t\t\t\tH[3] = H[4] + al + br | 0;\n\t\t\t\t\t\t\tH[4] = H[0] + bl + cr | 0;\n\t\t\t\t\t\t\tH[0] = t;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar data = this._data;\n\t\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t\tvar nBitsTotal = this._nDataBytes * 8;\n\t\t\t\t\t\t\tvar nBitsLeft = data.sigBytes * 8;\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n\t\t\t\t\t\t\tdataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 0x00ff00ff | (nBitsTotal << 24 | nBitsTotal >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\tdata.sigBytes = (dataWords.length + 1) * 4;\n\n\t\t\t\t\t\t\t// Hash final blocks\n\t\t\t\t\t\t\tthis._process();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hash = this._hash;\n\t\t\t\t\t\t\tvar H = hash.words;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar H_i = H[i];\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tH[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Return final computed hash\n\t\t\t\t\t\t\treturn hash;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tclone: function clone() {\n\t\t\t\t\t\t\tvar clone = Hasher.clone.call(this);\n\t\t\t\t\t\t\tclone._hash = this._hash.clone();\n\n\t\t\t\t\t\t\treturn clone;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction f1(x, y, z) {\n\t\t\t\t\t\treturn x ^ y ^ z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f2(x, y, z) {\n\t\t\t\t\t\treturn x & y | ~x & z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f3(x, y, z) {\n\t\t\t\t\t\treturn (x | ~y) ^ z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f4(x, y, z) {\n\t\t\t\t\t\treturn x & z | y & ~z;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction f5(x, y, z) {\n\t\t\t\t\t\treturn x ^ (y | ~z);\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction rotl(x, n) {\n\t\t\t\t\t\treturn x << n | x >>> 32 - n;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.RIPEMD160('message');\n * var hash = CryptoJS.RIPEMD160(wordArray);\n */\n\t\t\t\t\tC.RIPEMD160 = Hasher._createHelper(RIPEMD160);\n\n\t\t\t\t\t/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n */\n\t\t\t\t\tC.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);\n\t\t\t\t})(Math);\n\n\t\t\t\treturn CryptoJS.RIPEMD160;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 19 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Utf8 = C_enc.Utf8;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t/**\n * HMAC algorithm.\n */\n\t\t\t\t\tvar HMAC = C_algo.HMAC = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created HMAC.\n *\n * @param {Hasher} hasher The hash algorithm to use.\n * @param {WordArray|string} key The secret key.\n *\n * @example\n *\n * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n */\n\t\t\t\t\t\tinit: function init(hasher, key) {\n\t\t\t\t\t\t\t// Init hasher\n\t\t\t\t\t\t\thasher = this._hasher = new hasher.init();\n\n\t\t\t\t\t\t\t// Convert string to WordArray, else assume WordArray already\n\t\t\t\t\t\t\tif (typeof key == 'string') {\n\t\t\t\t\t\t\t\tkey = Utf8.parse(key);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar hasherBlockSize = hasher.blockSize;\n\t\t\t\t\t\t\tvar hasherBlockSizeBytes = hasherBlockSize * 4;\n\n\t\t\t\t\t\t\t// Allow arbitrary length keys\n\t\t\t\t\t\t\tif (key.sigBytes > hasherBlockSizeBytes) {\n\t\t\t\t\t\t\t\tkey = hasher.finalize(key);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Clamp excess bits\n\t\t\t\t\t\t\tkey.clamp();\n\n\t\t\t\t\t\t\t// Clone key for inner and outer pads\n\t\t\t\t\t\t\tvar oKey = this._oKey = key.clone();\n\t\t\t\t\t\t\tvar iKey = this._iKey = key.clone();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar oKeyWords = oKey.words;\n\t\t\t\t\t\t\tvar iKeyWords = iKey.words;\n\n\t\t\t\t\t\t\t// XOR keys with pad constants\n\t\t\t\t\t\t\tfor (var i = 0; i < hasherBlockSize; i++) {\n\t\t\t\t\t\t\t\toKeyWords[i] ^= 0x5c5c5c5c;\n\t\t\t\t\t\t\t\tiKeyWords[i] ^= 0x36363636;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this HMAC to its initial state.\n *\n * @example\n *\n * hmacHasher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hasher = this._hasher;\n\n\t\t\t\t\t\t\t// Reset\n\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\thasher.update(this._iKey);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Updates this HMAC with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {HMAC} This HMAC instance.\n *\n * @example\n *\n * hmacHasher.update('message');\n * hmacHasher.update(wordArray);\n */\n\t\t\t\t\t\tupdate: function update(messageUpdate) {\n\t\t\t\t\t\t\tthis._hasher.update(messageUpdate);\n\n\t\t\t\t\t\t\t// Chainable\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the HMAC computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The HMAC.\n *\n * @example\n *\n * var hmac = hmacHasher.finalize();\n * var hmac = hmacHasher.finalize('message');\n * var hmac = hmacHasher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(messageUpdate) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar hasher = this._hasher;\n\n\t\t\t\t\t\t\t// Compute HMAC\n\t\t\t\t\t\t\tvar innerHash = hasher.finalize(messageUpdate);\n\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\tvar hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n\t\t\t\t\t\t\treturn hmac;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 20 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar SHA1 = C_algo.SHA1;\n\t\t\t\t\tvar HMAC = C_algo.HMAC;\n\n\t\t\t\t\t/**\n * Password-Based Key Derivation Function 2 algorithm.\n */\n\t\t\t\t\tvar PBKDF2 = C_algo.PBKDF2 = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hasher to use. Default: SHA1\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tkeySize: 128 / 32,\n\t\t\t\t\t\t\thasher: SHA1,\n\t\t\t\t\t\t\titerations: 1\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * var kdf = CryptoJS.algo.PBKDF2.create();\n * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });\n * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * var key = kdf.compute(password, salt);\n */\n\t\t\t\t\t\tcompute: function compute(password, salt) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\n\t\t\t\t\t\t\t// Init HMAC\n\t\t\t\t\t\t\tvar hmac = HMAC.create(cfg.hasher, password);\n\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tvar derivedKey = WordArray.create();\n\t\t\t\t\t\t\tvar blockIndex = WordArray.create([0x00000001]);\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar derivedKeyWords = derivedKey.words;\n\t\t\t\t\t\t\tvar blockIndexWords = blockIndex.words;\n\t\t\t\t\t\t\tvar keySize = cfg.keySize;\n\t\t\t\t\t\t\tvar iterations = cfg.iterations;\n\n\t\t\t\t\t\t\t// Generate key\n\t\t\t\t\t\t\twhile (derivedKeyWords.length < keySize) {\n\t\t\t\t\t\t\t\tvar block = hmac.update(salt).finalize(blockIndex);\n\t\t\t\t\t\t\t\thmac.reset();\n\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar blockWords = block.words;\n\t\t\t\t\t\t\t\tvar blockWordsLength = blockWords.length;\n\n\t\t\t\t\t\t\t\t// Iterations\n\t\t\t\t\t\t\t\tvar intermediate = block;\n\t\t\t\t\t\t\t\tfor (var i = 1; i < iterations; i++) {\n\t\t\t\t\t\t\t\t\tintermediate = hmac.finalize(intermediate);\n\t\t\t\t\t\t\t\t\thmac.reset();\n\n\t\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\t\tvar intermediateWords = intermediate.words;\n\n\t\t\t\t\t\t\t\t\t// XOR intermediate with block\n\t\t\t\t\t\t\t\t\tfor (var j = 0; j < blockWordsLength; j++) {\n\t\t\t\t\t\t\t\t\t\tblockWords[j] ^= intermediateWords[j];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tderivedKey.concat(block);\n\t\t\t\t\t\t\t\tblockIndexWords[0]++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tderivedKey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\treturn derivedKey;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.PBKDF2(password, salt);\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\tC.PBKDF2 = function (password, salt, cfg) {\n\t\t\t\t\t\treturn PBKDF2.create(cfg).compute(password, salt);\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.PBKDF2;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 21 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(12), __webpack_require__(19));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar MD5 = C_algo.MD5;\n\n\t\t\t\t\t/**\n * This key derivation function is meant to conform with EVP_BytesToKey.\n * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n */\n\t\t\t\t\tvar EvpKDF = C_algo.EvpKDF = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tkeySize: 128 / 32,\n\t\t\t\t\t\t\thasher: MD5,\n\t\t\t\t\t\t\titerations: 1\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * var kdf = CryptoJS.algo.EvpKDF.create();\n * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\t\tinit: function init(cfg) {\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * var key = kdf.compute(password, salt);\n */\n\t\t\t\t\t\tcompute: function compute(password, salt) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\n\t\t\t\t\t\t\t// Init hasher\n\t\t\t\t\t\t\tvar hasher = cfg.hasher.create();\n\n\t\t\t\t\t\t\t// Initial values\n\t\t\t\t\t\t\tvar derivedKey = WordArray.create();\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar derivedKeyWords = derivedKey.words;\n\t\t\t\t\t\t\tvar keySize = cfg.keySize;\n\t\t\t\t\t\t\tvar iterations = cfg.iterations;\n\n\t\t\t\t\t\t\t// Generate key\n\t\t\t\t\t\t\twhile (derivedKeyWords.length < keySize) {\n\t\t\t\t\t\t\t\tif (block) {\n\t\t\t\t\t\t\t\t\thasher.update(block);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvar block = hasher.update(password).finalize(salt);\n\t\t\t\t\t\t\t\thasher.reset();\n\n\t\t\t\t\t\t\t\t// Iterations\n\t\t\t\t\t\t\t\tfor (var i = 1; i < iterations; i++) {\n\t\t\t\t\t\t\t\t\tblock = hasher.finalize(block);\n\t\t\t\t\t\t\t\t\thasher.reset();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tderivedKey.concat(block);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tderivedKey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\treturn derivedKey;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.EvpKDF(password, salt);\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n */\n\t\t\t\t\tC.EvpKDF = function (password, salt, cfg) {\n\t\t\t\t\t\treturn EvpKDF.create(cfg).compute(password, salt);\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.EvpKDF;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 22 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(21));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./evpkdf\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Cipher core components.\n */\n\t\t\t\tCryptoJS.lib.Cipher || function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar Base = C_lib.Base;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Utf8 = C_enc.Utf8;\n\t\t\t\t\tvar Base64 = C_enc.Base64;\n\t\t\t\t\tvar C_algo = C.algo;\n\t\t\t\t\tvar EvpKDF = C_algo.EvpKDF;\n\n\t\t\t\t\t/**\n * Abstract base cipher template.\n *\n * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n */\n\t\t\t\t\tvar Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {WordArray} iv The IV to use for this operation.\n */\n\t\t\t\t\t\tcfg: Base.extend(),\n\n\t\t\t\t\t\t/**\n * Creates this cipher in encryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tcreateEncryptor: function createEncryptor(key, cfg) {\n\t\t\t\t\t\t\treturn this.create(this._ENC_XFORM_MODE, key, cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates this cipher in decryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tcreateDecryptor: function createDecryptor(key, cfg) {\n\t\t\t\t\t\t\treturn this.create(this._DEC_XFORM_MODE, key, cfg);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Initializes a newly created cipher.\n *\n * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @example\n *\n * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });\n */\n\t\t\t\t\t\tinit: function init(xformMode, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tthis.cfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Store transform mode and key\n\t\t\t\t\t\t\tthis._xformMode = xformMode;\n\t\t\t\t\t\t\tthis._key = key;\n\n\t\t\t\t\t\t\t// Set initial values\n\t\t\t\t\t\t\tthis.reset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Resets this cipher to its initial state.\n *\n * @example\n *\n * cipher.reset();\n */\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset data buffer\n\t\t\t\t\t\t\tBufferedBlockAlgorithm.reset.call(this);\n\n\t\t\t\t\t\t\t// Perform concrete-cipher logic\n\t\t\t\t\t\t\tthis._doReset();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Adds data to be encrypted or decrypted.\n *\n * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n *\n * @return {WordArray} The data after processing.\n *\n * @example\n *\n * var encrypted = cipher.process('data');\n * var encrypted = cipher.process(wordArray);\n */\n\t\t\t\t\t\tprocess: function process(dataUpdate) {\n\t\t\t\t\t\t\t// Append\n\t\t\t\t\t\t\tthis._append(dataUpdate);\n\n\t\t\t\t\t\t\t// Process available blocks\n\t\t\t\t\t\t\treturn this._process();\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Finalizes the encryption or decryption process.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n *\n * @return {WordArray} The data after final processing.\n *\n * @example\n *\n * var encrypted = cipher.finalize();\n * var encrypted = cipher.finalize('data');\n * var encrypted = cipher.finalize(wordArray);\n */\n\t\t\t\t\t\tfinalize: function finalize(dataUpdate) {\n\t\t\t\t\t\t\t// Final data update\n\t\t\t\t\t\t\tif (dataUpdate) {\n\t\t\t\t\t\t\t\tthis._append(dataUpdate);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Perform concrete-cipher logic\n\t\t\t\t\t\t\tvar finalProcessedData = this._doFinalize();\n\n\t\t\t\t\t\t\treturn finalProcessedData;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 128 / 32,\n\n\t\t\t\t\t\t_ENC_XFORM_MODE: 1,\n\n\t\t\t\t\t\t_DEC_XFORM_MODE: 2,\n\n\t\t\t\t\t\t/**\n * Creates shortcut functions to a cipher's object interface.\n *\n * @param {Cipher} cipher The cipher to create a helper for.\n *\n * @return {Object} An object with encrypt and decrypt shortcut functions.\n *\n * @static\n *\n * @example\n *\n * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n */\n\t\t\t\t\t\t_createHelper: function () {\n\t\t\t\t\t\t\tfunction selectCipherStrategy(key) {\n\t\t\t\t\t\t\t\tif (typeof key == 'string') {\n\t\t\t\t\t\t\t\t\treturn PasswordBasedCipher;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn SerializableCipher;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn function (cipher) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tencrypt: function encrypt(message, key, cfg) {\n\t\t\t\t\t\t\t\t\t\treturn selectCipherStrategy(key).encrypt(cipher, message, key, cfg);\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\tdecrypt: function decrypt(ciphertext, key, cfg) {\n\t\t\t\t\t\t\t\t\t\treturn selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}()\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Abstract base stream cipher template.\n *\n * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n */\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher = Cipher.extend({\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Process partial blocks\n\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\n\t\t\t\t\t\t\treturn finalProcessedBlocks;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 1\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Mode namespace.\n */\n\t\t\t\t\tvar C_mode = C.mode = {};\n\n\t\t\t\t\t/**\n * Abstract base block cipher mode template.\n */\n\t\t\t\t\tvar BlockCipherMode = C_lib.BlockCipherMode = Base.extend({\n\t\t\t\t\t\t/**\n * Creates this mode for encryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n */\n\t\t\t\t\t\tcreateEncryptor: function createEncryptor(cipher, iv) {\n\t\t\t\t\t\t\treturn this.Encryptor.create(cipher, iv);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Creates this mode for decryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n */\n\t\t\t\t\t\tcreateDecryptor: function createDecryptor(cipher, iv) {\n\t\t\t\t\t\t\treturn this.Decryptor.create(cipher, iv);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Initializes a newly created mode.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @example\n *\n * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n */\n\t\t\t\t\t\tinit: function init(cipher, iv) {\n\t\t\t\t\t\t\tthis._cipher = cipher;\n\t\t\t\t\t\t\tthis._iv = iv;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Cipher Block Chaining mode.\n */\n\t\t\t\t\tvar CBC = C_mode.CBC = function () {\n\t\t\t\t\t\t/**\n * Abstract base CBC mode.\n */\n\t\t\t\t\t\tvar CBC = BlockCipherMode.extend();\n\n\t\t\t\t\t\t/**\n * CBC encryptor.\n */\n\t\t\t\t\t\tCBC.Encryptor = CBC.extend({\n\t\t\t\t\t\t\t/**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n\t\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t\t// XOR and encrypt\n\t\t\t\t\t\t\t\txorBlock.call(this, words, offset, blockSize);\n\t\t\t\t\t\t\t\tcipher.encryptBlock(words, offset);\n\n\t\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\t\tthis._prevBlock = words.slice(offset, offset + blockSize);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t/**\n * CBC decryptor.\n */\n\t\t\t\t\t\tCBC.Decryptor = CBC.extend({\n\t\t\t\t\t\t\t/**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n\t\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\t\tvar thisBlock = words.slice(offset, offset + blockSize);\n\n\t\t\t\t\t\t\t\t// Decrypt and XOR\n\t\t\t\t\t\t\t\tcipher.decryptBlock(words, offset);\n\t\t\t\t\t\t\t\txorBlock.call(this, words, offset, blockSize);\n\n\t\t\t\t\t\t\t\t// This block becomes the previous block\n\t\t\t\t\t\t\t\tthis._prevBlock = thisBlock;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tfunction xorBlock(words, offset, blockSize) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar iv = this._iv;\n\n\t\t\t\t\t\t\t// Choose mixing block\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tvar block = iv;\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar block = this._prevBlock;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// XOR blocks\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= block[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn CBC;\n\t\t\t\t\t}();\n\n\t\t\t\t\t/**\n * Padding namespace.\n */\n\t\t\t\t\tvar C_pad = C.pad = {};\n\n\t\t\t\t\t/**\n * PKCS #5/7 padding strategy.\n */\n\t\t\t\t\tvar Pkcs7 = C_pad.Pkcs7 = {\n\t\t\t\t\t\t/**\n * Pads data using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to pad.\n * @param {number} blockSize The multiple that the data should be padded to.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n */\n\t\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t\t// Create padding word\n\t\t\t\t\t\t\tvar paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes;\n\n\t\t\t\t\t\t\t// Create padding\n\t\t\t\t\t\t\tvar paddingWords = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < nPaddingBytes; i += 4) {\n\t\t\t\t\t\t\t\tpaddingWords.push(paddingWord);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar padding = WordArray.create(paddingWords, nPaddingBytes);\n\n\t\t\t\t\t\t\t// Add padding\n\t\t\t\t\t\t\tdata.concat(padding);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to unpad.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.unpad(wordArray);\n */\n\t\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * Abstract base block cipher template.\n *\n * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n */\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher = Cipher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {Mode} mode The block mode to use. Default: CBC\n * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n */\n\t\t\t\t\t\tcfg: Cipher.cfg.extend({\n\t\t\t\t\t\t\tmode: CBC,\n\t\t\t\t\t\t\tpadding: Pkcs7\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\treset: function reset() {\n\t\t\t\t\t\t\t// Reset cipher\n\t\t\t\t\t\t\tCipher.reset.call(this);\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cfg = this.cfg;\n\t\t\t\t\t\t\tvar iv = cfg.iv;\n\t\t\t\t\t\t\tvar mode = cfg.mode;\n\n\t\t\t\t\t\t\t// Reset block mode\n\t\t\t\t\t\t\tif (this._xformMode == this._ENC_XFORM_MODE) {\n\t\t\t\t\t\t\t\tvar modeCreator = mode.createEncryptor;\n\t\t\t\t\t\t\t} else /* if (this._xformMode == this._DEC_XFORM_MODE) */{\n\t\t\t\t\t\t\t\t\tvar modeCreator = mode.createDecryptor;\n\t\t\t\t\t\t\t\t\t// Keep at least one block in the buffer for unpadding\n\t\t\t\t\t\t\t\t\tthis._minBufferSize = 1;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (this._mode && this._mode.__creator == modeCreator) {\n\t\t\t\t\t\t\t\tthis._mode.init(this, iv && iv.words);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._mode = modeCreator.call(mode, this, iv && iv.words);\n\t\t\t\t\t\t\t\tthis._mode.__creator = modeCreator;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(words, offset) {\n\t\t\t\t\t\t\tthis._mode.processBlock(words, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doFinalize: function _doFinalize() {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar padding = this.cfg.padding;\n\n\t\t\t\t\t\t\t// Finalize\n\t\t\t\t\t\t\tif (this._xformMode == this._ENC_XFORM_MODE) {\n\t\t\t\t\t\t\t\t// Pad data\n\t\t\t\t\t\t\t\tpadding.pad(this._data, this.blockSize);\n\n\t\t\t\t\t\t\t\t// Process final blocks\n\t\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\t\t\t\t\t\t\t} else /* if (this._xformMode == this._DEC_XFORM_MODE) */{\n\t\t\t\t\t\t\t\t\t// Process final blocks\n\t\t\t\t\t\t\t\t\tvar finalProcessedBlocks = this._process(!!'flush');\n\n\t\t\t\t\t\t\t\t\t// Unpad data\n\t\t\t\t\t\t\t\t\tpadding.unpad(finalProcessedBlocks);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn finalProcessedBlocks;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * A collection of cipher parameters.\n *\n * @property {WordArray} ciphertext The raw ciphertext.\n * @property {WordArray} key The key to this ciphertext.\n * @property {WordArray} iv The IV used in the ciphering operation.\n * @property {WordArray} salt The salt used with a key derivation function.\n * @property {Cipher} algorithm The cipher algorithm.\n * @property {Mode} mode The block mode used in the ciphering operation.\n * @property {Padding} padding The padding scheme used in the ciphering operation.\n * @property {number} blockSize The block size of the cipher.\n * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.\n */\n\t\t\t\t\tvar CipherParams = C_lib.CipherParams = Base.extend({\n\t\t\t\t\t\t/**\n * Initializes a newly created cipher params object.\n *\n * @param {Object} cipherParams An object with any of the possible cipher parameters.\n *\n * @example\n *\n * var cipherParams = CryptoJS.lib.CipherParams.create({\n * ciphertext: ciphertextWordArray,\n * key: keyWordArray,\n * iv: ivWordArray,\n * salt: saltWordArray,\n * algorithm: CryptoJS.algo.AES,\n * mode: CryptoJS.mode.CBC,\n * padding: CryptoJS.pad.PKCS7,\n * blockSize: 4,\n * formatter: CryptoJS.format.OpenSSL\n * });\n */\n\t\t\t\t\t\tinit: function init(cipherParams) {\n\t\t\t\t\t\t\tthis.mixIn(cipherParams);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts this cipher params object to a string.\n *\n * @param {Format} formatter (Optional) The formatting strategy to use.\n *\n * @return {string} The stringified cipher params.\n *\n * @throws Error If neither the formatter nor the default formatter is set.\n *\n * @example\n *\n * var string = cipherParams + '';\n * var string = cipherParams.toString();\n * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n */\n\t\t\t\t\t\ttoString: function toString(formatter) {\n\t\t\t\t\t\t\treturn (formatter || this.formatter).stringify(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Format namespace.\n */\n\t\t\t\t\tvar C_format = C.format = {};\n\n\t\t\t\t\t/**\n * OpenSSL formatting strategy.\n */\n\t\t\t\t\tvar OpenSSLFormatter = C_format.OpenSSL = {\n\t\t\t\t\t\t/**\n * Converts a cipher params object to an OpenSSL-compatible string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The OpenSSL-compatible string.\n *\n * @static\n *\n * @example\n *\n * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n */\n\t\t\t\t\t\tstringify: function stringify(cipherParams) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar ciphertext = cipherParams.ciphertext;\n\t\t\t\t\t\t\tvar salt = cipherParams.salt;\n\n\t\t\t\t\t\t\t// Format\n\t\t\t\t\t\t\tif (salt) {\n\t\t\t\t\t\t\t\tvar wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar wordArray = ciphertext;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn wordArray.toString(Base64);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts an OpenSSL-compatible string to a cipher params object.\n *\n * @param {string} openSSLStr The OpenSSL-compatible string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n */\n\t\t\t\t\t\tparse: function parse(openSSLStr) {\n\t\t\t\t\t\t\t// Parse base64\n\t\t\t\t\t\t\tvar ciphertext = Base64.parse(openSSLStr);\n\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar ciphertextWords = ciphertext.words;\n\n\t\t\t\t\t\t\t// Test for salt\n\t\t\t\t\t\t\tif (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {\n\t\t\t\t\t\t\t\t// Extract salt\n\t\t\t\t\t\t\t\tvar salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n\t\t\t\t\t\t\t\t// Remove salt from ciphertext\n\t\t\t\t\t\t\t\tciphertextWords.splice(0, 4);\n\t\t\t\t\t\t\t\tciphertext.sigBytes -= 16;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn CipherParams.create({ ciphertext: ciphertext, salt: salt });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n */\n\t\t\t\t\tvar SerializableCipher = C_lib.SerializableCipher = Base.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL\n */\n\t\t\t\t\t\tcfg: Base.extend({\n\t\t\t\t\t\t\tformat: OpenSSLFormatter\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Encrypts a message.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tencrypt: function encrypt(cipher, message, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tvar encryptor = cipher.createEncryptor(key, cfg);\n\t\t\t\t\t\t\tvar ciphertext = encryptor.finalize(message);\n\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar cipherCfg = encryptor.cfg;\n\n\t\t\t\t\t\t\t// Create and return serializable cipher params\n\t\t\t\t\t\t\treturn CipherParams.create({\n\t\t\t\t\t\t\t\tciphertext: ciphertext,\n\t\t\t\t\t\t\t\tkey: key,\n\t\t\t\t\t\t\t\tiv: cipherCfg.iv,\n\t\t\t\t\t\t\t\talgorithm: cipher,\n\t\t\t\t\t\t\t\tmode: cipherCfg.mode,\n\t\t\t\t\t\t\t\tpadding: cipherCfg.padding,\n\t\t\t\t\t\t\t\tblockSize: cipher.blockSize,\n\t\t\t\t\t\t\t\tformatter: cfg.format\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Decrypts serialized ciphertext.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tdecrypt: function decrypt(cipher, ciphertext, key, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Convert string to CipherParams\n\t\t\t\t\t\t\tciphertext = this._parse(ciphertext, cfg.format);\n\n\t\t\t\t\t\t\t// Decrypt\n\t\t\t\t\t\t\tvar plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);\n\n\t\t\t\t\t\t\treturn plaintext;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts serialized ciphertext to CipherParams,\n * else assumed CipherParams already and returns ciphertext unchanged.\n *\n * @param {CipherParams|string} ciphertext The ciphertext.\n * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n *\n * @return {CipherParams} The unserialized ciphertext.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);\n */\n\t\t\t\t\t\t_parse: function _parse(ciphertext, format) {\n\t\t\t\t\t\t\tif (typeof ciphertext == 'string') {\n\t\t\t\t\t\t\t\treturn format.parse(ciphertext, this);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn ciphertext;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Key derivation function namespace.\n */\n\t\t\t\t\tvar C_kdf = C.kdf = {};\n\n\t\t\t\t\t/**\n * OpenSSL key derivation function.\n */\n\t\t\t\t\tvar OpenSSLKdf = C_kdf.OpenSSL = {\n\t\t\t\t\t\t/**\n * Derives a key and IV from a password.\n *\n * @param {string} password The password to derive from.\n * @param {number} keySize The size in words of the key to generate.\n * @param {number} ivSize The size in words of the IV to generate.\n * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n *\n * @return {CipherParams} A cipher params object with the key, IV, and salt.\n *\n * @static\n *\n * @example\n *\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n */\n\t\t\t\t\t\texecute: function execute(password, keySize, ivSize, salt) {\n\t\t\t\t\t\t\t// Generate random salt\n\t\t\t\t\t\t\tif (!salt) {\n\t\t\t\t\t\t\t\tsalt = WordArray.random(64 / 8);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Derive key and IV\n\t\t\t\t\t\t\tvar key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);\n\n\t\t\t\t\t\t\t// Separate key and IV\n\t\t\t\t\t\t\tvar iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n\t\t\t\t\t\t\tkey.sigBytes = keySize * 4;\n\n\t\t\t\t\t\t\t// Return params\n\t\t\t\t\t\t\treturn CipherParams.create({ key: key, iv: iv, salt: salt });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t/**\n * A serializable cipher wrapper that derives the key from a password,\n * and returns ciphertext as a serializable cipher params object.\n */\n\t\t\t\t\tvar PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL\n */\n\t\t\t\t\t\tcfg: SerializableCipher.cfg.extend({\n\t\t\t\t\t\t\tkdf: OpenSSLKdf\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t/**\n * Encrypts a message using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tencrypt: function encrypt(cipher, message, password, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Derive key and other params\n\t\t\t\t\t\t\tvar derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);\n\n\t\t\t\t\t\t\t// Add IV to config\n\t\t\t\t\t\t\tcfg.iv = derivedParams.iv;\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tvar ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);\n\n\t\t\t\t\t\t\t// Mix in derived params\n\t\t\t\t\t\t\tciphertext.mixIn(derivedParams);\n\n\t\t\t\t\t\t\treturn ciphertext;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Decrypts serialized ciphertext using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });\n */\n\t\t\t\t\t\tdecrypt: function decrypt(cipher, ciphertext, password, cfg) {\n\t\t\t\t\t\t\t// Apply config defaults\n\t\t\t\t\t\t\tcfg = this.cfg.extend(cfg);\n\n\t\t\t\t\t\t\t// Convert string to CipherParams\n\t\t\t\t\t\t\tciphertext = this._parse(ciphertext, cfg.format);\n\n\t\t\t\t\t\t\t// Derive key and other params\n\t\t\t\t\t\t\tvar derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);\n\n\t\t\t\t\t\t\t// Add IV to config\n\t\t\t\t\t\t\tcfg.iv = derivedParams.iv;\n\n\t\t\t\t\t\t\t// Decrypt\n\t\t\t\t\t\t\tvar plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);\n\n\t\t\t\t\t\t\treturn plaintext;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}();\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 23 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Cipher Feedback block mode.\n */\n\t\t\t\tCryptoJS.mode.CFB = function () {\n\t\t\t\t\tvar CFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tCFB.Encryptor = CFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\tgenerateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\tthis._prevBlock = words.slice(offset, offset + blockSize);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCFB.Decryptor = CFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\n\t\t\t\t\t\t\t// Remember this block to use with next block\n\t\t\t\t\t\t\tvar thisBlock = words.slice(offset, offset + blockSize);\n\n\t\t\t\t\t\t\tgenerateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t\t\t\t\t\t\t// This block becomes the previous block\n\t\t\t\t\t\t\tthis._prevBlock = thisBlock;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar iv = this._iv;\n\n\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\tvar keystream = iv.slice(0);\n\n\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar keystream = this._prevBlock;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn CFB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CFB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 24 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Counter block mode.\n */\n\t\t\t\tCryptoJS.mode.CTR = function () {\n\t\t\t\t\tvar CTR = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tvar Encryptor = CTR.Encryptor = CTR.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar counter = this._counter;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tcounter = this._counter = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar keystream = counter.slice(0);\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Increment counter\n\t\t\t\t\t\t\tcounter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCTR.Decryptor = Encryptor;\n\n\t\t\t\t\treturn CTR;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CTR;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 25 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/** @preserve\n * Counter block mode compatible with Dr Brian Gladman fileenc.c\n * derived from CryptoJS.mode.CTR\n * Jan Hruby jhruby.web@gmail.com\n */\n\t\t\t\tCryptoJS.mode.CTRGladman = function () {\n\t\t\t\t\tvar CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tfunction incWord(word) {\n\t\t\t\t\t\tif ((word >> 24 & 0xff) === 0xff) {\n\t\t\t\t\t\t\t//overflow\n\t\t\t\t\t\t\tvar b1 = word >> 16 & 0xff;\n\t\t\t\t\t\t\tvar b2 = word >> 8 & 0xff;\n\t\t\t\t\t\t\tvar b3 = word & 0xff;\n\n\t\t\t\t\t\t\tif (b1 === 0xff) // overflow b1\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tb1 = 0;\n\t\t\t\t\t\t\t\t\tif (b2 === 0xff) {\n\t\t\t\t\t\t\t\t\t\tb2 = 0;\n\t\t\t\t\t\t\t\t\t\tif (b3 === 0xff) {\n\t\t\t\t\t\t\t\t\t\t\tb3 = 0;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t++b3;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t++b2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t++b1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tword = 0;\n\t\t\t\t\t\t\tword += b1 << 16;\n\t\t\t\t\t\t\tword += b2 << 8;\n\t\t\t\t\t\t\tword += b3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tword += 0x01 << 24;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn word;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction incCounter(counter) {\n\t\t\t\t\t\tif ((counter[0] = incWord(counter[0])) === 0) {\n\t\t\t\t\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\t\t\t\t\tcounter[1] = incWord(counter[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn counter;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar Encryptor = CTRGladman.Encryptor = CTRGladman.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar counter = this._counter;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tcounter = this._counter = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tincCounter(counter);\n\n\t\t\t\t\t\t\tvar keystream = counter.slice(0);\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tCTRGladman.Decryptor = Encryptor;\n\n\t\t\t\t\treturn CTRGladman;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.CTRGladman;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 26 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Output Feedback block mode.\n */\n\t\t\t\tCryptoJS.mode.OFB = function () {\n\t\t\t\t\tvar OFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tvar Encryptor = OFB.Encryptor = OFB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar cipher = this._cipher;\n\t\t\t\t\t\t\tvar blockSize = cipher.blockSize;\n\t\t\t\t\t\t\tvar iv = this._iv;\n\t\t\t\t\t\t\tvar keystream = this._keystream;\n\n\t\t\t\t\t\t\t// Generate keystream\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\tkeystream = this._keystream = iv.slice(0);\n\n\t\t\t\t\t\t\t\t// Remove IV for subsequent blocks\n\t\t\t\t\t\t\t\tthis._iv = undefined;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcipher.encryptBlock(keystream, 0);\n\n\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\tfor (var i = 0; i < blockSize; i++) {\n\t\t\t\t\t\t\t\twords[offset + i] ^= keystream[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tOFB.Decryptor = Encryptor;\n\n\t\t\t\t\treturn OFB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.OFB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 27 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Electronic Codebook block mode.\n */\n\t\t\t\tCryptoJS.mode.ECB = function () {\n\t\t\t\t\tvar ECB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\t\t\t\tECB.Encryptor = ECB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\tthis._cipher.encryptBlock(words, offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tECB.Decryptor = ECB.extend({\n\t\t\t\t\t\tprocessBlock: function processBlock(words, offset) {\n\t\t\t\t\t\t\tthis._cipher.decryptBlock(words, offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn ECB;\n\t\t\t\t}();\n\n\t\t\t\treturn CryptoJS.mode.ECB;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 28 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ANSI X.923 padding strategy.\n */\n\t\t\t\tCryptoJS.pad.AnsiX923 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar dataSigBytes = data.sigBytes;\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t// Compute last byte position\n\t\t\t\t\t\tvar lastBytePos = dataSigBytes + nPaddingBytes - 1;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.clamp();\n\t\t\t\t\t\tdata.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;\n\t\t\t\t\t\tdata.sigBytes += nPaddingBytes;\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Ansix923;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 29 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ISO 10126 padding strategy.\n */\n\t\t\t\tCryptoJS.pad.Iso10126 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Count padding bytes\n\t\t\t\t\t\tvar nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Get number of padding bytes from last byte\n\t\t\t\t\t\tvar nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff;\n\n\t\t\t\t\t\t// Remove padding\n\t\t\t\t\t\tdata.sigBytes -= nPaddingBytes;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Iso10126;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 30 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * ISO/IEC 9797-1 Padding Method 2.\n */\n\t\t\t\tCryptoJS.pad.Iso97971 = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Add 0x80 byte\n\t\t\t\t\t\tdata.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));\n\n\t\t\t\t\t\t// Zero pad the rest\n\t\t\t\t\t\tCryptoJS.pad.ZeroPadding.pad(data, blockSize);\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Remove zero padding\n\t\t\t\t\t\tCryptoJS.pad.ZeroPadding.unpad(data);\n\n\t\t\t\t\t\t// Remove one more byte -- the 0x80 byte\n\t\t\t\t\t\tdata.sigBytes--;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.Iso97971;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 31 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * Zero padding strategy.\n */\n\t\t\t\tCryptoJS.pad.ZeroPadding = {\n\t\t\t\t\tpad: function pad(data, blockSize) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar blockSizeBytes = blockSize * 4;\n\n\t\t\t\t\t\t// Pad\n\t\t\t\t\t\tdata.clamp();\n\t\t\t\t\t\tdata.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes);\n\t\t\t\t\t},\n\n\t\t\t\t\tunpad: function unpad(data) {\n\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\tvar dataWords = data.words;\n\n\t\t\t\t\t\t// Unpad\n\t\t\t\t\t\tvar i = data.sigBytes - 1;\n\t\t\t\t\t\twhile (!(dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff)) {\n\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdata.sigBytes = i + 1;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.ZeroPadding;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 32 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t/**\n * A noop padding strategy.\n */\n\t\t\t\tCryptoJS.pad.NoPadding = {\n\t\t\t\t\tpad: function pad() {},\n\n\t\t\t\t\tunpad: function unpad() {}\n\t\t\t\t};\n\n\t\t\t\treturn CryptoJS.pad.NoPadding;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 33 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function (undefined) {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar CipherParams = C_lib.CipherParams;\n\t\t\t\t\tvar C_enc = C.enc;\n\t\t\t\t\tvar Hex = C_enc.Hex;\n\t\t\t\t\tvar C_format = C.format;\n\n\t\t\t\t\tvar HexFormatter = C_format.Hex = {\n\t\t\t\t\t\t/**\n * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The hexadecimally encoded string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.format.Hex.stringify(cipherParams);\n */\n\t\t\t\t\t\tstringify: function stringify(cipherParams) {\n\t\t\t\t\t\t\treturn cipherParams.ciphertext.toString(Hex);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t/**\n * Converts a hexadecimally encoded ciphertext string to a cipher params object.\n *\n * @param {string} input The hexadecimally encoded string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.Hex.parse(hexString);\n */\n\t\t\t\t\t\tparse: function parse(input) {\n\t\t\t\t\t\t\tvar ciphertext = Hex.parse(input);\n\t\t\t\t\t\t\treturn CipherParams.create({ ciphertext: ciphertext });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.format.Hex;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 34 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Lookup tables\n\t\t\t\t\tvar SBOX = [];\n\t\t\t\t\tvar INV_SBOX = [];\n\t\t\t\t\tvar SUB_MIX_0 = [];\n\t\t\t\t\tvar SUB_MIX_1 = [];\n\t\t\t\t\tvar SUB_MIX_2 = [];\n\t\t\t\t\tvar SUB_MIX_3 = [];\n\t\t\t\t\tvar INV_SUB_MIX_0 = [];\n\t\t\t\t\tvar INV_SUB_MIX_1 = [];\n\t\t\t\t\tvar INV_SUB_MIX_2 = [];\n\t\t\t\t\tvar INV_SUB_MIX_3 = [];\n\n\t\t\t\t\t// Compute lookup tables\n\t\t\t\t\t(function () {\n\t\t\t\t\t\t// Compute double table\n\t\t\t\t\t\tvar d = [];\n\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\tif (i < 128) {\n\t\t\t\t\t\t\t\td[i] = i << 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\td[i] = i << 1 ^ 0x11b;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Walk GF(2^8)\n\t\t\t\t\t\tvar x = 0;\n\t\t\t\t\t\tvar xi = 0;\n\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\t// Compute sbox\n\t\t\t\t\t\t\tvar sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;\n\t\t\t\t\t\t\tsx = sx >>> 8 ^ sx & 0xff ^ 0x63;\n\t\t\t\t\t\t\tSBOX[x] = sx;\n\t\t\t\t\t\t\tINV_SBOX[sx] = x;\n\n\t\t\t\t\t\t\t// Compute multiplication\n\t\t\t\t\t\t\tvar x2 = d[x];\n\t\t\t\t\t\t\tvar x4 = d[x2];\n\t\t\t\t\t\t\tvar x8 = d[x4];\n\n\t\t\t\t\t\t\t// Compute sub bytes, mix columns tables\n\t\t\t\t\t\t\tvar t = d[sx] * 0x101 ^ sx * 0x1010100;\n\t\t\t\t\t\t\tSUB_MIX_0[x] = t << 24 | t >>> 8;\n\t\t\t\t\t\t\tSUB_MIX_1[x] = t << 16 | t >>> 16;\n\t\t\t\t\t\t\tSUB_MIX_2[x] = t << 8 | t >>> 24;\n\t\t\t\t\t\t\tSUB_MIX_3[x] = t;\n\n\t\t\t\t\t\t\t// Compute inv sub bytes, inv mix columns tables\n\t\t\t\t\t\t\tvar t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n\t\t\t\t\t\t\tINV_SUB_MIX_0[sx] = t << 24 | t >>> 8;\n\t\t\t\t\t\t\tINV_SUB_MIX_1[sx] = t << 16 | t >>> 16;\n\t\t\t\t\t\t\tINV_SUB_MIX_2[sx] = t << 8 | t >>> 24;\n\t\t\t\t\t\t\tINV_SUB_MIX_3[sx] = t;\n\n\t\t\t\t\t\t\t// Compute next counter\n\t\t\t\t\t\t\tif (!x) {\n\t\t\t\t\t\t\t\tx = xi = 1;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tx = x2 ^ d[d[d[x8 ^ x2]]];\n\t\t\t\t\t\t\t\txi ^= d[d[xi]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})();\n\n\t\t\t\t\t// Precomputed Rcon lookup\n\t\t\t\t\tvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n\t\t\t\t\t/**\n * AES block cipher algorithm.\n */\n\t\t\t\t\tvar AES = C_algo.AES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Skip reset of nRounds has been set before and key did not change\n\t\t\t\t\t\t\tif (this._nRounds && this._keyPriorReset === this._key) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._keyPriorReset = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\t\t\t\t\t\t\tvar keySize = key.sigBytes / 4;\n\n\t\t\t\t\t\t\t// Compute number of rounds\n\t\t\t\t\t\t\tvar nRounds = this._nRounds = keySize + 6;\n\n\t\t\t\t\t\t\t// Compute number of key schedule rows\n\t\t\t\t\t\t\tvar ksRows = (nRounds + 1) * 4;\n\n\t\t\t\t\t\t\t// Compute key schedule\n\t\t\t\t\t\t\tvar keySchedule = this._keySchedule = [];\n\t\t\t\t\t\t\tfor (var ksRow = 0; ksRow < ksRows; ksRow++) {\n\t\t\t\t\t\t\t\tif (ksRow < keySize) {\n\t\t\t\t\t\t\t\t\tkeySchedule[ksRow] = keyWords[ksRow];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow - 1];\n\n\t\t\t\t\t\t\t\t\tif (!(ksRow % keySize)) {\n\t\t\t\t\t\t\t\t\t\t// Rot word\n\t\t\t\t\t\t\t\t\t\tt = t << 8 | t >>> 24;\n\n\t\t\t\t\t\t\t\t\t\t// Sub word\n\t\t\t\t\t\t\t\t\t\tt = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];\n\n\t\t\t\t\t\t\t\t\t\t// Mix Rcon\n\t\t\t\t\t\t\t\t\t\tt ^= RCON[ksRow / keySize | 0] << 24;\n\t\t\t\t\t\t\t\t\t} else if (keySize > 6 && ksRow % keySize == 4) {\n\t\t\t\t\t\t\t\t\t\t// Sub word\n\t\t\t\t\t\t\t\t\t\tt = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tkeySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Compute inv key schedule\n\t\t\t\t\t\t\tvar invKeySchedule = this._invKeySchedule = [];\n\t\t\t\t\t\t\tfor (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n\t\t\t\t\t\t\t\tvar ksRow = ksRows - invKsRow;\n\n\t\t\t\t\t\t\t\tif (invKsRow % 4) {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar t = keySchedule[ksRow - 4];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (invKsRow < 4 || ksRow <= 4) {\n\t\t\t\t\t\t\t\t\tinvKeySchedule[invKsRow] = t;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tinvKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 0xff]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\t// Swap 2nd and 4th rows\n\t\t\t\t\t\t\tvar t = M[offset + 1];\n\t\t\t\t\t\t\tM[offset + 1] = M[offset + 3];\n\t\t\t\t\t\t\tM[offset + 3] = t;\n\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);\n\n\t\t\t\t\t\t\t// Inv swap 2nd and 4th rows\n\t\t\t\t\t\t\tvar t = M[offset + 1];\n\t\t\t\t\t\t\tM[offset + 1] = M[offset + 3];\n\t\t\t\t\t\t\tM[offset + 3] = t;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doCryptBlock: function _doCryptBlock(M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar nRounds = this._nRounds;\n\n\t\t\t\t\t\t\t// Get input, add round key\n\t\t\t\t\t\t\tvar s0 = M[offset] ^ keySchedule[0];\n\t\t\t\t\t\t\tvar s1 = M[offset + 1] ^ keySchedule[1];\n\t\t\t\t\t\t\tvar s2 = M[offset + 2] ^ keySchedule[2];\n\t\t\t\t\t\t\tvar s3 = M[offset + 3] ^ keySchedule[3];\n\n\t\t\t\t\t\t\t// Key schedule row counter\n\t\t\t\t\t\t\tvar ksRow = 4;\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 1; round < nRounds; round++) {\n\t\t\t\t\t\t\t\t// Shift rows, sub bytes, mix columns, add round key\n\t\t\t\t\t\t\t\tvar t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[s1 >>> 16 & 0xff] ^ SUB_MIX_2[s2 >>> 8 & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[s2 >>> 16 & 0xff] ^ SUB_MIX_2[s3 >>> 8 & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[s3 >>> 16 & 0xff] ^ SUB_MIX_2[s0 >>> 8 & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\t\tvar t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[s0 >>> 16 & 0xff] ^ SUB_MIX_2[s1 >>> 8 & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];\n\n\t\t\t\t\t\t\t\t// Update state\n\t\t\t\t\t\t\t\ts0 = t0;\n\t\t\t\t\t\t\t\ts1 = t1;\n\t\t\t\t\t\t\t\ts2 = t2;\n\t\t\t\t\t\t\t\ts3 = t3;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Shift rows, sub bytes, add round key\n\t\t\t\t\t\t\tvar t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n\t\t\t\t\t\t\tvar t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n\n\t\t\t\t\t\t\t// Set output\n\t\t\t\t\t\t\tM[offset] = t0;\n\t\t\t\t\t\t\tM[offset + 1] = t1;\n\t\t\t\t\t\t\tM[offset + 2] = t2;\n\t\t\t\t\t\t\tM[offset + 3] = t3;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 256 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.AES = BlockCipher._createHelper(AES);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.AES;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 35 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar WordArray = C_lib.WordArray;\n\t\t\t\t\tvar BlockCipher = C_lib.BlockCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Permuted Choice 1 constants\n\t\t\t\t\tvar PC1 = [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];\n\n\t\t\t\t\t// Permuted Choice 2 constants\n\t\t\t\t\tvar PC2 = [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];\n\n\t\t\t\t\t// Cumulative bit shift constants\n\t\t\t\t\tvar BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];\n\n\t\t\t\t\t// SBOXes and round permutation constants\n\t\t\t\t\tvar SBOX_P = [{\n\t\t\t\t\t\t0x0: 0x808200,\n\t\t\t\t\t\t0x10000000: 0x8000,\n\t\t\t\t\t\t0x20000000: 0x808002,\n\t\t\t\t\t\t0x30000000: 0x2,\n\t\t\t\t\t\t0x40000000: 0x200,\n\t\t\t\t\t\t0x50000000: 0x808202,\n\t\t\t\t\t\t0x60000000: 0x800202,\n\t\t\t\t\t\t0x70000000: 0x800000,\n\t\t\t\t\t\t0x80000000: 0x202,\n\t\t\t\t\t\t0x90000000: 0x800200,\n\t\t\t\t\t\t0xa0000000: 0x8200,\n\t\t\t\t\t\t0xb0000000: 0x808000,\n\t\t\t\t\t\t0xc0000000: 0x8002,\n\t\t\t\t\t\t0xd0000000: 0x800002,\n\t\t\t\t\t\t0xe0000000: 0x0,\n\t\t\t\t\t\t0xf0000000: 0x8202,\n\t\t\t\t\t\t0x8000000: 0x0,\n\t\t\t\t\t\t0x18000000: 0x808202,\n\t\t\t\t\t\t0x28000000: 0x8202,\n\t\t\t\t\t\t0x38000000: 0x8000,\n\t\t\t\t\t\t0x48000000: 0x808200,\n\t\t\t\t\t\t0x58000000: 0x200,\n\t\t\t\t\t\t0x68000000: 0x808002,\n\t\t\t\t\t\t0x78000000: 0x2,\n\t\t\t\t\t\t0x88000000: 0x800200,\n\t\t\t\t\t\t0x98000000: 0x8200,\n\t\t\t\t\t\t0xa8000000: 0x808000,\n\t\t\t\t\t\t0xb8000000: 0x800202,\n\t\t\t\t\t\t0xc8000000: 0x800002,\n\t\t\t\t\t\t0xd8000000: 0x8002,\n\t\t\t\t\t\t0xe8000000: 0x202,\n\t\t\t\t\t\t0xf8000000: 0x800000,\n\t\t\t\t\t\t0x1: 0x8000,\n\t\t\t\t\t\t0x10000001: 0x2,\n\t\t\t\t\t\t0x20000001: 0x808200,\n\t\t\t\t\t\t0x30000001: 0x800000,\n\t\t\t\t\t\t0x40000001: 0x808002,\n\t\t\t\t\t\t0x50000001: 0x8200,\n\t\t\t\t\t\t0x60000001: 0x200,\n\t\t\t\t\t\t0x70000001: 0x800202,\n\t\t\t\t\t\t0x80000001: 0x808202,\n\t\t\t\t\t\t0x90000001: 0x808000,\n\t\t\t\t\t\t0xa0000001: 0x800002,\n\t\t\t\t\t\t0xb0000001: 0x8202,\n\t\t\t\t\t\t0xc0000001: 0x202,\n\t\t\t\t\t\t0xd0000001: 0x800200,\n\t\t\t\t\t\t0xe0000001: 0x8002,\n\t\t\t\t\t\t0xf0000001: 0x0,\n\t\t\t\t\t\t0x8000001: 0x808202,\n\t\t\t\t\t\t0x18000001: 0x808000,\n\t\t\t\t\t\t0x28000001: 0x800000,\n\t\t\t\t\t\t0x38000001: 0x200,\n\t\t\t\t\t\t0x48000001: 0x8000,\n\t\t\t\t\t\t0x58000001: 0x800002,\n\t\t\t\t\t\t0x68000001: 0x2,\n\t\t\t\t\t\t0x78000001: 0x8202,\n\t\t\t\t\t\t0x88000001: 0x8002,\n\t\t\t\t\t\t0x98000001: 0x800202,\n\t\t\t\t\t\t0xa8000001: 0x202,\n\t\t\t\t\t\t0xb8000001: 0x808200,\n\t\t\t\t\t\t0xc8000001: 0x800200,\n\t\t\t\t\t\t0xd8000001: 0x0,\n\t\t\t\t\t\t0xe8000001: 0x8200,\n\t\t\t\t\t\t0xf8000001: 0x808002\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x40084010,\n\t\t\t\t\t\t0x1000000: 0x4000,\n\t\t\t\t\t\t0x2000000: 0x80000,\n\t\t\t\t\t\t0x3000000: 0x40080010,\n\t\t\t\t\t\t0x4000000: 0x40000010,\n\t\t\t\t\t\t0x5000000: 0x40084000,\n\t\t\t\t\t\t0x6000000: 0x40004000,\n\t\t\t\t\t\t0x7000000: 0x10,\n\t\t\t\t\t\t0x8000000: 0x84000,\n\t\t\t\t\t\t0x9000000: 0x40004010,\n\t\t\t\t\t\t0xa000000: 0x40000000,\n\t\t\t\t\t\t0xb000000: 0x84010,\n\t\t\t\t\t\t0xc000000: 0x80010,\n\t\t\t\t\t\t0xd000000: 0x0,\n\t\t\t\t\t\t0xe000000: 0x4010,\n\t\t\t\t\t\t0xf000000: 0x40080000,\n\t\t\t\t\t\t0x800000: 0x40004000,\n\t\t\t\t\t\t0x1800000: 0x84010,\n\t\t\t\t\t\t0x2800000: 0x10,\n\t\t\t\t\t\t0x3800000: 0x40004010,\n\t\t\t\t\t\t0x4800000: 0x40084010,\n\t\t\t\t\t\t0x5800000: 0x40000000,\n\t\t\t\t\t\t0x6800000: 0x80000,\n\t\t\t\t\t\t0x7800000: 0x40080010,\n\t\t\t\t\t\t0x8800000: 0x80010,\n\t\t\t\t\t\t0x9800000: 0x0,\n\t\t\t\t\t\t0xa800000: 0x4000,\n\t\t\t\t\t\t0xb800000: 0x40080000,\n\t\t\t\t\t\t0xc800000: 0x40000010,\n\t\t\t\t\t\t0xd800000: 0x84000,\n\t\t\t\t\t\t0xe800000: 0x40084000,\n\t\t\t\t\t\t0xf800000: 0x4010,\n\t\t\t\t\t\t0x10000000: 0x0,\n\t\t\t\t\t\t0x11000000: 0x40080010,\n\t\t\t\t\t\t0x12000000: 0x40004010,\n\t\t\t\t\t\t0x13000000: 0x40084000,\n\t\t\t\t\t\t0x14000000: 0x40080000,\n\t\t\t\t\t\t0x15000000: 0x10,\n\t\t\t\t\t\t0x16000000: 0x84010,\n\t\t\t\t\t\t0x17000000: 0x4000,\n\t\t\t\t\t\t0x18000000: 0x4010,\n\t\t\t\t\t\t0x19000000: 0x80000,\n\t\t\t\t\t\t0x1a000000: 0x80010,\n\t\t\t\t\t\t0x1b000000: 0x40000010,\n\t\t\t\t\t\t0x1c000000: 0x84000,\n\t\t\t\t\t\t0x1d000000: 0x40004000,\n\t\t\t\t\t\t0x1e000000: 0x40000000,\n\t\t\t\t\t\t0x1f000000: 0x40084010,\n\t\t\t\t\t\t0x10800000: 0x84010,\n\t\t\t\t\t\t0x11800000: 0x80000,\n\t\t\t\t\t\t0x12800000: 0x40080000,\n\t\t\t\t\t\t0x13800000: 0x4000,\n\t\t\t\t\t\t0x14800000: 0x40004000,\n\t\t\t\t\t\t0x15800000: 0x40084010,\n\t\t\t\t\t\t0x16800000: 0x10,\n\t\t\t\t\t\t0x17800000: 0x40000000,\n\t\t\t\t\t\t0x18800000: 0x40084000,\n\t\t\t\t\t\t0x19800000: 0x40000010,\n\t\t\t\t\t\t0x1a800000: 0x40004010,\n\t\t\t\t\t\t0x1b800000: 0x80010,\n\t\t\t\t\t\t0x1c800000: 0x0,\n\t\t\t\t\t\t0x1d800000: 0x4010,\n\t\t\t\t\t\t0x1e800000: 0x40080010,\n\t\t\t\t\t\t0x1f800000: 0x84000\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x104,\n\t\t\t\t\t\t0x100000: 0x0,\n\t\t\t\t\t\t0x200000: 0x4000100,\n\t\t\t\t\t\t0x300000: 0x10104,\n\t\t\t\t\t\t0x400000: 0x10004,\n\t\t\t\t\t\t0x500000: 0x4000004,\n\t\t\t\t\t\t0x600000: 0x4010104,\n\t\t\t\t\t\t0x700000: 0x4010000,\n\t\t\t\t\t\t0x800000: 0x4000000,\n\t\t\t\t\t\t0x900000: 0x4010100,\n\t\t\t\t\t\t0xa00000: 0x10100,\n\t\t\t\t\t\t0xb00000: 0x4010004,\n\t\t\t\t\t\t0xc00000: 0x4000104,\n\t\t\t\t\t\t0xd00000: 0x10000,\n\t\t\t\t\t\t0xe00000: 0x4,\n\t\t\t\t\t\t0xf00000: 0x100,\n\t\t\t\t\t\t0x80000: 0x4010100,\n\t\t\t\t\t\t0x180000: 0x4010004,\n\t\t\t\t\t\t0x280000: 0x0,\n\t\t\t\t\t\t0x380000: 0x4000100,\n\t\t\t\t\t\t0x480000: 0x4000004,\n\t\t\t\t\t\t0x580000: 0x10000,\n\t\t\t\t\t\t0x680000: 0x10004,\n\t\t\t\t\t\t0x780000: 0x104,\n\t\t\t\t\t\t0x880000: 0x4,\n\t\t\t\t\t\t0x980000: 0x100,\n\t\t\t\t\t\t0xa80000: 0x4010000,\n\t\t\t\t\t\t0xb80000: 0x10104,\n\t\t\t\t\t\t0xc80000: 0x10100,\n\t\t\t\t\t\t0xd80000: 0x4000104,\n\t\t\t\t\t\t0xe80000: 0x4010104,\n\t\t\t\t\t\t0xf80000: 0x4000000,\n\t\t\t\t\t\t0x1000000: 0x4010100,\n\t\t\t\t\t\t0x1100000: 0x10004,\n\t\t\t\t\t\t0x1200000: 0x10000,\n\t\t\t\t\t\t0x1300000: 0x4000100,\n\t\t\t\t\t\t0x1400000: 0x100,\n\t\t\t\t\t\t0x1500000: 0x4010104,\n\t\t\t\t\t\t0x1600000: 0x4000004,\n\t\t\t\t\t\t0x1700000: 0x0,\n\t\t\t\t\t\t0x1800000: 0x4000104,\n\t\t\t\t\t\t0x1900000: 0x4000000,\n\t\t\t\t\t\t0x1a00000: 0x4,\n\t\t\t\t\t\t0x1b00000: 0x10100,\n\t\t\t\t\t\t0x1c00000: 0x4010000,\n\t\t\t\t\t\t0x1d00000: 0x104,\n\t\t\t\t\t\t0x1e00000: 0x10104,\n\t\t\t\t\t\t0x1f00000: 0x4010004,\n\t\t\t\t\t\t0x1080000: 0x4000000,\n\t\t\t\t\t\t0x1180000: 0x104,\n\t\t\t\t\t\t0x1280000: 0x4010100,\n\t\t\t\t\t\t0x1380000: 0x0,\n\t\t\t\t\t\t0x1480000: 0x10004,\n\t\t\t\t\t\t0x1580000: 0x4000100,\n\t\t\t\t\t\t0x1680000: 0x100,\n\t\t\t\t\t\t0x1780000: 0x4010004,\n\t\t\t\t\t\t0x1880000: 0x10000,\n\t\t\t\t\t\t0x1980000: 0x4010104,\n\t\t\t\t\t\t0x1a80000: 0x10104,\n\t\t\t\t\t\t0x1b80000: 0x4000004,\n\t\t\t\t\t\t0x1c80000: 0x4000104,\n\t\t\t\t\t\t0x1d80000: 0x4010000,\n\t\t\t\t\t\t0x1e80000: 0x4,\n\t\t\t\t\t\t0x1f80000: 0x10100\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x80401000,\n\t\t\t\t\t\t0x10000: 0x80001040,\n\t\t\t\t\t\t0x20000: 0x401040,\n\t\t\t\t\t\t0x30000: 0x80400000,\n\t\t\t\t\t\t0x40000: 0x0,\n\t\t\t\t\t\t0x50000: 0x401000,\n\t\t\t\t\t\t0x60000: 0x80000040,\n\t\t\t\t\t\t0x70000: 0x400040,\n\t\t\t\t\t\t0x80000: 0x80000000,\n\t\t\t\t\t\t0x90000: 0x400000,\n\t\t\t\t\t\t0xa0000: 0x40,\n\t\t\t\t\t\t0xb0000: 0x80001000,\n\t\t\t\t\t\t0xc0000: 0x80400040,\n\t\t\t\t\t\t0xd0000: 0x1040,\n\t\t\t\t\t\t0xe0000: 0x1000,\n\t\t\t\t\t\t0xf0000: 0x80401040,\n\t\t\t\t\t\t0x8000: 0x80001040,\n\t\t\t\t\t\t0x18000: 0x40,\n\t\t\t\t\t\t0x28000: 0x80400040,\n\t\t\t\t\t\t0x38000: 0x80001000,\n\t\t\t\t\t\t0x48000: 0x401000,\n\t\t\t\t\t\t0x58000: 0x80401040,\n\t\t\t\t\t\t0x68000: 0x0,\n\t\t\t\t\t\t0x78000: 0x80400000,\n\t\t\t\t\t\t0x88000: 0x1000,\n\t\t\t\t\t\t0x98000: 0x80401000,\n\t\t\t\t\t\t0xa8000: 0x400000,\n\t\t\t\t\t\t0xb8000: 0x1040,\n\t\t\t\t\t\t0xc8000: 0x80000000,\n\t\t\t\t\t\t0xd8000: 0x400040,\n\t\t\t\t\t\t0xe8000: 0x401040,\n\t\t\t\t\t\t0xf8000: 0x80000040,\n\t\t\t\t\t\t0x100000: 0x400040,\n\t\t\t\t\t\t0x110000: 0x401000,\n\t\t\t\t\t\t0x120000: 0x80000040,\n\t\t\t\t\t\t0x130000: 0x0,\n\t\t\t\t\t\t0x140000: 0x1040,\n\t\t\t\t\t\t0x150000: 0x80400040,\n\t\t\t\t\t\t0x160000: 0x80401000,\n\t\t\t\t\t\t0x170000: 0x80001040,\n\t\t\t\t\t\t0x180000: 0x80401040,\n\t\t\t\t\t\t0x190000: 0x80000000,\n\t\t\t\t\t\t0x1a0000: 0x80400000,\n\t\t\t\t\t\t0x1b0000: 0x401040,\n\t\t\t\t\t\t0x1c0000: 0x80001000,\n\t\t\t\t\t\t0x1d0000: 0x400000,\n\t\t\t\t\t\t0x1e0000: 0x40,\n\t\t\t\t\t\t0x1f0000: 0x1000,\n\t\t\t\t\t\t0x108000: 0x80400000,\n\t\t\t\t\t\t0x118000: 0x80401040,\n\t\t\t\t\t\t0x128000: 0x0,\n\t\t\t\t\t\t0x138000: 0x401000,\n\t\t\t\t\t\t0x148000: 0x400040,\n\t\t\t\t\t\t0x158000: 0x80000000,\n\t\t\t\t\t\t0x168000: 0x80001040,\n\t\t\t\t\t\t0x178000: 0x40,\n\t\t\t\t\t\t0x188000: 0x80000040,\n\t\t\t\t\t\t0x198000: 0x1000,\n\t\t\t\t\t\t0x1a8000: 0x80001000,\n\t\t\t\t\t\t0x1b8000: 0x80400040,\n\t\t\t\t\t\t0x1c8000: 0x1040,\n\t\t\t\t\t\t0x1d8000: 0x80401000,\n\t\t\t\t\t\t0x1e8000: 0x400000,\n\t\t\t\t\t\t0x1f8000: 0x401040\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x80,\n\t\t\t\t\t\t0x1000: 0x1040000,\n\t\t\t\t\t\t0x2000: 0x40000,\n\t\t\t\t\t\t0x3000: 0x20000000,\n\t\t\t\t\t\t0x4000: 0x20040080,\n\t\t\t\t\t\t0x5000: 0x1000080,\n\t\t\t\t\t\t0x6000: 0x21000080,\n\t\t\t\t\t\t0x7000: 0x40080,\n\t\t\t\t\t\t0x8000: 0x1000000,\n\t\t\t\t\t\t0x9000: 0x20040000,\n\t\t\t\t\t\t0xa000: 0x20000080,\n\t\t\t\t\t\t0xb000: 0x21040080,\n\t\t\t\t\t\t0xc000: 0x21040000,\n\t\t\t\t\t\t0xd000: 0x0,\n\t\t\t\t\t\t0xe000: 0x1040080,\n\t\t\t\t\t\t0xf000: 0x21000000,\n\t\t\t\t\t\t0x800: 0x1040080,\n\t\t\t\t\t\t0x1800: 0x21000080,\n\t\t\t\t\t\t0x2800: 0x80,\n\t\t\t\t\t\t0x3800: 0x1040000,\n\t\t\t\t\t\t0x4800: 0x40000,\n\t\t\t\t\t\t0x5800: 0x20040080,\n\t\t\t\t\t\t0x6800: 0x21040000,\n\t\t\t\t\t\t0x7800: 0x20000000,\n\t\t\t\t\t\t0x8800: 0x20040000,\n\t\t\t\t\t\t0x9800: 0x0,\n\t\t\t\t\t\t0xa800: 0x21040080,\n\t\t\t\t\t\t0xb800: 0x1000080,\n\t\t\t\t\t\t0xc800: 0x20000080,\n\t\t\t\t\t\t0xd800: 0x21000000,\n\t\t\t\t\t\t0xe800: 0x1000000,\n\t\t\t\t\t\t0xf800: 0x40080,\n\t\t\t\t\t\t0x10000: 0x40000,\n\t\t\t\t\t\t0x11000: 0x80,\n\t\t\t\t\t\t0x12000: 0x20000000,\n\t\t\t\t\t\t0x13000: 0x21000080,\n\t\t\t\t\t\t0x14000: 0x1000080,\n\t\t\t\t\t\t0x15000: 0x21040000,\n\t\t\t\t\t\t0x16000: 0x20040080,\n\t\t\t\t\t\t0x17000: 0x1000000,\n\t\t\t\t\t\t0x18000: 0x21040080,\n\t\t\t\t\t\t0x19000: 0x21000000,\n\t\t\t\t\t\t0x1a000: 0x1040000,\n\t\t\t\t\t\t0x1b000: 0x20040000,\n\t\t\t\t\t\t0x1c000: 0x40080,\n\t\t\t\t\t\t0x1d000: 0x20000080,\n\t\t\t\t\t\t0x1e000: 0x0,\n\t\t\t\t\t\t0x1f000: 0x1040080,\n\t\t\t\t\t\t0x10800: 0x21000080,\n\t\t\t\t\t\t0x11800: 0x1000000,\n\t\t\t\t\t\t0x12800: 0x1040000,\n\t\t\t\t\t\t0x13800: 0x20040080,\n\t\t\t\t\t\t0x14800: 0x20000000,\n\t\t\t\t\t\t0x15800: 0x1040080,\n\t\t\t\t\t\t0x16800: 0x80,\n\t\t\t\t\t\t0x17800: 0x21040000,\n\t\t\t\t\t\t0x18800: 0x40080,\n\t\t\t\t\t\t0x19800: 0x21040080,\n\t\t\t\t\t\t0x1a800: 0x0,\n\t\t\t\t\t\t0x1b800: 0x21000000,\n\t\t\t\t\t\t0x1c800: 0x1000080,\n\t\t\t\t\t\t0x1d800: 0x40000,\n\t\t\t\t\t\t0x1e800: 0x20040000,\n\t\t\t\t\t\t0x1f800: 0x20000080\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x10000008,\n\t\t\t\t\t\t0x100: 0x2000,\n\t\t\t\t\t\t0x200: 0x10200000,\n\t\t\t\t\t\t0x300: 0x10202008,\n\t\t\t\t\t\t0x400: 0x10002000,\n\t\t\t\t\t\t0x500: 0x200000,\n\t\t\t\t\t\t0x600: 0x200008,\n\t\t\t\t\t\t0x700: 0x10000000,\n\t\t\t\t\t\t0x800: 0x0,\n\t\t\t\t\t\t0x900: 0x10002008,\n\t\t\t\t\t\t0xa00: 0x202000,\n\t\t\t\t\t\t0xb00: 0x8,\n\t\t\t\t\t\t0xc00: 0x10200008,\n\t\t\t\t\t\t0xd00: 0x202008,\n\t\t\t\t\t\t0xe00: 0x2008,\n\t\t\t\t\t\t0xf00: 0x10202000,\n\t\t\t\t\t\t0x80: 0x10200000,\n\t\t\t\t\t\t0x180: 0x10202008,\n\t\t\t\t\t\t0x280: 0x8,\n\t\t\t\t\t\t0x380: 0x200000,\n\t\t\t\t\t\t0x480: 0x202008,\n\t\t\t\t\t\t0x580: 0x10000008,\n\t\t\t\t\t\t0x680: 0x10002000,\n\t\t\t\t\t\t0x780: 0x2008,\n\t\t\t\t\t\t0x880: 0x200008,\n\t\t\t\t\t\t0x980: 0x2000,\n\t\t\t\t\t\t0xa80: 0x10002008,\n\t\t\t\t\t\t0xb80: 0x10200008,\n\t\t\t\t\t\t0xc80: 0x0,\n\t\t\t\t\t\t0xd80: 0x10202000,\n\t\t\t\t\t\t0xe80: 0x202000,\n\t\t\t\t\t\t0xf80: 0x10000000,\n\t\t\t\t\t\t0x1000: 0x10002000,\n\t\t\t\t\t\t0x1100: 0x10200008,\n\t\t\t\t\t\t0x1200: 0x10202008,\n\t\t\t\t\t\t0x1300: 0x2008,\n\t\t\t\t\t\t0x1400: 0x200000,\n\t\t\t\t\t\t0x1500: 0x10000000,\n\t\t\t\t\t\t0x1600: 0x10000008,\n\t\t\t\t\t\t0x1700: 0x202000,\n\t\t\t\t\t\t0x1800: 0x202008,\n\t\t\t\t\t\t0x1900: 0x0,\n\t\t\t\t\t\t0x1a00: 0x8,\n\t\t\t\t\t\t0x1b00: 0x10200000,\n\t\t\t\t\t\t0x1c00: 0x2000,\n\t\t\t\t\t\t0x1d00: 0x10002008,\n\t\t\t\t\t\t0x1e00: 0x10202000,\n\t\t\t\t\t\t0x1f00: 0x200008,\n\t\t\t\t\t\t0x1080: 0x8,\n\t\t\t\t\t\t0x1180: 0x202000,\n\t\t\t\t\t\t0x1280: 0x200000,\n\t\t\t\t\t\t0x1380: 0x10000008,\n\t\t\t\t\t\t0x1480: 0x10002000,\n\t\t\t\t\t\t0x1580: 0x2008,\n\t\t\t\t\t\t0x1680: 0x10202008,\n\t\t\t\t\t\t0x1780: 0x10200000,\n\t\t\t\t\t\t0x1880: 0x10202000,\n\t\t\t\t\t\t0x1980: 0x10200008,\n\t\t\t\t\t\t0x1a80: 0x2000,\n\t\t\t\t\t\t0x1b80: 0x202008,\n\t\t\t\t\t\t0x1c80: 0x200008,\n\t\t\t\t\t\t0x1d80: 0x0,\n\t\t\t\t\t\t0x1e80: 0x10000000,\n\t\t\t\t\t\t0x1f80: 0x10002008\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x100000,\n\t\t\t\t\t\t0x10: 0x2000401,\n\t\t\t\t\t\t0x20: 0x400,\n\t\t\t\t\t\t0x30: 0x100401,\n\t\t\t\t\t\t0x40: 0x2100401,\n\t\t\t\t\t\t0x50: 0x0,\n\t\t\t\t\t\t0x60: 0x1,\n\t\t\t\t\t\t0x70: 0x2100001,\n\t\t\t\t\t\t0x80: 0x2000400,\n\t\t\t\t\t\t0x90: 0x100001,\n\t\t\t\t\t\t0xa0: 0x2000001,\n\t\t\t\t\t\t0xb0: 0x2100400,\n\t\t\t\t\t\t0xc0: 0x2100000,\n\t\t\t\t\t\t0xd0: 0x401,\n\t\t\t\t\t\t0xe0: 0x100400,\n\t\t\t\t\t\t0xf0: 0x2000000,\n\t\t\t\t\t\t0x8: 0x2100001,\n\t\t\t\t\t\t0x18: 0x0,\n\t\t\t\t\t\t0x28: 0x2000401,\n\t\t\t\t\t\t0x38: 0x2100400,\n\t\t\t\t\t\t0x48: 0x100000,\n\t\t\t\t\t\t0x58: 0x2000001,\n\t\t\t\t\t\t0x68: 0x2000000,\n\t\t\t\t\t\t0x78: 0x401,\n\t\t\t\t\t\t0x88: 0x100401,\n\t\t\t\t\t\t0x98: 0x2000400,\n\t\t\t\t\t\t0xa8: 0x2100000,\n\t\t\t\t\t\t0xb8: 0x100001,\n\t\t\t\t\t\t0xc8: 0x400,\n\t\t\t\t\t\t0xd8: 0x2100401,\n\t\t\t\t\t\t0xe8: 0x1,\n\t\t\t\t\t\t0xf8: 0x100400,\n\t\t\t\t\t\t0x100: 0x2000000,\n\t\t\t\t\t\t0x110: 0x100000,\n\t\t\t\t\t\t0x120: 0x2000401,\n\t\t\t\t\t\t0x130: 0x2100001,\n\t\t\t\t\t\t0x140: 0x100001,\n\t\t\t\t\t\t0x150: 0x2000400,\n\t\t\t\t\t\t0x160: 0x2100400,\n\t\t\t\t\t\t0x170: 0x100401,\n\t\t\t\t\t\t0x180: 0x401,\n\t\t\t\t\t\t0x190: 0x2100401,\n\t\t\t\t\t\t0x1a0: 0x100400,\n\t\t\t\t\t\t0x1b0: 0x1,\n\t\t\t\t\t\t0x1c0: 0x0,\n\t\t\t\t\t\t0x1d0: 0x2100000,\n\t\t\t\t\t\t0x1e0: 0x2000001,\n\t\t\t\t\t\t0x1f0: 0x400,\n\t\t\t\t\t\t0x108: 0x100400,\n\t\t\t\t\t\t0x118: 0x2000401,\n\t\t\t\t\t\t0x128: 0x2100001,\n\t\t\t\t\t\t0x138: 0x1,\n\t\t\t\t\t\t0x148: 0x2000000,\n\t\t\t\t\t\t0x158: 0x100000,\n\t\t\t\t\t\t0x168: 0x401,\n\t\t\t\t\t\t0x178: 0x2100400,\n\t\t\t\t\t\t0x188: 0x2000001,\n\t\t\t\t\t\t0x198: 0x2100000,\n\t\t\t\t\t\t0x1a8: 0x0,\n\t\t\t\t\t\t0x1b8: 0x2100401,\n\t\t\t\t\t\t0x1c8: 0x100401,\n\t\t\t\t\t\t0x1d8: 0x400,\n\t\t\t\t\t\t0x1e8: 0x2000400,\n\t\t\t\t\t\t0x1f8: 0x100001\n\t\t\t\t\t}, {\n\t\t\t\t\t\t0x0: 0x8000820,\n\t\t\t\t\t\t0x1: 0x20000,\n\t\t\t\t\t\t0x2: 0x8000000,\n\t\t\t\t\t\t0x3: 0x20,\n\t\t\t\t\t\t0x4: 0x20020,\n\t\t\t\t\t\t0x5: 0x8020820,\n\t\t\t\t\t\t0x6: 0x8020800,\n\t\t\t\t\t\t0x7: 0x800,\n\t\t\t\t\t\t0x8: 0x8020000,\n\t\t\t\t\t\t0x9: 0x8000800,\n\t\t\t\t\t\t0xa: 0x20800,\n\t\t\t\t\t\t0xb: 0x8020020,\n\t\t\t\t\t\t0xc: 0x820,\n\t\t\t\t\t\t0xd: 0x0,\n\t\t\t\t\t\t0xe: 0x8000020,\n\t\t\t\t\t\t0xf: 0x20820,\n\t\t\t\t\t\t0x80000000: 0x800,\n\t\t\t\t\t\t0x80000001: 0x8020820,\n\t\t\t\t\t\t0x80000002: 0x8000820,\n\t\t\t\t\t\t0x80000003: 0x8000000,\n\t\t\t\t\t\t0x80000004: 0x8020000,\n\t\t\t\t\t\t0x80000005: 0x20800,\n\t\t\t\t\t\t0x80000006: 0x20820,\n\t\t\t\t\t\t0x80000007: 0x20,\n\t\t\t\t\t\t0x80000008: 0x8000020,\n\t\t\t\t\t\t0x80000009: 0x820,\n\t\t\t\t\t\t0x8000000a: 0x20020,\n\t\t\t\t\t\t0x8000000b: 0x8020800,\n\t\t\t\t\t\t0x8000000c: 0x0,\n\t\t\t\t\t\t0x8000000d: 0x8020020,\n\t\t\t\t\t\t0x8000000e: 0x8000800,\n\t\t\t\t\t\t0x8000000f: 0x20000,\n\t\t\t\t\t\t0x10: 0x20820,\n\t\t\t\t\t\t0x11: 0x8020800,\n\t\t\t\t\t\t0x12: 0x20,\n\t\t\t\t\t\t0x13: 0x800,\n\t\t\t\t\t\t0x14: 0x8000800,\n\t\t\t\t\t\t0x15: 0x8000020,\n\t\t\t\t\t\t0x16: 0x8020020,\n\t\t\t\t\t\t0x17: 0x20000,\n\t\t\t\t\t\t0x18: 0x0,\n\t\t\t\t\t\t0x19: 0x20020,\n\t\t\t\t\t\t0x1a: 0x8020000,\n\t\t\t\t\t\t0x1b: 0x8000820,\n\t\t\t\t\t\t0x1c: 0x8020820,\n\t\t\t\t\t\t0x1d: 0x20800,\n\t\t\t\t\t\t0x1e: 0x820,\n\t\t\t\t\t\t0x1f: 0x8000000,\n\t\t\t\t\t\t0x80000010: 0x20000,\n\t\t\t\t\t\t0x80000011: 0x800,\n\t\t\t\t\t\t0x80000012: 0x8020020,\n\t\t\t\t\t\t0x80000013: 0x20820,\n\t\t\t\t\t\t0x80000014: 0x20,\n\t\t\t\t\t\t0x80000015: 0x8020000,\n\t\t\t\t\t\t0x80000016: 0x8000000,\n\t\t\t\t\t\t0x80000017: 0x8000820,\n\t\t\t\t\t\t0x80000018: 0x8020820,\n\t\t\t\t\t\t0x80000019: 0x8000020,\n\t\t\t\t\t\t0x8000001a: 0x8000800,\n\t\t\t\t\t\t0x8000001b: 0x0,\n\t\t\t\t\t\t0x8000001c: 0x20800,\n\t\t\t\t\t\t0x8000001d: 0x820,\n\t\t\t\t\t\t0x8000001e: 0x20020,\n\t\t\t\t\t\t0x8000001f: 0x8020800\n\t\t\t\t\t}];\n\n\t\t\t\t\t// Masks that select the SBOX input\n\t\t\t\t\tvar SBOX_MASK = [0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f];\n\n\t\t\t\t\t/**\n * DES block cipher algorithm.\n */\n\t\t\t\t\tvar DES = C_algo.DES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\n\t\t\t\t\t\t\t// Select 56 bits according to PC1\n\t\t\t\t\t\t\tvar keyBits = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 56; i++) {\n\t\t\t\t\t\t\t\tvar keyBitPos = PC1[i] - 1;\n\t\t\t\t\t\t\t\tkeyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Assemble 16 subkeys\n\t\t\t\t\t\t\tvar subKeys = this._subKeys = [];\n\t\t\t\t\t\t\tfor (var nSubKey = 0; nSubKey < 16; nSubKey++) {\n\t\t\t\t\t\t\t\t// Create subkey\n\t\t\t\t\t\t\t\tvar subKey = subKeys[nSubKey] = [];\n\n\t\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\t\tvar bitShift = BIT_SHIFTS[nSubKey];\n\n\t\t\t\t\t\t\t\t// Select 48 bits according to PC2\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\t\t\t\t\t\t// Select from the left 28 key bits\n\t\t\t\t\t\t\t\t\tsubKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;\n\n\t\t\t\t\t\t\t\t\t// Select from the right 28 key bits\n\t\t\t\t\t\t\t\t\tsubKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Since each subkey is applied to an expanded 32-bit input,\n\t\t\t\t\t\t\t\t// the subkey can be broken into 8 values scaled to 32-bits,\n\t\t\t\t\t\t\t\t// which allows the key to be used without expansion\n\t\t\t\t\t\t\t\tsubKey[0] = subKey[0] << 1 | subKey[0] >>> 31;\n\t\t\t\t\t\t\t\tfor (var i = 1; i < 7; i++) {\n\t\t\t\t\t\t\t\t\tsubKey[i] = subKey[i] >>> (i - 1) * 4 + 3;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsubKey[7] = subKey[7] << 5 | subKey[7] >>> 27;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Compute inverse subkeys\n\t\t\t\t\t\t\tvar invSubKeys = this._invSubKeys = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 16; i++) {\n\t\t\t\t\t\t\t\tinvSubKeys[i] = subKeys[15 - i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._subKeys);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._doCryptBlock(M, offset, this._invSubKeys);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doCryptBlock: function _doCryptBlock(M, offset, subKeys) {\n\t\t\t\t\t\t\t// Get input\n\t\t\t\t\t\t\tthis._lBlock = M[offset];\n\t\t\t\t\t\t\tthis._rBlock = M[offset + 1];\n\n\t\t\t\t\t\t\t// Initial permutation\n\t\t\t\t\t\t\texchangeLR.call(this, 4, 0x0f0f0f0f);\n\t\t\t\t\t\t\texchangeLR.call(this, 16, 0x0000ffff);\n\t\t\t\t\t\t\texchangeRL.call(this, 2, 0x33333333);\n\t\t\t\t\t\t\texchangeRL.call(this, 8, 0x00ff00ff);\n\t\t\t\t\t\t\texchangeLR.call(this, 1, 0x55555555);\n\n\t\t\t\t\t\t\t// Rounds\n\t\t\t\t\t\t\tfor (var round = 0; round < 16; round++) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar subKey = subKeys[round];\n\t\t\t\t\t\t\t\tvar lBlock = this._lBlock;\n\t\t\t\t\t\t\t\tvar rBlock = this._rBlock;\n\n\t\t\t\t\t\t\t\t// Feistel function\n\t\t\t\t\t\t\t\tvar f = 0;\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\t\tf |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._lBlock = rBlock;\n\t\t\t\t\t\t\t\tthis._rBlock = lBlock ^ f;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Undo swap from last round\n\t\t\t\t\t\t\tvar t = this._lBlock;\n\t\t\t\t\t\t\tthis._lBlock = this._rBlock;\n\t\t\t\t\t\t\tthis._rBlock = t;\n\n\t\t\t\t\t\t\t// Final permutation\n\t\t\t\t\t\t\texchangeLR.call(this, 1, 0x55555555);\n\t\t\t\t\t\t\texchangeRL.call(this, 8, 0x00ff00ff);\n\t\t\t\t\t\t\texchangeRL.call(this, 2, 0x33333333);\n\t\t\t\t\t\t\texchangeLR.call(this, 16, 0x0000ffff);\n\t\t\t\t\t\t\texchangeLR.call(this, 4, 0x0f0f0f0f);\n\n\t\t\t\t\t\t\t// Set output\n\t\t\t\t\t\t\tM[offset] = this._lBlock;\n\t\t\t\t\t\t\tM[offset + 1] = this._rBlock;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 64 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32,\n\n\t\t\t\t\t\tblockSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t// Swap bits across the left and right words\n\t\t\t\t\tfunction exchangeLR(offset, mask) {\n\t\t\t\t\t\tvar t = (this._lBlock >>> offset ^ this._rBlock) & mask;\n\t\t\t\t\t\tthis._rBlock ^= t;\n\t\t\t\t\t\tthis._lBlock ^= t << offset;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction exchangeRL(offset, mask) {\n\t\t\t\t\t\tvar t = (this._rBlock >>> offset ^ this._lBlock) & mask;\n\t\t\t\t\t\tthis._lBlock ^= t;\n\t\t\t\t\t\tthis._rBlock ^= t << offset;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.DES = BlockCipher._createHelper(DES);\n\n\t\t\t\t\t/**\n * Triple-DES block cipher algorithm.\n */\n\t\t\t\t\tvar TripleDES = C_algo.TripleDES = BlockCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\n\t\t\t\t\t\t\t// Create DES instances\n\t\t\t\t\t\t\tthis._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));\n\t\t\t\t\t\t\tthis._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));\n\t\t\t\t\t\t\tthis._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tencryptBlock: function encryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._des1.encryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des2.decryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des3.encryptBlock(M, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tdecryptBlock: function decryptBlock(M, offset) {\n\t\t\t\t\t\t\tthis._des3.decryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des2.encryptBlock(M, offset);\n\t\t\t\t\t\t\tthis._des1.decryptBlock(M, offset);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 192 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32,\n\n\t\t\t\t\t\tblockSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.TripleDES = BlockCipher._createHelper(TripleDES);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.TripleDES;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 36 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t/**\n * RC4 stream cipher algorithm.\n */\n\t\t\t\t\tvar RC4 = C_algo.RC4 = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar key = this._key;\n\t\t\t\t\t\t\tvar keyWords = key.words;\n\t\t\t\t\t\t\tvar keySigBytes = key.sigBytes;\n\n\t\t\t\t\t\t\t// Init sbox\n\t\t\t\t\t\t\tvar S = this._S = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < 256; i++) {\n\t\t\t\t\t\t\t\tS[i] = i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Key setup\n\t\t\t\t\t\t\tfor (var i = 0, j = 0; i < 256; i++) {\n\t\t\t\t\t\t\t\tvar keyByteIndex = i % keySigBytes;\n\t\t\t\t\t\t\t\tvar keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 0xff;\n\n\t\t\t\t\t\t\t\tj = (j + S[i] + keyByte) % 256;\n\n\t\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\t\tvar t = S[i];\n\t\t\t\t\t\t\t\tS[i] = S[j];\n\t\t\t\t\t\t\t\tS[j] = t;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Counters\n\t\t\t\t\t\t\tthis._i = this._j = 0;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\tM[offset] ^= generateKeystreamWord.call(this);\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tkeySize: 256 / 32,\n\n\t\t\t\t\t\tivSize: 0\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction generateKeystreamWord() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar S = this._S;\n\t\t\t\t\t\tvar i = this._i;\n\t\t\t\t\t\tvar j = this._j;\n\n\t\t\t\t\t\t// Generate keystream word\n\t\t\t\t\t\tvar keystreamWord = 0;\n\t\t\t\t\t\tfor (var n = 0; n < 4; n++) {\n\t\t\t\t\t\t\ti = (i + 1) % 256;\n\t\t\t\t\t\t\tj = (j + S[i]) % 256;\n\n\t\t\t\t\t\t\t// Swap\n\t\t\t\t\t\t\tvar t = S[i];\n\t\t\t\t\t\t\tS[i] = S[j];\n\t\t\t\t\t\t\tS[j] = t;\n\n\t\t\t\t\t\t\tkeystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Update counters\n\t\t\t\t\t\tthis._i = i;\n\t\t\t\t\t\tthis._j = j;\n\n\t\t\t\t\t\treturn keystreamWord;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RC4 = StreamCipher._createHelper(RC4);\n\n\t\t\t\t\t/**\n * Modified RC4 stream cipher algorithm.\n */\n\t\t\t\t\tvar RC4Drop = C_algo.RC4Drop = RC4.extend({\n\t\t\t\t\t\t/**\n * Configuration options.\n *\n * @property {number} drop The number of keystream words to drop. Default 192\n */\n\t\t\t\t\t\tcfg: RC4.cfg.extend({\n\t\t\t\t\t\t\tdrop: 192\n\t\t\t\t\t\t}),\n\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\tRC4._doReset.call(this);\n\n\t\t\t\t\t\t\t// Drop\n\t\t\t\t\t\t\tfor (var i = this.cfg.drop; i > 0; i--) {\n\t\t\t\t\t\t\t\tgenerateKeystreamWord.call(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RC4Drop = StreamCipher._createHelper(RC4Drop);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.RC4;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 37 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar S = [];\n\t\t\t\t\tvar C_ = [];\n\t\t\t\t\tvar G = [];\n\n\t\t\t\t\t/**\n * Rabbit stream cipher algorithm\n */\n\t\t\t\t\tvar Rabbit = C_algo.Rabbit = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar K = this._key.words;\n\t\t\t\t\t\t\tvar iv = this.cfg.iv;\n\n\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tK[i] = (K[i] << 8 | K[i] >>> 24) & 0x00ff00ff | (K[i] << 24 | K[i] >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Generate initial state values\n\t\t\t\t\t\t\tvar X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];\n\n\t\t\t\t\t\t\t// Generate initial counter values\n\t\t\t\t\t\t\tvar C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];\n\n\t\t\t\t\t\t\t// Carry bit\n\t\t\t\t\t\t\tthis._b = 0;\n\n\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Modify the counters\n\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\tC[i] ^= X[i + 4 & 7];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// IV setup\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar IV = iv.words;\n\t\t\t\t\t\t\t\tvar IV_0 = IV[0];\n\t\t\t\t\t\t\t\tvar IV_1 = IV[1];\n\n\t\t\t\t\t\t\t\t// Generate four subvectors\n\t\t\t\t\t\t\t\tvar i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i1 = i0 >>> 16 | i2 & 0xffff0000;\n\t\t\t\t\t\t\t\tvar i3 = i2 << 16 | i0 & 0x0000ffff;\n\n\t\t\t\t\t\t\t\t// Modify counter values\n\t\t\t\t\t\t\t\tC[0] ^= i0;\n\t\t\t\t\t\t\t\tC[1] ^= i1;\n\t\t\t\t\t\t\t\tC[2] ^= i2;\n\t\t\t\t\t\t\t\tC[3] ^= i3;\n\t\t\t\t\t\t\t\tC[4] ^= i0;\n\t\t\t\t\t\t\t\tC[5] ^= i1;\n\t\t\t\t\t\t\t\tC[6] ^= i2;\n\t\t\t\t\t\t\t\tC[7] ^= i3;\n\n\t\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar X = this._X;\n\n\t\t\t\t\t\t\t// Iterate the system\n\t\t\t\t\t\t\tnextState.call(this);\n\n\t\t\t\t\t\t\t// Generate four keystream words\n\t\t\t\t\t\t\tS[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;\n\t\t\t\t\t\t\tS[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;\n\t\t\t\t\t\t\tS[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;\n\t\t\t\t\t\t\tS[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tS[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\t\tM[offset + i] ^= S[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction nextState() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar X = this._X;\n\t\t\t\t\t\tvar C = this._C;\n\n\t\t\t\t\t\t// Save old counter values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tC_[i] = C[i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new counter values\n\t\t\t\t\t\tC[0] = C[0] + 0x4d34d34d + this._b | 0;\n\t\t\t\t\t\tC[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tthis._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;\n\n\t\t\t\t\t\t// Calculate the g-values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tvar gx = X[i] + C[i];\n\n\t\t\t\t\t\t\t// Construct high and low argument for squaring\n\t\t\t\t\t\t\tvar ga = gx & 0xffff;\n\t\t\t\t\t\t\tvar gb = gx >>> 16;\n\n\t\t\t\t\t\t\t// Calculate high and low result of squaring\n\t\t\t\t\t\t\tvar gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;\n\t\t\t\t\t\t\tvar gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);\n\n\t\t\t\t\t\t\t// High XOR low\n\t\t\t\t\t\t\tG[i] = gh ^ gl;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new state values\n\t\t\t\t\t\tX[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;\n\t\t\t\t\t\tX[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;\n\t\t\t\t\t\tX[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;\n\t\t\t\t\t\tX[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;\n\t\t\t\t\t\tX[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;\n\t\t\t\t\t\tX[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;\n\t\t\t\t\t\tX[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;\n\t\t\t\t\t\tX[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.Rabbit = StreamCipher._createHelper(Rabbit);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.Rabbit;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 38 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\t;(function (root, factory, undef) {\n\t\t\t\tif (true) {\n\t\t\t\t\t// CommonJS\n\t\t\t\t\tmodule.exports = exports = factory(__webpack_require__(6), __webpack_require__(10), __webpack_require__(11), __webpack_require__(21), __webpack_require__(22));\n\t\t\t\t} else if (typeof define === \"function\" && define.amd) {\n\t\t\t\t\t// AMD\n\t\t\t\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t\t\t\t} else {\n\t\t\t\t\t// Global (browser)\n\t\t\t\t\tfactory(root.CryptoJS);\n\t\t\t\t}\n\t\t\t})(this, function (CryptoJS) {\n\n\t\t\t\t(function () {\n\t\t\t\t\t// Shortcuts\n\t\t\t\t\tvar C = CryptoJS;\n\t\t\t\t\tvar C_lib = C.lib;\n\t\t\t\t\tvar StreamCipher = C_lib.StreamCipher;\n\t\t\t\t\tvar C_algo = C.algo;\n\n\t\t\t\t\t// Reusable objects\n\t\t\t\t\tvar S = [];\n\t\t\t\t\tvar C_ = [];\n\t\t\t\t\tvar G = [];\n\n\t\t\t\t\t/**\n * Rabbit stream cipher algorithm.\n *\n * This is a legacy version that neglected to convert the key to little-endian.\n * This error doesn't affect the cipher's security,\n * but it does affect its compatibility with other implementations.\n */\n\t\t\t\t\tvar RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({\n\t\t\t\t\t\t_doReset: function _doReset() {\n\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\tvar K = this._key.words;\n\t\t\t\t\t\t\tvar iv = this.cfg.iv;\n\n\t\t\t\t\t\t\t// Generate initial state values\n\t\t\t\t\t\t\tvar X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16];\n\n\t\t\t\t\t\t\t// Generate initial counter values\n\t\t\t\t\t\t\tvar C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff];\n\n\t\t\t\t\t\t\t// Carry bit\n\t\t\t\t\t\t\tthis._b = 0;\n\n\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Modify the counters\n\t\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\t\tC[i] ^= X[i + 4 & 7];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// IV setup\n\t\t\t\t\t\t\tif (iv) {\n\t\t\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\t\t\tvar IV = iv.words;\n\t\t\t\t\t\t\t\tvar IV_0 = IV[0];\n\t\t\t\t\t\t\t\tvar IV_1 = IV[1];\n\n\t\t\t\t\t\t\t\t// Generate four subvectors\n\t\t\t\t\t\t\t\tvar i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00;\n\t\t\t\t\t\t\t\tvar i1 = i0 >>> 16 | i2 & 0xffff0000;\n\t\t\t\t\t\t\t\tvar i3 = i2 << 16 | i0 & 0x0000ffff;\n\n\t\t\t\t\t\t\t\t// Modify counter values\n\t\t\t\t\t\t\t\tC[0] ^= i0;\n\t\t\t\t\t\t\t\tC[1] ^= i1;\n\t\t\t\t\t\t\t\tC[2] ^= i2;\n\t\t\t\t\t\t\t\tC[3] ^= i3;\n\t\t\t\t\t\t\t\tC[4] ^= i0;\n\t\t\t\t\t\t\t\tC[5] ^= i1;\n\t\t\t\t\t\t\t\tC[6] ^= i2;\n\t\t\t\t\t\t\t\tC[7] ^= i3;\n\n\t\t\t\t\t\t\t\t// Iterate the system four times\n\t\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t\tnextState.call(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t_doProcessBlock: function _doProcessBlock(M, offset) {\n\t\t\t\t\t\t\t// Shortcut\n\t\t\t\t\t\t\tvar X = this._X;\n\n\t\t\t\t\t\t\t// Iterate the system\n\t\t\t\t\t\t\tnextState.call(this);\n\n\t\t\t\t\t\t\t// Generate four keystream words\n\t\t\t\t\t\t\tS[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;\n\t\t\t\t\t\t\tS[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;\n\t\t\t\t\t\t\tS[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;\n\t\t\t\t\t\t\tS[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t\t\t\t\t\t// Swap endian\n\t\t\t\t\t\t\t\tS[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00;\n\n\t\t\t\t\t\t\t\t// Encrypt\n\t\t\t\t\t\t\t\tM[offset + i] ^= S[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tblockSize: 128 / 32,\n\n\t\t\t\t\t\tivSize: 64 / 32\n\t\t\t\t\t});\n\n\t\t\t\t\tfunction nextState() {\n\t\t\t\t\t\t// Shortcuts\n\t\t\t\t\t\tvar X = this._X;\n\t\t\t\t\t\tvar C = this._C;\n\n\t\t\t\t\t\t// Save old counter values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tC_[i] = C[i];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new counter values\n\t\t\t\t\t\tC[0] = C[0] + 0x4d34d34d + this._b | 0;\n\t\t\t\t\t\tC[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tC[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;\n\t\t\t\t\t\tthis._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;\n\n\t\t\t\t\t\t// Calculate the g-values\n\t\t\t\t\t\tfor (var i = 0; i < 8; i++) {\n\t\t\t\t\t\t\tvar gx = X[i] + C[i];\n\n\t\t\t\t\t\t\t// Construct high and low argument for squaring\n\t\t\t\t\t\t\tvar ga = gx & 0xffff;\n\t\t\t\t\t\t\tvar gb = gx >>> 16;\n\n\t\t\t\t\t\t\t// Calculate high and low result of squaring\n\t\t\t\t\t\t\tvar gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;\n\t\t\t\t\t\t\tvar gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0);\n\n\t\t\t\t\t\t\t// High XOR low\n\t\t\t\t\t\t\tG[i] = gh ^ gl;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Calculate new state values\n\t\t\t\t\t\tX[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;\n\t\t\t\t\t\tX[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;\n\t\t\t\t\t\tX[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;\n\t\t\t\t\t\tX[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;\n\t\t\t\t\t\tX[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;\n\t\t\t\t\t\tX[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;\n\t\t\t\t\t\tX[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;\n\t\t\t\t\t\tX[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);\n */\n\t\t\t\t\tC.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);\n\t\t\t\t})();\n\n\t\t\t\treturn CryptoJS.RabbitLegacy;\n\t\t\t});\n\n\t\t\t/***/\n\t\t},\n\t\t/* 39 */\n\t\t/***/function (module, exports) {\n\n\t\t\t;(function () {\n\t\t\t\tfunction Array_h(length) {\n\t\t\t\t\tthis.array = length === undefined ? [] : new Array(length);\n\t\t\t\t}\n\n\t\t\t\tArray_h.prototype = {\n\t\t\t\t\t/**\n * 返回数组长度\n *\n * @return {Number} length [数组长度]\n */\n\t\t\t\t\tlength: function length() {\n\t\t\t\t\t\treturn this.array.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tat: function at(index) {\n\t\t\t\t\t\treturn this.array[index];\n\t\t\t\t\t},\n\n\t\t\t\t\tset: function set(index, obj) {\n\t\t\t\t\t\tthis.array[index] = obj;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 向数组的末尾添加一个或多个元素,并返回新的长度。\n *\n * @param {*} obj [description]\n * @return {Number} length [新数组的长度]\n */\n\t\t\t\t\tpush: function push(obj) {\n\t\t\t\t\t\treturn this.array.push(obj);\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回数组中选定的元素\n *\n * @param {Number} start [开始索引值]\n * @param {Number} end [结束索引值]\n * @return {Array} newArray [新的数组]\n */\n\t\t\t\t\tslice: function slice(start, end) {\n\t\t\t\t\t\treturn this.array = this.array.slice(start, end);\n\t\t\t\t\t},\n\n\t\t\t\t\tconcat: function concat(array) {\n\t\t\t\t\t\tthis.array = this.array.concat(array);\n\t\t\t\t\t},\n\n\t\t\t\t\tremove: function remove(index, count) {\n\t\t\t\t\t\tcount = count === undefined ? 1 : count;\n\t\t\t\t\t\tthis.array.splice(index, count);\n\t\t\t\t\t},\n\n\t\t\t\t\tjoin: function join(separator) {\n\t\t\t\t\t\treturn this.array.join(separator);\n\t\t\t\t\t},\n\n\t\t\t\t\tclear: function clear() {\n\t\t\t\t\t\tthis.array.length = 0;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t/**\n * 先进先出队列 (First Input First Output)\n *\n * 一种先进先出的数据缓存器\n */\n\t\t\t\tvar Queue = function Queue() {\n\t\t\t\t\tthis._array_h = new Array_h();\n\t\t\t\t};\n\n\t\t\t\tQueue.prototype = {\n\t\t\t\t\t_index: 0,\n\n\t\t\t\t\t/**\n * 排队\n *\n * @param {Object} obj [description]\n * @return {[type]} [description]\n */\n\t\t\t\t\tpush: function push(obj) {\n\t\t\t\t\t\tthis._array_h.push(obj);\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 出队\n *\n * @return {Object} [description]\n */\n\t\t\t\t\tpop: function pop() {\n\t\t\t\t\t\tvar ret = null;\n\t\t\t\t\t\tif (this._array_h.length()) {\n\t\t\t\t\t\t\tret = this._array_h.at(this._index);\n\t\t\t\t\t\t\tif (++this._index * 2 >= this._array_h.length()) {\n\t\t\t\t\t\t\t\tthis._array_h.slice(this._index);\n\t\t\t\t\t\t\t\tthis._index = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回队列中头部(即最新添加的)的动态对象\n *\n * @return {Object} [description]\n */\n\t\t\t\t\thead: function head() {\n\t\t\t\t\t\tvar ret = null,\n\t\t\t\t\t\t len = this._array_h.length();\n\t\t\t\t\t\tif (len) {\n\t\t\t\t\t\t\tret = this._array_h.at(len - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回队列中尾部(即最早添加的)的动态对象\n *\n * @return {Object} [description]\n */\n\t\t\t\t\ttail: function tail() {\n\t\t\t\t\t\tvar ret = null,\n\t\t\t\t\t\t len = this._array_h.length();\n\t\t\t\t\t\tif (len) {\n\t\t\t\t\t\t\tret = this._array_h.at(this._index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 返回数据队列长度\n *\n * @return {Number} [description]\n */\n\t\t\t\t\tlength: function length() {\n\t\t\t\t\t\treturn this._array_h.length() - this._index;\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n * 队列是否为空\n *\n * @return {Boolean} [description]\n */\n\t\t\t\t\tempty: function empty() {\n\t\t\t\t\t\treturn this._array_h.length() === 0;\n\t\t\t\t\t},\n\n\t\t\t\t\tclear: function clear() {\n\t\t\t\t\t\tthis._array_h.clear();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\texports.Queue = Queue;\n\t\t\t})();\n\n\t\t\t/***/\n\t\t},\n\t\t/* 40 */\n\t\t/***/function (module, exports, __webpack_require__) {\n\n\t\t\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; // Underscore.js 1.8.3\n\t\t\t// http://underscorejs.org\n\t\t\t// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t\t\t// Underscore may be freely distributed under the MIT license.\n\n\t\t\t(function () {\n\n\t\t\t\t// Baseline setup\n\t\t\t\t// --------------\n\n\t\t\t\t// Establish the root object, `window` in the browser, or `exports` on the server.\n\t\t\t\tvar root = this;\n\n\t\t\t\t// Save the previous value of the `_` variable.\n\t\t\t\tvar previousUnderscore = root._;\n\n\t\t\t\t// Save bytes in the minified (but not gzipped) version:\n\t\t\t\tvar ArrayProto = Array.prototype,\n\t\t\t\t ObjProto = Object.prototype,\n\t\t\t\t FuncProto = Function.prototype;\n\n\t\t\t\t// Create quick reference variables for speed access to core prototypes.\n\t\t\t\tvar push = ArrayProto.push,\n\t\t\t\t slice = ArrayProto.slice,\n\t\t\t\t toString = ObjProto.toString,\n\t\t\t\t hasOwnProperty = ObjProto.hasOwnProperty;\n\n\t\t\t\t// All **ECMAScript 5** native function implementations that we hope to use\n\t\t\t\t// are declared here.\n\t\t\t\tvar nativeIsArray = Array.isArray,\n\t\t\t\t nativeKeys = Object.keys,\n\t\t\t\t nativeBind = FuncProto.bind,\n\t\t\t\t nativeCreate = Object.create;\n\n\t\t\t\t// Naked function reference for surrogate-prototype-swapping.\n\t\t\t\tvar Ctor = function Ctor() {};\n\n\t\t\t\t// Create a safe reference to the Underscore object for use below.\n\t\t\t\tvar _ = function _(obj) {\n\t\t\t\t\tif (obj instanceof _) return obj;\n\t\t\t\t\tif (!(this instanceof _)) return new _(obj);\n\t\t\t\t\tthis._wrapped = obj;\n\t\t\t\t};\n\n\t\t\t\t// Export the Underscore object for **Node.js**, with\n\t\t\t\t// backwards-compatibility for the old `require()` API. If we're in\n\t\t\t\t// the browser, add `_` as a global object.\n\t\t\t\tif (true) {\n\t\t\t\t\tif (typeof module !== 'undefined' && module.exports) {\n\t\t\t\t\t\texports = module.exports = _;\n\t\t\t\t\t}\n\t\t\t\t\texports._ = _;\n\t\t\t\t} else {\n\t\t\t\t\troot._ = _;\n\t\t\t\t}\n\n\t\t\t\t// Current version.\n\t\t\t\t_.VERSION = '1.8.3';\n\n\t\t\t\t// Internal function that returns an efficient (for current engines) version\n\t\t\t\t// of the passed-in callback, to be repeatedly applied in other Underscore\n\t\t\t\t// functions.\n\t\t\t\tvar optimizeCb = function optimizeCb(func, context, argCount) {\n\t\t\t\t\tif (context === void 0) return func;\n\t\t\t\t\tswitch (argCount == null ? 3 : argCount) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\treturn function (value) {\n\t\t\t\t\t\t\t\treturn func.call(context, value);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\treturn function (value, other) {\n\t\t\t\t\t\t\t\treturn func.call(context, value, other);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\treturn function (value, index, collection) {\n\t\t\t\t\t\t\t\treturn func.call(context, value, index, collection);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\treturn function (accumulator, value, index, collection) {\n\t\t\t\t\t\t\t\treturn func.call(context, accumulator, value, index, collection);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn func.apply(context, arguments);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// A mostly-internal function to generate callbacks that can be applied\n\t\t\t\t// to each element in a collection, returning the desired result — either\n\t\t\t\t// identity, an arbitrary callback, a property matcher, or a property accessor.\n\t\t\t\tvar cb = function cb(value, context, argCount) {\n\t\t\t\t\tif (value == null) return _.identity;\n\t\t\t\t\tif (_.isFunction(value)) return optimizeCb(value, context, argCount);\n\t\t\t\t\tif (_.isObject(value)) return _.matcher(value);\n\t\t\t\t\treturn _.property(value);\n\t\t\t\t};\n\t\t\t\t_.iteratee = function (value, context) {\n\t\t\t\t\treturn cb(value, context, Infinity);\n\t\t\t\t};\n\n\t\t\t\t// An internal function for creating assigner functions.\n\t\t\t\tvar createAssigner = function createAssigner(keysFunc, undefinedOnly) {\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\tvar length = arguments.length;\n\t\t\t\t\t\tif (length < 2 || obj == null) return obj;\n\t\t\t\t\t\tfor (var index = 1; index < length; index++) {\n\t\t\t\t\t\t\tvar source = arguments[index],\n\t\t\t\t\t\t\t keys = keysFunc(source),\n\t\t\t\t\t\t\t l = keys.length;\n\t\t\t\t\t\t\tfor (var i = 0; i < l; i++) {\n\t\t\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\t\t\tif (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn obj;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// An internal function for creating a new object that inherits from another.\n\t\t\t\tvar baseCreate = function baseCreate(prototype) {\n\t\t\t\t\tif (!_.isObject(prototype)) return {};\n\t\t\t\t\tif (nativeCreate) return nativeCreate(prototype);\n\t\t\t\t\tCtor.prototype = prototype;\n\t\t\t\t\tvar result = new Ctor();\n\t\t\t\t\tCtor.prototype = null;\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tvar property = function property(key) {\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\treturn obj == null ? void 0 : obj[key];\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Helper for collection methods to determine whether a collection\n\t\t\t\t// should be iterated as an array or as an object\n\t\t\t\t// Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n\t\t\t\t// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n\t\t\t\tvar MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n\t\t\t\tvar getLength = property('length');\n\t\t\t\tvar isArrayLike = function isArrayLike(collection) {\n\t\t\t\t\tvar length = getLength(collection);\n\t\t\t\t\treturn typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n\t\t\t\t};\n\n\t\t\t\t// Collection Functions\n\t\t\t\t// --------------------\n\n\t\t\t\t// The cornerstone, an `each` implementation, aka `forEach`.\n\t\t\t\t// Handles raw objects in addition to array-likes. Treats all\n\t\t\t\t// sparse array-likes as if they were dense.\n\t\t\t\t_.each = _.forEach = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = optimizeCb(iteratee, context);\n\t\t\t\t\tvar i, length;\n\t\t\t\t\tif (isArrayLike(obj)) {\n\t\t\t\t\t\tfor (i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\titeratee(obj[i], i, obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\t\tfor (i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\t\titeratee(obj[keys[i]], keys[i], obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Return the results of applying the iteratee to each element.\n\t\t\t\t_.map = _.collect = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length,\n\t\t\t\t\t results = Array(length);\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tresults[index] = iteratee(obj[currentKey], currentKey, obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Create a reducing function iterating left or right.\n\t\t\t\tfunction createReduce(dir) {\n\t\t\t\t\t// Optimized iterator function as using arguments.length\n\t\t\t\t\t// in the main function will deoptimize the, see #1991.\n\t\t\t\t\tfunction iterator(obj, iteratee, memo, keys, index, length) {\n\t\t\t\t\t\tfor (; index >= 0 && index < length; index += dir) {\n\t\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\t\tmemo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn memo;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn function (obj, iteratee, memo, context) {\n\t\t\t\t\t\titeratee = optimizeCb(iteratee, context, 4);\n\t\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t\t length = (keys || obj).length,\n\t\t\t\t\t\t index = dir > 0 ? 0 : length - 1;\n\t\t\t\t\t\t// Determine the initial value if none is provided.\n\t\t\t\t\t\tif (arguments.length < 3) {\n\t\t\t\t\t\t\tmemo = obj[keys ? keys[index] : index];\n\t\t\t\t\t\t\tindex += dir;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn iterator(obj, iteratee, memo, keys, index, length);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// **Reduce** builds up a single result from a list of values, aka `inject`,\n\t\t\t\t// or `foldl`.\n\t\t\t\t_.reduce = _.foldl = _.inject = createReduce(1);\n\n\t\t\t\t// The right-associative version of reduce, also known as `foldr`.\n\t\t\t\t_.reduceRight = _.foldr = createReduce(-1);\n\n\t\t\t\t// Return the first value which passes a truth test. Aliased as `detect`.\n\t\t\t\t_.find = _.detect = function (obj, predicate, context) {\n\t\t\t\t\tvar key;\n\t\t\t\t\tif (isArrayLike(obj)) {\n\t\t\t\t\t\tkey = _.findIndex(obj, predicate, context);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkey = _.findKey(obj, predicate, context);\n\t\t\t\t\t}\n\t\t\t\t\tif (key !== void 0 && key !== -1) return obj[key];\n\t\t\t\t};\n\n\t\t\t\t// Return all the elements that pass a truth test.\n\t\t\t\t// Aliased as `select`.\n\t\t\t\t_.filter = _.select = function (obj, predicate, context) {\n\t\t\t\t\tvar results = [];\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\tif (predicate(value, index, list)) results.push(value);\n\t\t\t\t\t});\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Return all the elements for which a truth test fails.\n\t\t\t\t_.reject = function (obj, predicate, context) {\n\t\t\t\t\treturn _.filter(obj, _.negate(cb(predicate)), context);\n\t\t\t\t};\n\n\t\t\t\t// Determine whether all of the elements match a truth test.\n\t\t\t\t// Aliased as `all`.\n\t\t\t\t_.every = _.all = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tif (!predicate(obj[currentKey], currentKey, obj)) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Determine if at least one element in the object matches a truth test.\n\t\t\t\t// Aliased as `any`.\n\t\t\t\t_.some = _.any = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = !isArrayLike(obj) && _.keys(obj),\n\t\t\t\t\t length = (keys || obj).length;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tvar currentKey = keys ? keys[index] : index;\n\t\t\t\t\t\tif (predicate(obj[currentKey], currentKey, obj)) return true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\n\t\t\t\t// Determine if the array or object contains a given item (using `===`).\n\t\t\t\t// Aliased as `includes` and `include`.\n\t\t\t\t_.contains = _.includes = _.include = function (obj, item, fromIndex, guard) {\n\t\t\t\t\tif (!isArrayLike(obj)) obj = _.values(obj);\n\t\t\t\t\tif (typeof fromIndex != 'number' || guard) fromIndex = 0;\n\t\t\t\t\treturn _.indexOf(obj, item, fromIndex) >= 0;\n\t\t\t\t};\n\n\t\t\t\t// Invoke a method (with arguments) on every item in a collection.\n\t\t\t\t_.invoke = function (obj, method) {\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\tvar isFunc = _.isFunction(method);\n\t\t\t\t\treturn _.map(obj, function (value) {\n\t\t\t\t\t\tvar func = isFunc ? method : value[method];\n\t\t\t\t\t\treturn func == null ? func : func.apply(value, args);\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `map`: fetching a property.\n\t\t\t\t_.pluck = function (obj, key) {\n\t\t\t\t\treturn _.map(obj, _.property(key));\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `filter`: selecting only objects\n\t\t\t\t// containing specific `key:value` pairs.\n\t\t\t\t_.where = function (obj, attrs) {\n\t\t\t\t\treturn _.filter(obj, _.matcher(attrs));\n\t\t\t\t};\n\n\t\t\t\t// Convenience version of a common use case of `find`: getting the first object\n\t\t\t\t// containing specific `key:value` pairs.\n\t\t\t\t_.findWhere = function (obj, attrs) {\n\t\t\t\t\treturn _.find(obj, _.matcher(attrs));\n\t\t\t\t};\n\n\t\t\t\t// Return the maximum element (or element-based computation).\n\t\t\t\t_.max = function (obj, iteratee, context) {\n\t\t\t\t\tvar result = -Infinity,\n\t\t\t\t\t lastComputed = -Infinity,\n\t\t\t\t\t value,\n\t\t\t\t\t computed;\n\t\t\t\t\tif (iteratee == null && obj != null) {\n\t\t\t\t\t\tobj = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\t\tfor (var i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\tvalue = obj[i];\n\t\t\t\t\t\t\tif (value > result) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\t\tcomputed = iteratee(value, index, list);\n\t\t\t\t\t\t\tif (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t\tlastComputed = computed;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return the minimum element (or element-based computation).\n\t\t\t\t_.min = function (obj, iteratee, context) {\n\t\t\t\t\tvar result = Infinity,\n\t\t\t\t\t lastComputed = Infinity,\n\t\t\t\t\t value,\n\t\t\t\t\t computed;\n\t\t\t\t\tif (iteratee == null && obj != null) {\n\t\t\t\t\t\tobj = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\t\tfor (var i = 0, length = obj.length; i < length; i++) {\n\t\t\t\t\t\t\tvalue = obj[i];\n\t\t\t\t\t\t\tif (value < result) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index, list) {\n\t\t\t\t\t\t\tcomputed = iteratee(value, index, list);\n\t\t\t\t\t\t\tif (computed < lastComputed || computed === Infinity && result === Infinity) {\n\t\t\t\t\t\t\t\tresult = value;\n\t\t\t\t\t\t\t\tlastComputed = computed;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Shuffle a collection, using the modern version of the\n\t\t\t\t// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n\t\t\t\t_.shuffle = function (obj) {\n\t\t\t\t\tvar set = isArrayLike(obj) ? obj : _.values(obj);\n\t\t\t\t\tvar length = set.length;\n\t\t\t\t\tvar shuffled = Array(length);\n\t\t\t\t\tfor (var index = 0, rand; index < length; index++) {\n\t\t\t\t\t\trand = _.random(0, index);\n\t\t\t\t\t\tif (rand !== index) shuffled[index] = shuffled[rand];\n\t\t\t\t\t\tshuffled[rand] = set[index];\n\t\t\t\t\t}\n\t\t\t\t\treturn shuffled;\n\t\t\t\t};\n\n\t\t\t\t// Sample **n** random values from a collection.\n\t\t\t\t// If **n** is not specified, returns a single random element.\n\t\t\t\t// The internal `guard` argument allows it to work with `map`.\n\t\t\t\t_.sample = function (obj, n, guard) {\n\t\t\t\t\tif (n == null || guard) {\n\t\t\t\t\t\tif (!isArrayLike(obj)) obj = _.values(obj);\n\t\t\t\t\t\treturn obj[_.random(obj.length - 1)];\n\t\t\t\t\t}\n\t\t\t\t\treturn _.shuffle(obj).slice(0, Math.max(0, n));\n\t\t\t\t};\n\n\t\t\t\t// Sort the object's values by a criterion produced by an iteratee.\n\t\t\t\t_.sortBy = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\treturn _.pluck(_.map(obj, function (value, index, list) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\t\tcriteria: iteratee(value, index, list)\n\t\t\t\t\t\t};\n\t\t\t\t\t}).sort(function (left, right) {\n\t\t\t\t\t\tvar a = left.criteria;\n\t\t\t\t\t\tvar b = right.criteria;\n\t\t\t\t\t\tif (a !== b) {\n\t\t\t\t\t\t\tif (a > b || a === void 0) return 1;\n\t\t\t\t\t\t\tif (a < b || b === void 0) return -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn left.index - right.index;\n\t\t\t\t\t}), 'value');\n\t\t\t\t};\n\n\t\t\t\t// An internal function used for aggregate \"group by\" operations.\n\t\t\t\tvar group = function group(behavior) {\n\t\t\t\t\treturn function (obj, iteratee, context) {\n\t\t\t\t\t\tvar result = {};\n\t\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\t\t_.each(obj, function (value, index) {\n\t\t\t\t\t\t\tvar key = iteratee(value, index, obj);\n\t\t\t\t\t\t\tbehavior(result, value, key);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Groups the object's values by a criterion. Pass either a string attribute\n\t\t\t\t// to group by, or a function that returns the criterion.\n\t\t\t\t_.groupBy = group(function (result, value, key) {\n\t\t\t\t\tif (_.has(result, key)) result[key].push(value);else result[key] = [value];\n\t\t\t\t});\n\n\t\t\t\t// Indexes the object's values by a criterion, similar to `groupBy`, but for\n\t\t\t\t// when you know that your index values will be unique.\n\t\t\t\t_.indexBy = group(function (result, value, key) {\n\t\t\t\t\tresult[key] = value;\n\t\t\t\t});\n\n\t\t\t\t// Counts instances of an object that group by a certain criterion. Pass\n\t\t\t\t// either a string attribute to count by, or a function that returns the\n\t\t\t\t// criterion.\n\t\t\t\t_.countBy = group(function (result, value, key) {\n\t\t\t\t\tif (_.has(result, key)) result[key]++;else result[key] = 1;\n\t\t\t\t});\n\n\t\t\t\t// Safely create a real, live array from anything iterable.\n\t\t\t\t_.toArray = function (obj) {\n\t\t\t\t\tif (!obj) return [];\n\t\t\t\t\tif (_.isArray(obj)) return slice.call(obj);\n\t\t\t\t\tif (isArrayLike(obj)) return _.map(obj, _.identity);\n\t\t\t\t\treturn _.values(obj);\n\t\t\t\t};\n\n\t\t\t\t// Return the number of elements in an object.\n\t\t\t\t_.size = function (obj) {\n\t\t\t\t\tif (obj == null) return 0;\n\t\t\t\t\treturn isArrayLike(obj) ? obj.length : _.keys(obj).length;\n\t\t\t\t};\n\n\t\t\t\t// Split a collection into two arrays: one whose elements all satisfy the given\n\t\t\t\t// predicate, and one whose elements all do not satisfy the predicate.\n\t\t\t\t_.partition = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar pass = [],\n\t\t\t\t\t fail = [];\n\t\t\t\t\t_.each(obj, function (value, key, obj) {\n\t\t\t\t\t\t(predicate(value, key, obj) ? pass : fail).push(value);\n\t\t\t\t\t});\n\t\t\t\t\treturn [pass, fail];\n\t\t\t\t};\n\n\t\t\t\t// Array Functions\n\t\t\t\t// ---------------\n\n\t\t\t\t// Get the first element of an array. Passing **n** will return the first N\n\t\t\t\t// values in the array. Aliased as `head` and `take`. The **guard** check\n\t\t\t\t// allows it to work with `_.map`.\n\t\t\t\t_.first = _.head = _.take = function (array, n, guard) {\n\t\t\t\t\tif (array == null) return void 0;\n\t\t\t\t\tif (n == null || guard) return array[0];\n\t\t\t\t\treturn _.initial(array, array.length - n);\n\t\t\t\t};\n\n\t\t\t\t// Returns everything but the last entry of the array. Especially useful on\n\t\t\t\t// the arguments object. Passing **n** will return all the values in\n\t\t\t\t// the array, excluding the last N.\n\t\t\t\t_.initial = function (array, n, guard) {\n\t\t\t\t\treturn slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n\t\t\t\t};\n\n\t\t\t\t// Get the last element of an array. Passing **n** will return the last N\n\t\t\t\t// values in the array.\n\t\t\t\t_.last = function (array, n, guard) {\n\t\t\t\t\tif (array == null) return void 0;\n\t\t\t\t\tif (n == null || guard) return array[array.length - 1];\n\t\t\t\t\treturn _.rest(array, Math.max(0, array.length - n));\n\t\t\t\t};\n\n\t\t\t\t// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n\t\t\t\t// Especially useful on the arguments object. Passing an **n** will return\n\t\t\t\t// the rest N values in the array.\n\t\t\t\t_.rest = _.tail = _.drop = function (array, n, guard) {\n\t\t\t\t\treturn slice.call(array, n == null || guard ? 1 : n);\n\t\t\t\t};\n\n\t\t\t\t// Trim out all falsy values from an array.\n\t\t\t\t_.compact = function (array) {\n\t\t\t\t\treturn _.filter(array, _.identity);\n\t\t\t\t};\n\n\t\t\t\t// Internal implementation of a recursive `flatten` function.\n\t\t\t\tvar flatten = function flatten(input, shallow, strict, startIndex) {\n\t\t\t\t\tvar output = [],\n\t\t\t\t\t idx = 0;\n\t\t\t\t\tfor (var i = startIndex || 0, length = getLength(input); i < length; i++) {\n\t\t\t\t\t\tvar value = input[i];\n\t\t\t\t\t\tif (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n\t\t\t\t\t\t\t//flatten current level of array or arguments object\n\t\t\t\t\t\t\tif (!shallow) value = flatten(value, shallow, strict);\n\t\t\t\t\t\t\tvar j = 0,\n\t\t\t\t\t\t\t len = value.length;\n\t\t\t\t\t\t\toutput.length += len;\n\t\t\t\t\t\t\twhile (j < len) {\n\t\t\t\t\t\t\t\toutput[idx++] = value[j++];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!strict) {\n\t\t\t\t\t\t\toutput[idx++] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn output;\n\t\t\t\t};\n\n\t\t\t\t// Flatten out an array, either recursively (by default), or just one level.\n\t\t\t\t_.flatten = function (array, shallow) {\n\t\t\t\t\treturn flatten(array, shallow, false);\n\t\t\t\t};\n\n\t\t\t\t// Return a version of the array that does not contain the specified value(s).\n\t\t\t\t_.without = function (array) {\n\t\t\t\t\treturn _.difference(array, slice.call(arguments, 1));\n\t\t\t\t};\n\n\t\t\t\t// Produce a duplicate-free version of the array. If the array has already\n\t\t\t\t// been sorted, you have the option of using a faster algorithm.\n\t\t\t\t// Aliased as `unique`.\n\t\t\t\t_.uniq = _.unique = function (array, isSorted, iteratee, context) {\n\t\t\t\t\tif (!_.isBoolean(isSorted)) {\n\t\t\t\t\t\tcontext = iteratee;\n\t\t\t\t\t\titeratee = isSorted;\n\t\t\t\t\t\tisSorted = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (iteratee != null) iteratee = cb(iteratee, context);\n\t\t\t\t\tvar result = [];\n\t\t\t\t\tvar seen = [];\n\t\t\t\t\tfor (var i = 0, length = getLength(array); i < length; i++) {\n\t\t\t\t\t\tvar value = array[i],\n\t\t\t\t\t\t computed = iteratee ? iteratee(value, i, array) : value;\n\t\t\t\t\t\tif (isSorted) {\n\t\t\t\t\t\t\tif (!i || seen !== computed) result.push(value);\n\t\t\t\t\t\t\tseen = computed;\n\t\t\t\t\t\t} else if (iteratee) {\n\t\t\t\t\t\t\tif (!_.contains(seen, computed)) {\n\t\t\t\t\t\t\t\tseen.push(computed);\n\t\t\t\t\t\t\t\tresult.push(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (!_.contains(result, value)) {\n\t\t\t\t\t\t\tresult.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Produce an array that contains the union: each distinct element from all of\n\t\t\t\t// the passed-in arrays.\n\t\t\t\t_.union = function () {\n\t\t\t\t\treturn _.uniq(flatten(arguments, true, true));\n\t\t\t\t};\n\n\t\t\t\t// Produce an array that contains every item shared between all the\n\t\t\t\t// passed-in arrays.\n\t\t\t\t_.intersection = function (array) {\n\t\t\t\t\tvar result = [];\n\t\t\t\t\tvar argsLength = arguments.length;\n\t\t\t\t\tfor (var i = 0, length = getLength(array); i < length; i++) {\n\t\t\t\t\t\tvar item = array[i];\n\t\t\t\t\t\tif (_.contains(result, item)) continue;\n\t\t\t\t\t\tfor (var j = 1; j < argsLength; j++) {\n\t\t\t\t\t\t\tif (!_.contains(arguments[j], item)) break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j === argsLength) result.push(item);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Take the difference between one array and a number of other arrays.\n\t\t\t\t// Only the elements present in just the first array will remain.\n\t\t\t\t_.difference = function (array) {\n\t\t\t\t\tvar rest = flatten(arguments, true, true, 1);\n\t\t\t\t\treturn _.filter(array, function (value) {\n\t\t\t\t\t\treturn !_.contains(rest, value);\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Zip together multiple lists into a single array -- elements that share\n\t\t\t\t// an index go together.\n\t\t\t\t_.zip = function () {\n\t\t\t\t\treturn _.unzip(arguments);\n\t\t\t\t};\n\n\t\t\t\t// Complement of _.zip. Unzip accepts an array of arrays and groups\n\t\t\t\t// each array's elements on shared indices\n\t\t\t\t_.unzip = function (array) {\n\t\t\t\t\tvar length = array && _.max(array, getLength).length || 0;\n\t\t\t\t\tvar result = Array(length);\n\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tresult[index] = _.pluck(array, index);\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Converts lists into objects. Pass either a single array of `[key, value]`\n\t\t\t\t// pairs, or two parallel arrays of the same length -- one of keys, and one of\n\t\t\t\t// the corresponding values.\n\t\t\t\t_.object = function (list, values) {\n\t\t\t\t\tvar result = {};\n\t\t\t\t\tfor (var i = 0, length = getLength(list); i < length; i++) {\n\t\t\t\t\t\tif (values) {\n\t\t\t\t\t\t\tresult[list[i]] = values[i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult[list[i][0]] = list[i][1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Generator function to create the findIndex and findLastIndex functions\n\t\t\t\tfunction createPredicateIndexFinder(dir) {\n\t\t\t\t\treturn function (array, predicate, context) {\n\t\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\t\tvar length = getLength(array);\n\t\t\t\t\t\tvar index = dir > 0 ? 0 : length - 1;\n\t\t\t\t\t\tfor (; index >= 0 && index < length; index += dir) {\n\t\t\t\t\t\t\tif (predicate(array[index], index, array)) return index;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Returns the first index on an array-like that passes a predicate test\n\t\t\t\t_.findIndex = createPredicateIndexFinder(1);\n\t\t\t\t_.findLastIndex = createPredicateIndexFinder(-1);\n\n\t\t\t\t// Use a comparator function to figure out the smallest index at which\n\t\t\t\t// an object should be inserted so as to maintain order. Uses binary search.\n\t\t\t\t_.sortedIndex = function (array, obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context, 1);\n\t\t\t\t\tvar value = iteratee(obj);\n\t\t\t\t\tvar low = 0,\n\t\t\t\t\t high = getLength(array);\n\t\t\t\t\twhile (low < high) {\n\t\t\t\t\t\tvar mid = Math.floor((low + high) / 2);\n\t\t\t\t\t\tif (iteratee(array[mid]) < value) low = mid + 1;else high = mid;\n\t\t\t\t\t}\n\t\t\t\t\treturn low;\n\t\t\t\t};\n\n\t\t\t\t// Generator function to create the indexOf and lastIndexOf functions\n\t\t\t\tfunction createIndexFinder(dir, predicateFind, sortedIndex) {\n\t\t\t\t\treturn function (array, item, idx) {\n\t\t\t\t\t\tvar i = 0,\n\t\t\t\t\t\t length = getLength(array);\n\t\t\t\t\t\tif (typeof idx == 'number') {\n\t\t\t\t\t\t\tif (dir > 0) {\n\t\t\t\t\t\t\t\ti = idx >= 0 ? idx : Math.max(idx + length, i);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlength = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (sortedIndex && idx && length) {\n\t\t\t\t\t\t\tidx = sortedIndex(array, item);\n\t\t\t\t\t\t\treturn array[idx] === item ? idx : -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (item !== item) {\n\t\t\t\t\t\t\tidx = predicateFind(slice.call(array, i, length), _.isNaN);\n\t\t\t\t\t\t\treturn idx >= 0 ? idx + i : -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n\t\t\t\t\t\t\tif (array[idx] === item) return idx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Return the position of the first occurrence of an item in an array,\n\t\t\t\t// or -1 if the item is not included in the array.\n\t\t\t\t// If the array is large and already in sort order, pass `true`\n\t\t\t\t// for **isSorted** to use binary search.\n\t\t\t\t_.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n\t\t\t\t_.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n\t\t\t\t// Generate an integer Array containing an arithmetic progression. A port of\n\t\t\t\t// the native Python `range()` function. See\n\t\t\t\t// [the Python documentation](http://docs.python.org/library/functions.html#range).\n\t\t\t\t_.range = function (start, stop, step) {\n\t\t\t\t\tif (stop == null) {\n\t\t\t\t\t\tstop = start || 0;\n\t\t\t\t\t\tstart = 0;\n\t\t\t\t\t}\n\t\t\t\t\tstep = step || 1;\n\n\t\t\t\t\tvar length = Math.max(Math.ceil((stop - start) / step), 0);\n\t\t\t\t\tvar range = Array(length);\n\n\t\t\t\t\tfor (var idx = 0; idx < length; idx++, start += step) {\n\t\t\t\t\t\trange[idx] = start;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn range;\n\t\t\t\t};\n\n\t\t\t\t// Function (ahem) Functions\n\t\t\t\t// ------------------\n\n\t\t\t\t// Determines whether to execute a function as a constructor\n\t\t\t\t// or a normal function with the provided arguments\n\t\t\t\tvar executeBound = function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n\t\t\t\t\tif (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n\t\t\t\t\tvar self = baseCreate(sourceFunc.prototype);\n\t\t\t\t\tvar result = sourceFunc.apply(self, args);\n\t\t\t\t\tif (_.isObject(result)) return result;\n\t\t\t\t\treturn self;\n\t\t\t\t};\n\n\t\t\t\t// Create a function bound to a given object (assigning `this`, and arguments,\n\t\t\t\t// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n\t\t\t\t// available.\n\t\t\t\t_.bind = function (func, context) {\n\t\t\t\t\tif (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n\t\t\t\t\tif (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\tvar bound = function bound() {\n\t\t\t\t\t\treturn executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\n\t\t\t\t\t};\n\t\t\t\t\treturn bound;\n\t\t\t\t};\n\n\t\t\t\t// Partially apply a function by creating a version that has had some of its\n\t\t\t\t// arguments pre-filled, without changing its dynamic `this` context. _ acts\n\t\t\t\t// as a placeholder, allowing any combination of arguments to be pre-filled.\n\t\t\t\t_.partial = function (func) {\n\t\t\t\t\tvar boundArgs = slice.call(arguments, 1);\n\t\t\t\t\tvar bound = function bound() {\n\t\t\t\t\t\tvar position = 0,\n\t\t\t\t\t\t length = boundArgs.length;\n\t\t\t\t\t\tvar args = Array(length);\n\t\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\t\targs[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (position < arguments.length) {\n\t\t\t\t\t\t\targs.push(arguments[position++]);\n\t\t\t\t\t\t}return executeBound(func, bound, this, this, args);\n\t\t\t\t\t};\n\t\t\t\t\treturn bound;\n\t\t\t\t};\n\n\t\t\t\t// Bind a number of an object's methods to that object. Remaining arguments\n\t\t\t\t// are the method names to be bound. Useful for ensuring that all callbacks\n\t\t\t\t// defined on an object belong to it.\n\t\t\t\t_.bindAll = function (obj) {\n\t\t\t\t\tvar i,\n\t\t\t\t\t length = arguments.length,\n\t\t\t\t\t key;\n\t\t\t\t\tif (length <= 1) throw new Error('bindAll must be passed function names');\n\t\t\t\t\tfor (i = 1; i < length; i++) {\n\t\t\t\t\t\tkey = arguments[i];\n\t\t\t\t\t\tobj[key] = _.bind(obj[key], obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Memoize an expensive function by storing its results.\n\t\t\t\t_.memoize = function (func, hasher) {\n\t\t\t\t\tvar memoize = function memoize(key) {\n\t\t\t\t\t\tvar cache = memoize.cache;\n\t\t\t\t\t\tvar address = '' + (hasher ? hasher.apply(this, arguments) : key);\n\t\t\t\t\t\tif (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n\t\t\t\t\t\treturn cache[address];\n\t\t\t\t\t};\n\t\t\t\t\tmemoize.cache = {};\n\t\t\t\t\treturn memoize;\n\t\t\t\t};\n\n\t\t\t\t// Delays a function for the given number of milliseconds, and then calls\n\t\t\t\t// it with the arguments supplied.\n\t\t\t\t_.delay = function (func, wait) {\n\t\t\t\t\tvar args = slice.call(arguments, 2);\n\t\t\t\t\treturn setTimeout(function () {\n\t\t\t\t\t\treturn func.apply(null, args);\n\t\t\t\t\t}, wait);\n\t\t\t\t};\n\n\t\t\t\t// Defers a function, scheduling it to run after the current call stack has\n\t\t\t\t// cleared.\n\t\t\t\t_.defer = _.partial(_.delay, _, 1);\n\n\t\t\t\t// Returns a function, that, when invoked, will only be triggered at most once\n\t\t\t\t// during a given window of time. Normally, the throttled function will run\n\t\t\t\t// as much as it can, without ever going more than once per `wait` duration;\n\t\t\t\t// but if you'd like to disable the execution on the leading edge, pass\n\t\t\t\t// `{leading: false}`. To disable execution on the trailing edge, ditto.\n\t\t\t\t_.throttle = function (func, wait, options) {\n\t\t\t\t\tvar context, args, result;\n\t\t\t\t\tvar timeout = null;\n\t\t\t\t\tvar previous = 0;\n\t\t\t\t\tif (!options) options = {};\n\t\t\t\t\tvar later = function later() {\n\t\t\t\t\t\tprevious = options.leading === false ? 0 : _.now();\n\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t};\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tvar now = _.now();\n\t\t\t\t\t\tif (!previous && options.leading === false) previous = now;\n\t\t\t\t\t\tvar remaining = wait - (now - previous);\n\t\t\t\t\t\tcontext = this;\n\t\t\t\t\t\targs = arguments;\n\t\t\t\t\t\tif (remaining <= 0 || remaining > wait) {\n\t\t\t\t\t\t\tif (timeout) {\n\t\t\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprevious = now;\n\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t\t} else if (!timeout && options.trailing !== false) {\n\t\t\t\t\t\t\ttimeout = setTimeout(later, remaining);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function, that, as long as it continues to be invoked, will not\n\t\t\t\t// be triggered. The function will be called after it stops being called for\n\t\t\t\t// N milliseconds. If `immediate` is passed, trigger the function on the\n\t\t\t\t// leading edge, instead of the trailing.\n\t\t\t\t_.debounce = function (func, wait, immediate) {\n\t\t\t\t\tvar timeout, args, context, timestamp, result;\n\n\t\t\t\t\tvar later = function later() {\n\t\t\t\t\t\tvar last = _.now() - timestamp;\n\n\t\t\t\t\t\tif (last < wait && last >= 0) {\n\t\t\t\t\t\t\ttimeout = setTimeout(later, wait - last);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttimeout = null;\n\t\t\t\t\t\t\tif (!immediate) {\n\t\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\t\tif (!timeout) context = args = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tcontext = this;\n\t\t\t\t\t\targs = arguments;\n\t\t\t\t\t\ttimestamp = _.now();\n\t\t\t\t\t\tvar callNow = immediate && !timeout;\n\t\t\t\t\t\tif (!timeout) timeout = setTimeout(later, wait);\n\t\t\t\t\t\tif (callNow) {\n\t\t\t\t\t\t\tresult = func.apply(context, args);\n\t\t\t\t\t\t\tcontext = args = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns the first function passed as an argument to the second,\n\t\t\t\t// allowing you to adjust arguments, run code before and after, and\n\t\t\t\t// conditionally execute the original function.\n\t\t\t\t_.wrap = function (func, wrapper) {\n\t\t\t\t\treturn _.partial(wrapper, func);\n\t\t\t\t};\n\n\t\t\t\t// Returns a negated version of the passed-in predicate.\n\t\t\t\t_.negate = function (predicate) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn !predicate.apply(this, arguments);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that is the composition of a list of functions, each\n\t\t\t\t// consuming the return value of the function that follows.\n\t\t\t\t_.compose = function () {\n\t\t\t\t\tvar args = arguments;\n\t\t\t\t\tvar start = args.length - 1;\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tvar i = start;\n\t\t\t\t\t\tvar result = args[start].apply(this, arguments);\n\t\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\t\tresult = args[i].call(this, result);\n\t\t\t\t\t\t}return result;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will only be executed on and after the Nth call.\n\t\t\t\t_.after = function (times, func) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tif (--times < 1) {\n\t\t\t\t\t\t\treturn func.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will only be executed up to (but not including) the Nth call.\n\t\t\t\t_.before = function (times, func) {\n\t\t\t\t\tvar memo;\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\tif (--times > 0) {\n\t\t\t\t\t\t\tmemo = func.apply(this, arguments);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (times <= 1) func = null;\n\t\t\t\t\t\treturn memo;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a function that will be executed at most one time, no matter how\n\t\t\t\t// often you call it. Useful for lazy initialization.\n\t\t\t\t_.once = _.partial(_.before, 2);\n\n\t\t\t\t// Object Functions\n\t\t\t\t// ----------------\n\n\t\t\t\t// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n\t\t\t\tvar hasEnumBug = !{ toString: null }.propertyIsEnumerable('toString');\n\t\t\t\tvar nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n\t\t\t\tfunction collectNonEnumProps(obj, keys) {\n\t\t\t\t\tvar nonEnumIdx = nonEnumerableProps.length;\n\t\t\t\t\tvar constructor = obj.constructor;\n\t\t\t\t\tvar proto = _.isFunction(constructor) && constructor.prototype || ObjProto;\n\n\t\t\t\t\t// Constructor is a special case.\n\t\t\t\t\tvar prop = 'constructor';\n\t\t\t\t\tif (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n\t\t\t\t\twhile (nonEnumIdx--) {\n\t\t\t\t\t\tprop = nonEnumerableProps[nonEnumIdx];\n\t\t\t\t\t\tif (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n\t\t\t\t\t\t\tkeys.push(prop);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Retrieve the names of an object's own properties.\n\t\t\t\t// Delegates to **ECMAScript 5**'s native `Object.keys`\n\t\t\t\t_.keys = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return [];\n\t\t\t\t\tif (nativeKeys) return nativeKeys(obj);\n\t\t\t\t\tvar keys = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tif (_.has(obj, key)) keys.push(key);\n\t\t\t\t\t} // Ahem, IE < 9.\n\t\t\t\t\tif (hasEnumBug) collectNonEnumProps(obj, keys);\n\t\t\t\t\treturn keys;\n\t\t\t\t};\n\n\t\t\t\t// Retrieve all the property names of an object.\n\t\t\t\t_.allKeys = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return [];\n\t\t\t\t\tvar keys = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tkeys.push(key);\n\t\t\t\t\t} // Ahem, IE < 9.\n\t\t\t\t\tif (hasEnumBug) collectNonEnumProps(obj, keys);\n\t\t\t\t\treturn keys;\n\t\t\t\t};\n\n\t\t\t\t// Retrieve the values of an object's properties.\n\t\t\t\t_.values = function (obj) {\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tvar length = keys.length;\n\t\t\t\t\tvar values = Array(length);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tvalues[i] = obj[keys[i]];\n\t\t\t\t\t}\n\t\t\t\t\treturn values;\n\t\t\t\t};\n\n\t\t\t\t// Returns the results of applying the iteratee to each element of the object\n\t\t\t\t// In contrast to _.map it returns an object\n\t\t\t\t_.mapObject = function (obj, iteratee, context) {\n\t\t\t\t\titeratee = cb(iteratee, context);\n\t\t\t\t\tvar keys = _.keys(obj),\n\t\t\t\t\t length = keys.length,\n\t\t\t\t\t results = {},\n\t\t\t\t\t currentKey;\n\t\t\t\t\tfor (var index = 0; index < length; index++) {\n\t\t\t\t\t\tcurrentKey = keys[index];\n\t\t\t\t\t\tresults[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn results;\n\t\t\t\t};\n\n\t\t\t\t// Convert an object into a list of `[key, value]` pairs.\n\t\t\t\t_.pairs = function (obj) {\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tvar length = keys.length;\n\t\t\t\t\tvar pairs = Array(length);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tpairs[i] = [keys[i], obj[keys[i]]];\n\t\t\t\t\t}\n\t\t\t\t\treturn pairs;\n\t\t\t\t};\n\n\t\t\t\t// Invert the keys and values of an object. The values must be serializable.\n\t\t\t\t_.invert = function (obj) {\n\t\t\t\t\tvar result = {};\n\t\t\t\t\tvar keys = _.keys(obj);\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tresult[obj[keys[i]]] = keys[i];\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return a sorted list of the function names available on the object.\n\t\t\t\t// Aliased as `methods`\n\t\t\t\t_.functions = _.methods = function (obj) {\n\t\t\t\t\tvar names = [];\n\t\t\t\t\tfor (var key in obj) {\n\t\t\t\t\t\tif (_.isFunction(obj[key])) names.push(key);\n\t\t\t\t\t}\n\t\t\t\t\treturn names.sort();\n\t\t\t\t};\n\n\t\t\t\t// Extend a given object with all the properties in passed-in object(s).\n\t\t\t\t_.extend = createAssigner(_.allKeys);\n\n\t\t\t\t// Assigns a given object with all the own properties in the passed-in object(s)\n\t\t\t\t// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n\t\t\t\t_.extendOwn = _.assign = createAssigner(_.keys);\n\n\t\t\t\t// Returns the first key on an object that passes a predicate test\n\t\t\t\t_.findKey = function (obj, predicate, context) {\n\t\t\t\t\tpredicate = cb(predicate, context);\n\t\t\t\t\tvar keys = _.keys(obj),\n\t\t\t\t\t key;\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tkey = keys[i];\n\t\t\t\t\t\tif (predicate(obj[key], key, obj)) return key;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// Return a copy of the object only containing the whitelisted properties.\n\t\t\t\t_.pick = function (object, oiteratee, context) {\n\t\t\t\t\tvar result = {},\n\t\t\t\t\t obj = object,\n\t\t\t\t\t iteratee,\n\t\t\t\t\t keys;\n\t\t\t\t\tif (obj == null) return result;\n\t\t\t\t\tif (_.isFunction(oiteratee)) {\n\t\t\t\t\t\tkeys = _.allKeys(obj);\n\t\t\t\t\t\titeratee = optimizeCb(oiteratee, context);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkeys = flatten(arguments, false, false, 1);\n\t\t\t\t\t\titeratee = function iteratee(value, key, obj) {\n\t\t\t\t\t\t\treturn key in obj;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tobj = Object(obj);\n\t\t\t\t\t}\n\t\t\t\t\tfor (var i = 0, length = keys.length; i < length; i++) {\n\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\tvar value = obj[key];\n\t\t\t\t\t\tif (iteratee(value, key, obj)) result[key] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Return a copy of the object without the blacklisted properties.\n\t\t\t\t_.omit = function (obj, iteratee, context) {\n\t\t\t\t\tif (_.isFunction(iteratee)) {\n\t\t\t\t\t\titeratee = _.negate(iteratee);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar keys = _.map(flatten(arguments, false, false, 1), String);\n\t\t\t\t\t\titeratee = function iteratee(value, key) {\n\t\t\t\t\t\t\treturn !_.contains(keys, key);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn _.pick(obj, iteratee, context);\n\t\t\t\t};\n\n\t\t\t\t// Fill in a given object with default properties.\n\t\t\t\t_.defaults = createAssigner(_.allKeys, true);\n\n\t\t\t\t// Creates an object that inherits from the given prototype object.\n\t\t\t\t// If additional properties are provided then they will be added to the\n\t\t\t\t// created object.\n\t\t\t\t_.create = function (prototype, props) {\n\t\t\t\t\tvar result = baseCreate(prototype);\n\t\t\t\t\tif (props) _.extendOwn(result, props);\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t// Create a (shallow-cloned) duplicate of an object.\n\t\t\t\t_.clone = function (obj) {\n\t\t\t\t\tif (!_.isObject(obj)) return obj;\n\t\t\t\t\treturn _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n\t\t\t\t};\n\n\t\t\t\t// Invokes interceptor with the obj, and then returns obj.\n\t\t\t\t// The primary purpose of this method is to \"tap into\" a method chain, in\n\t\t\t\t// order to perform operations on intermediate results within the chain.\n\t\t\t\t_.tap = function (obj, interceptor) {\n\t\t\t\t\tinterceptor(obj);\n\t\t\t\t\treturn obj;\n\t\t\t\t};\n\n\t\t\t\t// Returns whether an object has a given set of `key:value` pairs.\n\t\t\t\t_.isMatch = function (object, attrs) {\n\t\t\t\t\tvar keys = _.keys(attrs),\n\t\t\t\t\t length = keys.length;\n\t\t\t\t\tif (object == null) return !length;\n\t\t\t\t\tvar obj = Object(object);\n\t\t\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t\t\tvar key = keys[i];\n\t\t\t\t\t\tif (attrs[key] !== obj[key] || !(key in obj)) return false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Internal recursive comparison function for `isEqual`.\n\t\t\t\tvar eq = function eq(a, b, aStack, bStack) {\n\t\t\t\t\t// Identical objects are equal. `0 === -0`, but they aren't identical.\n\t\t\t\t\t// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n\t\t\t\t\tif (a === b) return a !== 0 || 1 / a === 1 / b;\n\t\t\t\t\t// A strict comparison is necessary because `null == undefined`.\n\t\t\t\t\tif (a == null || b == null) return a === b;\n\t\t\t\t\t// Unwrap any wrapped objects.\n\t\t\t\t\tif (a instanceof _) a = a._wrapped;\n\t\t\t\t\tif (b instanceof _) b = b._wrapped;\n\t\t\t\t\t// Compare `[[Class]]` names.\n\t\t\t\t\tvar className = toString.call(a);\n\t\t\t\t\tif (className !== toString.call(b)) return false;\n\t\t\t\t\tswitch (className) {\n\t\t\t\t\t\t// Strings, numbers, regular expressions, dates, and booleans are compared by value.\n\t\t\t\t\t\tcase '[object RegExp]':\n\t\t\t\t\t\t// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\t\t\t\t\t\tcase '[object String]':\n\t\t\t\t\t\t\t// Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n\t\t\t\t\t\t\t// equivalent to `new String(\"5\")`.\n\t\t\t\t\t\t\treturn '' + a === '' + b;\n\t\t\t\t\t\tcase '[object Number]':\n\t\t\t\t\t\t\t// `NaN`s are equivalent, but non-reflexive.\n\t\t\t\t\t\t\t// Object(NaN) is equivalent to NaN\n\t\t\t\t\t\t\tif (+a !== +a) return +b !== +b;\n\t\t\t\t\t\t\t// An `egal` comparison is performed for other numeric values.\n\t\t\t\t\t\t\treturn +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\t\t\t\t\t\tcase '[object Date]':\n\t\t\t\t\t\tcase '[object Boolean]':\n\t\t\t\t\t\t\t// Coerce dates and booleans to numeric primitive values. Dates are compared by their\n\t\t\t\t\t\t\t// millisecond representations. Note that invalid dates with millisecond representations\n\t\t\t\t\t\t\t// of `NaN` are not equivalent.\n\t\t\t\t\t\t\treturn +a === +b;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar areArrays = className === '[object Array]';\n\t\t\t\t\tif (!areArrays) {\n\t\t\t\t\t\tif ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) != 'object' || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) != 'object') return false;\n\n\t\t\t\t\t\t// Objects with different constructors are not equivalent, but `Object`s or `Array`s\n\t\t\t\t\t\t// from different frames are.\n\t\t\t\t\t\tvar aCtor = a.constructor,\n\t\t\t\t\t\t bCtor = b.constructor;\n\t\t\t\t\t\tif (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && 'constructor' in a && 'constructor' in b) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Assume equality for cyclic structures. The algorithm for detecting cyclic\n\t\t\t\t\t// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n\t\t\t\t\t// Initializing stack of traversed objects.\n\t\t\t\t\t// It's done here since we only need them for objects and arrays comparison.\n\t\t\t\t\taStack = aStack || [];\n\t\t\t\t\tbStack = bStack || [];\n\t\t\t\t\tvar length = aStack.length;\n\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t// Linear search. Performance is inversely proportional to the number of\n\t\t\t\t\t\t// unique nested structures.\n\t\t\t\t\t\tif (aStack[length] === a) return bStack[length] === b;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the first object to the stack of traversed objects.\n\t\t\t\t\taStack.push(a);\n\t\t\t\t\tbStack.push(b);\n\n\t\t\t\t\t// Recursively compare objects and arrays.\n\t\t\t\t\tif (areArrays) {\n\t\t\t\t\t\t// Compare array lengths to determine if a deep comparison is necessary.\n\t\t\t\t\t\tlength = a.length;\n\t\t\t\t\t\tif (length !== b.length) return false;\n\t\t\t\t\t\t// Deep compare the contents, ignoring non-numeric properties.\n\t\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t\tif (!eq(a[length], b[length], aStack, bStack)) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Deep compare objects.\n\t\t\t\t\t\tvar keys = _.keys(a),\n\t\t\t\t\t\t key;\n\t\t\t\t\t\tlength = keys.length;\n\t\t\t\t\t\t// Ensure that both objects contain the same number of properties before comparing deep equality.\n\t\t\t\t\t\tif (_.keys(b).length !== length) return false;\n\t\t\t\t\t\twhile (length--) {\n\t\t\t\t\t\t\t// Deep compare each member\n\t\t\t\t\t\t\tkey = keys[length];\n\t\t\t\t\t\t\tif (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Remove the first object from the stack of traversed objects.\n\t\t\t\t\taStack.pop();\n\t\t\t\t\tbStack.pop();\n\t\t\t\t\treturn true;\n\t\t\t\t};\n\n\t\t\t\t// Perform a deep comparison to check if two objects are equal.\n\t\t\t\t_.isEqual = function (a, b) {\n\t\t\t\t\treturn eq(a, b);\n\t\t\t\t};\n\n\t\t\t\t// Is a given array, string, or object empty?\n\t\t\t\t// An \"empty\" object has no enumerable own-properties.\n\t\t\t\t_.isEmpty = function (obj) {\n\t\t\t\t\tif (obj == null) return true;\n\t\t\t\t\tif (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n\t\t\t\t\treturn _.keys(obj).length === 0;\n\t\t\t\t};\n\n\t\t\t\t// Is a given value a DOM element?\n\t\t\t\t_.isElement = function (obj) {\n\t\t\t\t\treturn !!(obj && obj.nodeType === 1);\n\t\t\t\t};\n\n\t\t\t\t// Is a given value an array?\n\t\t\t\t// Delegates to ECMA5's native Array.isArray\n\t\t\t\t_.isArray = nativeIsArray || function (obj) {\n\t\t\t\t\treturn toString.call(obj) === '[object Array]';\n\t\t\t\t};\n\n\t\t\t\t// Is a given variable an object?\n\t\t\t\t_.isObject = function (obj) {\n\t\t\t\t\tvar type = typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n\t\t\t\t\treturn type === 'function' || type === 'object' && !!obj;\n\t\t\t\t};\n\n\t\t\t\t// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n\t\t\t\t_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function (name) {\n\t\t\t\t\t_['is' + name] = function (obj) {\n\t\t\t\t\t\treturn toString.call(obj) === '[object ' + name + ']';\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Define a fallback version of the method in browsers (ahem, IE < 9), where\n\t\t\t\t// there isn't any inspectable \"Arguments\" type.\n\t\t\t\tif (!_.isArguments(arguments)) {\n\t\t\t\t\t_.isArguments = function (obj) {\n\t\t\t\t\t\treturn _.has(obj, 'callee');\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n\t\t\t\t// IE 11 (#1621), and in Safari 8 (#1929).\n\t\t\t\tif (typeof /./ != 'function' && (typeof Int8Array === 'undefined' ? 'undefined' : _typeof(Int8Array)) != 'object') {\n\t\t\t\t\t_.isFunction = function (obj) {\n\t\t\t\t\t\treturn typeof obj == 'function' || false;\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Is a given object a finite number?\n\t\t\t\t_.isFinite = function (obj) {\n\t\t\t\t\treturn isFinite(obj) && !isNaN(parseFloat(obj));\n\t\t\t\t};\n\n\t\t\t\t// Is the given value `NaN`? (NaN is the only number which does not equal itself).\n\t\t\t\t_.isNaN = function (obj) {\n\t\t\t\t\treturn _.isNumber(obj) && obj !== +obj;\n\t\t\t\t};\n\n\t\t\t\t// Is a given value a boolean?\n\t\t\t\t_.isBoolean = function (obj) {\n\t\t\t\t\treturn obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n\t\t\t\t};\n\n\t\t\t\t// Is a given value equal to null?\n\t\t\t\t_.isNull = function (obj) {\n\t\t\t\t\treturn obj === null;\n\t\t\t\t};\n\n\t\t\t\t// Is a given variable undefined?\n\t\t\t\t_.isUndefined = function (obj) {\n\t\t\t\t\treturn obj === void 0;\n\t\t\t\t};\n\n\t\t\t\t// Shortcut function for checking if an object has a given property directly\n\t\t\t\t// on itself (in other words, not on a prototype).\n\t\t\t\t_.has = function (obj, key) {\n\t\t\t\t\treturn obj != null && hasOwnProperty.call(obj, key);\n\t\t\t\t};\n\n\t\t\t\t// Utility Functions\n\t\t\t\t// -----------------\n\n\t\t\t\t// Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n\t\t\t\t// previous owner. Returns a reference to the Underscore object.\n\t\t\t\t_.noConflict = function () {\n\t\t\t\t\troot._ = previousUnderscore;\n\t\t\t\t\treturn this;\n\t\t\t\t};\n\n\t\t\t\t// Keep the identity function around for default iteratees.\n\t\t\t\t_.identity = function (value) {\n\t\t\t\t\treturn value;\n\t\t\t\t};\n\n\t\t\t\t// Predicate-generating functions. Often useful outside of Underscore.\n\t\t\t\t_.constant = function (value) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t_.noop = function () {};\n\n\t\t\t\t_.property = property;\n\n\t\t\t\t// Generates a function for a given object that returns a given property.\n\t\t\t\t_.propertyOf = function (obj) {\n\t\t\t\t\treturn obj == null ? function () {} : function (key) {\n\t\t\t\t\t\treturn obj[key];\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Returns a predicate for checking whether an object has a given set of\n\t\t\t\t// `key:value` pairs.\n\t\t\t\t_.matcher = _.matches = function (attrs) {\n\t\t\t\t\tattrs = _.extendOwn({}, attrs);\n\t\t\t\t\treturn function (obj) {\n\t\t\t\t\t\treturn _.isMatch(obj, attrs);\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Run a function **n** times.\n\t\t\t\t_.times = function (n, iteratee, context) {\n\t\t\t\t\tvar accum = Array(Math.max(0, n));\n\t\t\t\t\titeratee = optimizeCb(iteratee, context, 1);\n\t\t\t\t\tfor (var i = 0; i < n; i++) {\n\t\t\t\t\t\taccum[i] = iteratee(i);\n\t\t\t\t\t}return accum;\n\t\t\t\t};\n\n\t\t\t\t// Return a random integer between min and max (inclusive).\n\t\t\t\t_.random = function (min, max) {\n\t\t\t\t\tif (max == null) {\n\t\t\t\t\t\tmax = min;\n\t\t\t\t\t\tmin = 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn min + Math.floor(Math.random() * (max - min + 1));\n\t\t\t\t};\n\n\t\t\t\t// A (possibly faster) way to get the current timestamp as an integer.\n\t\t\t\t_.now = Date.now || function () {\n\t\t\t\t\treturn new Date().getTime();\n\t\t\t\t};\n\n\t\t\t\t// List of HTML entities for escaping.\n\t\t\t\tvar escapeMap = {\n\t\t\t\t\t'&': '&',\n\t\t\t\t\t'<': '<',\n\t\t\t\t\t'>': '>',\n\t\t\t\t\t'\"': '"',\n\t\t\t\t\t\"'\": ''',\n\t\t\t\t\t'`': '`'\n\t\t\t\t};\n\t\t\t\tvar unescapeMap = _.invert(escapeMap);\n\n\t\t\t\t// Functions for escaping and unescaping strings to/from HTML interpolation.\n\t\t\t\tvar createEscaper = function createEscaper(map) {\n\t\t\t\t\tvar escaper = function escaper(match) {\n\t\t\t\t\t\treturn map[match];\n\t\t\t\t\t};\n\t\t\t\t\t// Regexes for identifying a key that needs to be escaped\n\t\t\t\t\tvar source = '(?:' + _.keys(map).join('|') + ')';\n\t\t\t\t\tvar testRegexp = RegExp(source);\n\t\t\t\t\tvar replaceRegexp = RegExp(source, 'g');\n\t\t\t\t\treturn function (string) {\n\t\t\t\t\t\tstring = string == null ? '' : '' + string;\n\t\t\t\t\t\treturn testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t_.escape = createEscaper(escapeMap);\n\t\t\t\t_.unescape = createEscaper(unescapeMap);\n\n\t\t\t\t// If the value of the named `property` is a function then invoke it with the\n\t\t\t\t// `object` as context; otherwise, return it.\n\t\t\t\t_.result = function (object, property, fallback) {\n\t\t\t\t\tvar value = object == null ? void 0 : object[property];\n\t\t\t\t\tif (value === void 0) {\n\t\t\t\t\t\tvalue = fallback;\n\t\t\t\t\t}\n\t\t\t\t\treturn _.isFunction(value) ? value.call(object) : value;\n\t\t\t\t};\n\n\t\t\t\t// Generate a unique integer id (unique within the entire client session).\n\t\t\t\t// Useful for temporary DOM ids.\n\t\t\t\tvar idCounter = 0;\n\t\t\t\t_.uniqueId = function (prefix) {\n\t\t\t\t\tvar id = ++idCounter + '';\n\t\t\t\t\treturn prefix ? prefix + id : id;\n\t\t\t\t};\n\n\t\t\t\t// By default, Underscore uses ERB-style template delimiters, change the\n\t\t\t\t// following template settings to use alternative delimiters.\n\t\t\t\t_.templateSettings = {\n\t\t\t\t\tevaluate: /<%([\\s\\S]+?)%>/g,\n\t\t\t\t\tinterpolate: /<%=([\\s\\S]+?)%>/g,\n\t\t\t\t\tescape: /<%-([\\s\\S]+?)%>/g\n\t\t\t\t};\n\n\t\t\t\t// When customizing `templateSettings`, if you don't want to define an\n\t\t\t\t// interpolation, evaluation or escaping regex, we need one that is\n\t\t\t\t// guaranteed not to match.\n\t\t\t\tvar noMatch = /(.)^/;\n\n\t\t\t\t// Certain characters need to be escaped so that they can be put into a\n\t\t\t\t// string literal.\n\t\t\t\tvar escapes = {\n\t\t\t\t\t\"'\": \"'\",\n\t\t\t\t\t'\\\\': '\\\\',\n\t\t\t\t\t'\\r': 'r',\n\t\t\t\t\t'\\n': 'n',\n\t\t\t\t\t'\\u2028': 'u2028',\n\t\t\t\t\t'\\u2029': 'u2029'\n\t\t\t\t};\n\n\t\t\t\tvar escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n\t\t\t\tvar escapeChar = function escapeChar(match) {\n\t\t\t\t\treturn '\\\\' + escapes[match];\n\t\t\t\t};\n\n\t\t\t\t// JavaScript micro-templating, similar to John Resig's implementation.\n\t\t\t\t// Underscore templating handles arbitrary delimiters, preserves whitespace,\n\t\t\t\t// and correctly escapes quotes within interpolated code.\n\t\t\t\t// NB: `oldSettings` only exists for backwards compatibility.\n\t\t\t\t_.template = function (text, settings, oldSettings) {\n\t\t\t\t\tif (!settings && oldSettings) settings = oldSettings;\n\t\t\t\t\tsettings = _.defaults({}, settings, _.templateSettings);\n\n\t\t\t\t\t// Combine delimiters into one regular expression via alternation.\n\t\t\t\t\tvar matcher = RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join('|') + '|$', 'g');\n\n\t\t\t\t\t// Compile the template source, escaping string literals appropriately.\n\t\t\t\t\tvar index = 0;\n\t\t\t\t\tvar source = \"__p+='\";\n\t\t\t\t\ttext.replace(matcher, function (match, escape, interpolate, evaluate, offset) {\n\t\t\t\t\t\tsource += text.slice(index, offset).replace(escaper, escapeChar);\n\t\t\t\t\t\tindex = offset + match.length;\n\n\t\t\t\t\t\tif (escape) {\n\t\t\t\t\t\t\tsource += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n\t\t\t\t\t\t} else if (interpolate) {\n\t\t\t\t\t\t\tsource += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n\t\t\t\t\t\t} else if (evaluate) {\n\t\t\t\t\t\t\tsource += \"';\\n\" + evaluate + \"\\n__p+='\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Adobe VMs need the match returned to produce the correct offest.\n\t\t\t\t\t\treturn match;\n\t\t\t\t\t});\n\t\t\t\t\tsource += \"';\\n\";\n\n\t\t\t\t\t// If a variable is not specified, place data values in local scope.\n\t\t\t\t\tif (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n\t\t\t\t\tsource = \"var __t,__p='',__j=Array.prototype.join,\" + \"print=function(){__p+=__j.call(arguments,'');};\\n\" + source + 'return __p;\\n';\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar render = new Function(settings.variable || 'obj', '_', source);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\te.source = source;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar template = function template(data) {\n\t\t\t\t\t\treturn render.call(this, data, _);\n\t\t\t\t\t};\n\n\t\t\t\t\t// Provide the compiled source as a convenience for precompilation.\n\t\t\t\t\tvar argument = settings.variable || 'obj';\n\t\t\t\t\ttemplate.source = 'function(' + argument + '){\\n' + source + '}';\n\n\t\t\t\t\treturn template;\n\t\t\t\t};\n\n\t\t\t\t// Add a \"chain\" function. Start chaining a wrapped Underscore object.\n\t\t\t\t_.chain = function (obj) {\n\t\t\t\t\tvar instance = _(obj);\n\t\t\t\t\tinstance._chain = true;\n\t\t\t\t\treturn instance;\n\t\t\t\t};\n\n\t\t\t\t// OOP\n\t\t\t\t// ---------------\n\t\t\t\t// If Underscore is called as a function, it returns a wrapped object that\n\t\t\t\t// can be used OO-style. This wrapper holds altered versions of all the\n\t\t\t\t// underscore functions. Wrapped objects may be chained.\n\n\t\t\t\t// Helper function to continue chaining intermediate results.\n\t\t\t\tvar result = function result(instance, obj) {\n\t\t\t\t\treturn instance._chain ? _(obj).chain() : obj;\n\t\t\t\t};\n\n\t\t\t\t// Add your own custom functions to the Underscore object.\n\t\t\t\t_.mixin = function (obj) {\n\t\t\t\t\t_.each(_.functions(obj), function (name) {\n\t\t\t\t\t\tvar func = _[name] = obj[name];\n\t\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\t\tvar args = [this._wrapped];\n\t\t\t\t\t\t\tpush.apply(args, arguments);\n\t\t\t\t\t\t\treturn result(this, func.apply(_, args));\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Add all of the Underscore functions to the wrapper object.\n\t\t\t\t_.mixin(_);\n\n\t\t\t\t// Add all mutator Array functions to the wrapper.\n\t\t\t\t_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function (name) {\n\t\t\t\t\tvar method = ArrayProto[name];\n\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\tvar obj = this._wrapped;\n\t\t\t\t\t\tmethod.apply(obj, arguments);\n\t\t\t\t\t\tif ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n\t\t\t\t\t\treturn result(this, obj);\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Add all accessor Array functions to the wrapper.\n\t\t\t\t_.each(['concat', 'join', 'slice'], function (name) {\n\t\t\t\t\tvar method = ArrayProto[name];\n\t\t\t\t\t_.prototype[name] = function () {\n\t\t\t\t\t\treturn result(this, method.apply(this._wrapped, arguments));\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// Extracts the result from a wrapped and chained object.\n\t\t\t\t_.prototype.value = function () {\n\t\t\t\t\treturn this._wrapped;\n\t\t\t\t};\n\n\t\t\t\t// Provide unwrapping proxy for some methods used in engine operations\n\t\t\t\t// such as arithmetic and JSON stringification.\n\t\t\t\t_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n\t\t\t\t_.prototype.toString = function () {\n\t\t\t\t\treturn '' + this._wrapped;\n\t\t\t\t};\n\n\t\t\t\t// AMD registration happens at the end for compatibility with AMD loaders\n\t\t\t\t// that may not enforce next-turn semantics on modules. Even though general\n\t\t\t\t// practice for AMD registration is to be anonymous, underscore registers\n\t\t\t\t// as a named module because, like jQuery, it is a base library that is\n\t\t\t\t// popular enough to be bundled in a third party lib, but not be part of\n\t\t\t\t// an AMD load request. Those cases could generate an error when an\n\t\t\t\t// anonymous define() is called outside of a loader request.\n\t\t\t\tif (true) {\n\t\t\t\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\t\t\t\treturn _;\n\t\t\t\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t\t\t}\n\t\t\t}).call(this);\n\n\t\t\t/***/\n\t\t}])\n\t);\n});\n;"]} \ No newline at end of file diff --git a/sdk/dist/websdk-1.4.8.js b/sdk/dist/websdk-1.4.8.js deleted file mode 100644 index c95ff5dc..00000000 --- a/sdk/dist/websdk-1.4.8.js +++ /dev/null @@ -1,4512 +0,0 @@ -/******/ -(function (modules) { // webpackBootstrap - /******/ // The module cache - /******/ - var installedModules = {}; - - /******/ // The require function - /******/ - function __webpack_require__(moduleId) { - - /******/ // Check if module is in cache - /******/ - if (installedModules[moduleId]) - /******/ return installedModules[moduleId].exports; - - /******/ // Create a new module (and put it into the cache) - /******/ - var module = installedModules[moduleId] = { - /******/ exports: {}, - /******/ id: moduleId, - /******/ loaded: false - /******/ - }; - - /******/ // Execute the module function - /******/ - modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - - /******/ // Flag the module as loaded - /******/ - module.loaded = true; - - /******/ // Return the exports of the module - /******/ - return module.exports; - /******/ - } - - - /******/ // expose the modules object (__webpack_modules__) - /******/ - __webpack_require__.m = modules; - - /******/ // expose the module cache - /******/ - __webpack_require__.c = installedModules; - - /******/ // __webpack_public_path__ - /******/ - __webpack_require__.p = "./"; - - /******/ // Load entry module and return exports - /******/ - return __webpack_require__(0); - /******/ -}) -/************************************************************************/ -/******/({ - - /***/ 0: /***/ function (module, exports, __webpack_require__) { - - module.exports = __webpack_require__(230); - - - /***/ - }, - - /***/ 223: /***/ function (module, exports, __webpack_require__) { - - 'use strict'; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - ; - (function () { - - var EMPTYFN = function EMPTYFN() { - }; - var _code = __webpack_require__(224).code; - var WEBIM_FILESIZE_LIMIT = 10485760; - - var _createStandardXHR = function _createStandardXHR() { - try { - return new window.XMLHttpRequest(); - } catch (e) { - return false; - } - }; - - var _createActiveXHR = function _createActiveXHR() { - try { - return new window.ActiveXObject('Microsoft.XMLHTTP'); - } catch (e) { - return false; - } - }; - - var _xmlrequest = function _xmlrequest(crossDomain) { - crossDomain = crossDomain || true; - var temp = _createStandardXHR() || _createActiveXHR(); - - if ('withCredentials' in temp) { - return temp; - } - if (!crossDomain) { - return temp; - } - if (typeof window.XDomainRequest === 'undefined') { - return temp; - } - var xhr = new XDomainRequest(); - xhr.readyState = 0; - xhr.status = 100; - xhr.onreadystatechange = EMPTYFN; - xhr.onload = function () { - xhr.readyState = 4; - xhr.status = 200; - - var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); - xmlDoc.async = 'false'; - xmlDoc.loadXML(xhr.responseText); - xhr.responseXML = xmlDoc; - xhr.response = xhr.responseText; - xhr.onreadystatechange(); - }; - xhr.ontimeout = xhr.onerror = function () { - xhr.readyState = 4; - xhr.status = 500; - xhr.onreadystatechange(); - }; - return xhr; - }; - - var _hasFlash = function () { - if ('ActiveXObject' in window) { - try { - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); - } catch (ex) { - return 0; - } - } else { - if (navigator.plugins && navigator.plugins.length > 0) { - return navigator.plugins['Shockwave Flash']; - } - } - return 0; - }(); - - var _base64 = function _base64() { - - var self = this; - - // private property - var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - // public method for encoding - this.encode = function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; - input = self._utf8_encode(input); - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = (chr2 & 15) << 2 | chr3 >> 6; - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); - } - return output; - }; - - // public method for decoding - this.decode = function (input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i < input.length) { - enc1 = _keyStr.indexOf(input.charAt(i++)); - enc2 = _keyStr.indexOf(input.charAt(i++)); - enc3 = _keyStr.indexOf(input.charAt(i++)); - enc4 = _keyStr.indexOf(input.charAt(i++)); - chr1 = enc1 << 2 | enc2 >> 4; - chr2 = (enc2 & 15) << 4 | enc3 >> 2; - chr3 = (enc3 & 3) << 6 | enc4; - output = output + String.fromCharCode(chr1); - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - } - output = self._utf8_decode(output); - return output; - }; - - // private method for UTF-8 encoding - this._utf8_encode = function (string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - utftext += String.fromCharCode(c); - } else if (c > 127 && c < 2048) { - utftext += String.fromCharCode(c >> 6 | 192); - utftext += String.fromCharCode(c & 63 | 128); - } else { - utftext += String.fromCharCode(c >> 12 | 224); - utftext += String.fromCharCode(c >> 6 & 63 | 128); - utftext += String.fromCharCode(c & 63 | 128); - } - } - return utftext; - }; - - // private method for UTF-8 decoding - this._utf8_decode = function (utftext) { - var string = ""; - var i = 0; - var c = 0; - var c1 = 0; - var c2 = 0; - var c3 = 0; - while (i < utftext.length) { - c = utftext.charCodeAt(i); - if (c < 128) { - string += String.fromCharCode(c); - i++; - } else if (c > 191 && c < 224) { - c2 = utftext.charCodeAt(i + 1); - string += String.fromCharCode((c & 31) << 6 | c2 & 63); - i += 2; - } else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63); - i += 3; - } - } - return string; - }; - }; - - var _tmpUtilXHR = _xmlrequest(), - _hasFormData = typeof FormData !== 'undefined', - _hasBlob = typeof Blob !== 'undefined', - _isCanSetRequestHeader = _tmpUtilXHR.setRequestHeader || false, - _hasOverrideMimeType = _tmpUtilXHR.overrideMimeType || false, - _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData, - _isCanUploadFile = _isCanUploadFileAsync || _hasFlash, - _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType); - - if (!Object.keys) { - Object.keys = function () { - 'use strict'; - - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !{toString: null}.propertyIsEnumerable('toString'), - dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' && (typeof obj !== 'function' || obj === null)) { - throw new TypeError('Object.keys called on non-object'); - } - - var result = [], - prop, - i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - return result; - }; - }(); - } - - var utils = { - hasFormData: _hasFormData, - - hasBlob: _hasBlob, - - emptyfn: EMPTYFN, - - isCanSetRequestHeader: _isCanSetRequestHeader, - - hasOverrideMimeType: _hasOverrideMimeType, - - isCanUploadFileAsync: _isCanUploadFileAsync, - - isCanUploadFile: _isCanUploadFile, - - isCanDownLoadFile: _isCanDownLoadFile, - - isSupportWss: function () { - var notSupportList = [ - //1: QQ browser X5 core - /MQQBrowser[\/]5([.]\d+)?\sTBS/ - - //2: etc. - //... - ]; - - if (!window.WebSocket) { - return false; - } - - var ua = window.navigator.userAgent; - for (var i = 0, l = notSupportList.length; i < l; i++) { - if (notSupportList[i].test(ua)) { - return false; - } - } - return true; - }(), - - getIEVersion: function () { - var ua = navigator.userAgent, - matches, - tridentMap = {'4': 8, '5': 9, '6': 10, '7': 11}; - - matches = ua.match(/MSIE (\d+)/i); - - if (matches && matches[1]) { - return +matches[1]; - } - matches = ua.match(/Trident\/(\d+)/i); - if (matches && matches[1]) { - return tridentMap[matches[1]] || null; - } - return null; - }(), - - stringify: function stringify(json) { - if (typeof JSON !== 'undefined' && JSON.stringify) { - return JSON.stringify(json); - } else { - var s = '', - arr = []; - - var iterate = function iterate(json) { - var isArr = false; - - if (Object.prototype.toString.call(json) === '[object Array]') { - arr.push(']', '['); - isArr = true; - } else if (Object.prototype.toString.call(json) === '[object Object]') { - arr.push('}', '{'); - } - - for (var o in json) { - if (Object.prototype.toString.call(json[o]) === '[object Null]') { - json[o] = 'null'; - } else if (Object.prototype.toString.call(json[o]) === '[object Undefined]') { - json[o] = 'undefined'; - } - - if (json[o] && _typeof(json[o]) === 'object') { - s += ',' + (isArr ? '' : '"' + o + '":' + (isArr ? '"' : '')) + iterate(json[o]) + ''; - } else { - s += ',"' + (isArr ? '' : o + '":"') + json[o] + '"'; - } - } - - if (s != '') { - s = s.slice(1); - } - - return arr.pop() + s + arr.pop(); - }; - return iterate(json); - } - }, - login: function login(options) { - var options = options || {}; - var suc = options.success || EMPTYFN; - var err = options.error || EMPTYFN; - - var appKey = options.appKey || ''; - var devInfos = appKey.split('#'); - if (devInfos.length !== 2) { - err({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } - - var orgName = devInfos[0]; - var appName = devInfos[1]; - var https = https || options.https; - var user = options.user || ''; - var pwd = options.pwd || ''; - - var apiUrl = options.apiUrl; - - var loginJson = { - grant_type: 'password', - username: user, - password: pwd, - timestamp: +new Date() - }; - var loginfo = utils.stringify(loginJson); - - var options = { - url: apiUrl + '/' + orgName + '/' + appName + '/token', - dataType: 'json', - data: loginfo, - success: suc, - error: err - }; - return utils.ajax(options); - }, - - getFileUrl: function getFileUrl(fileInputId) { - var uri = { - url: '', - filename: '', - filetype: '', - data: '' - }; - - var fileObj = typeof fileInputId === 'string' ? document.getElementById(fileInputId) : fileInputId; - - if (!utils.isCanUploadFileAsync || !fileObj) { - return uri; - } - try { - if (window.URL.createObjectURL) { - var fileItems = fileObj.files; - if (fileItems.length > 0) { - var u = fileItems.item(0); - uri.data = u; - uri.url = window.URL.createObjectURL(u); - uri.filename = u.name || ''; - } - } else { - // IE - var u = document.getElementById(fileInputId).value; - uri.url = u; - var pos1 = u.lastIndexOf('/'); - var pos2 = u.lastIndexOf('\\'); - var pos = Math.max(pos1, pos2); - if (pos < 0) uri.filename = u; else uri.filename = u.substring(pos + 1); - } - var index = uri.filename.lastIndexOf('.'); - if (index != -1) { - uri.filetype = uri.filename.substring(index + 1).toLowerCase(); - } - return uri; - } catch (e) { - throw e; - } - }, - - getFileSize: function getFileSize(file) { - var fileSize = 0; - if (file) { - if (file.files) { - if (file.files.length > 0) { - fileSize = file.files[0].size; - } - } else if (file.select && 'ActiveXObject' in window) { - file.select(); - var fileobject = new ActiveXObject('Scripting.FileSystemObject'); - var file = fileobject.GetFile(file.value); - fileSize = file.Size; - } - } - console.log('fileSize: ', fileSize); - if (fileSize > 10000000) { - return false; - } - var kb = Math.round(fileSize / 1000); - if (kb < 1000) { - fileSize = kb + ' KB'; - } else if (kb >= 1000) { - var mb = kb / 1000; - if (mb < 1000) { - fileSize = mb.toFixed(1) + ' MB'; - } else { - var gb = mb / 1000; - fileSize = gb.toFixed(1) + ' GB'; - } - } - return fileSize; - }, - - hasFlash: _hasFlash, - - trim: function trim(str) { - - str = typeof str === 'string' ? str : ''; - - return str.trim ? str.trim() : str.replace(/^\s|\s$/g, ''); - }, - - parseEmoji: function parseEmoji(msg) { - if (typeof WebIM.Emoji === 'undefined' || typeof WebIM.Emoji.map === 'undefined') { - return msg; - } else { - var emoji = WebIM.Emoji, - reg = null; - - for (var face in emoji.map) { - if (emoji.map.hasOwnProperty(face)) { - while (msg.indexOf(face) > -1) { - msg = msg.replace(face, ''); - } - } - } - return msg; - } - }, - - parseLink: function parseLink(msg) { - - var reg = /(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-/=]*/gm; - - msg = msg.replace(reg, function (v) { - - var prefix = /^https?/gm.test(v); - - return "" + v + ""; - }); - - return msg; - }, - - parseJSON: function parseJSON(data) { - - if (window.JSON && window.JSON.parse) { - return window.JSON.parse(data + ''); - } - - var requireNonComma, - depth = null, - str = utils.trim(data + ''); - - return str && !utils.trim(str.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g, function (token, comma, open, close) { - - if (requireNonComma && comma) { - depth = 0; - } - - if (depth === 0) { - return token; - } - - requireNonComma = open || comma; - depth += !close - !open; - return ''; - })) ? Function('return ' + str)() : Function('Invalid JSON: ' + data)(); - }, - - parseUploadResponse: function parseUploadResponse(response) { - return response.indexOf('callback') > -1 ? //lte ie9 - response.slice(9, -1) : response; - }, - - parseDownloadResponse: function parseDownloadResponse(response) { - return response && response.type && response.type === 'application/json' || 0 > Object.prototype.toString.call(response).indexOf('Blob') ? this.url + '?token=' : window.URL.createObjectURL(response); - }, - - uploadFile: function uploadFile(options) { - var options = options || {}; - options.onFileUploadProgress = options.onFileUploadProgress || EMPTYFN; - options.onFileUploadComplete = options.onFileUploadComplete || EMPTYFN; - options.onFileUploadError = options.onFileUploadError || EMPTYFN; - options.onFileUploadCanceled = options.onFileUploadCanceled || EMPTYFN; - - var acc = options.accessToken || this.context.accessToken; - if (!acc) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_NO_LOGIN, - id: options.id - }); - return; - } - - var orgName, appName, devInfos; - var appKey = options.appKey || this.context.appKey || ''; - - if (appKey) { - devInfos = appKey.split('#'); - orgName = devInfos[0]; - appName = devInfos[1]; - } - - if (!orgName && !appName) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - id: options.id - }); - return; - } - - var apiUrl = options.apiUrl; - var uploadUrl = apiUrl + '/' + orgName + '/' + appName + '/chatfiles'; - - if (!utils.isCanUploadFileAsync) { - if (utils.hasFlash && typeof options.flashUpload === 'function') { - options.flashUpload && options.flashUpload(uploadUrl, options); - } else { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_BROWSER_ERROR, - id: options.id - }); - } - return; - } - - var fileSize = options.file.data ? options.file.data.size : undefined; - if (fileSize > WEBIM_FILESIZE_LIMIT) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - id: options.id - }); - return; - } else if (fileSize <= 0) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - id: options.id - }); - return; - } - - var xhr = utils.xmlrequest(); - var onError = function onError(e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - }; - if (xhr.upload) { - xhr.upload.addEventListener('progress', options.onFileUploadProgress, false); - } - if (xhr.addEventListener) { - xhr.addEventListener('abort', options.onFileUploadCanceled, false); - xhr.addEventListener('load', function (e) { - try { - var json = utils.parseJSON(xhr.responseText); - try { - options.onFileUploadComplete(json); - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, - data: e - }); - } - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - }, false); - xhr.addEventListener('error', onError, false); - } else if (xhr.onreadystatechange) { - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (ajax.status === 200) { - try { - var json = utils.parseJSON(xhr.responseText); - options.onFileUploadComplete(json); - } catch (e) { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - } else { - options.onFileUploadError({ - type: _code.WEBIM_UPLOADFILE_ERROR, - data: xhr.responseText, - id: options.id, - xhr: xhr - }); - } - } else { - xhr.abort(); - options.onFileUploadCanceled(); - } - }; - } - - xhr.open('POST', uploadUrl); - - xhr.setRequestHeader('restrict-access', 'true'); - xhr.setRequestHeader('Accept', '*/*'); // Android QQ browser has some problem with this attribute. - xhr.setRequestHeader('Authorization', 'Bearer ' + acc); - - var formData = new FormData(); - formData.append('file', options.file.data); - xhr.send(formData); - }, - - download: function download(options) { - options.onFileDownloadComplete = options.onFileDownloadComplete || EMPTYFN; - options.onFileDownloadError = options.onFileDownloadError || EMPTYFN; - - var accessToken = options.accessToken || this.context.accessToken; - if (!accessToken) { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_NO_LOGIN, - id: options.id - }); - return; - } - - var onError = function onError(e) { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - }; - - if (!utils.isCanDownLoadFile) { - options.onFileDownloadComplete(); - return; - } - var xhr = utils.xmlrequest(); - if ('addEventListener' in xhr) { - xhr.addEventListener('load', function (e) { - options.onFileDownloadComplete(xhr.response, xhr); - }, false); - xhr.addEventListener('error', onError, false); - } else if ('onreadystatechange' in xhr) { - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (ajax.status === 200) { - options.onFileDownloadComplete(xhr.response, xhr); - } else { - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - } - } else { - xhr.abort(); - options.onFileDownloadError({ - type: _code.WEBIM_DOWNLOADFILE_ERROR, - id: options.id, - xhr: xhr - }); - } - }; - } - - var method = options.method || 'GET'; - var resType = options.responseType || 'blob'; - var mimeType = options.mimeType || 'text/plain; charset=x-user-defined'; - xhr.open(method, options.url); - if (typeof Blob !== 'undefined') { - xhr.responseType = resType; - } else { - xhr.overrideMimeType(mimeType); - } - - var innerHeaer = { - 'X-Requested-With': 'XMLHttpRequest', - 'Accept': 'application/octet-stream', - 'share-secret': options.secret, - 'Authorization': 'Bearer ' + accessToken - }; - var headers = options.headers || {}; - for (var key in headers) { - innerHeaer[key] = headers[key]; - } - for (var key in innerHeaer) { - if (innerHeaer[key]) { - xhr.setRequestHeader(key, innerHeaer[key]); - } - } - xhr.send(null); - }, - - parseTextMessage: function parseTextMessage(message, faces) { - if (typeof message !== 'string') { - return; - } - - if (Object.prototype.toString.call(faces) !== '[object Object]') { - return { - isemoji: false, - body: [{ - type: 'txt', - data: message - }] - }; - } - - var receiveMsg = message; - var emessage = []; - var expr = /\[[^[\]]{2,3}\]/mg; - var emoji = receiveMsg.match(expr); - - if (!emoji || emoji.length < 1) { - return { - isemoji: false, - body: [{ - type: 'txt', - data: message - }] - }; - } - var isemoji = false; - for (var i = 0; i < emoji.length; i++) { - var tmsg = receiveMsg.substring(0, receiveMsg.indexOf(emoji[i])), - existEmoji = WebIM.Emoji.map[emoji[i]]; - - if (tmsg) { - emessage.push({ - type: 'txt', - data: tmsg - }); - } - if (!existEmoji) { - emessage.push({ - type: 'txt', - data: emoji[i] - }); - continue; - } - var emojiStr = WebIM.Emoji.map ? WebIM.Emoji.path + existEmoji : null; - - if (emojiStr) { - isemoji = true; - emessage.push({ - type: 'emoji', - data: emojiStr - }); - } else { - emessage.push({ - type: 'txt', - data: emoji[i] - }); - } - var restMsgIndex = receiveMsg.indexOf(emoji[i]) + emoji[i].length; - receiveMsg = receiveMsg.substring(restMsgIndex); - } - if (receiveMsg) { - emessage.push({ - type: 'txt', - data: receiveMsg - }); - } - if (isemoji) { - return { - isemoji: isemoji, - body: emessage - }; - } - return { - isemoji: false, - body: [{ - type: 'txt', - data: message - }] - }; - }, - - xmlrequest: _xmlrequest, - - getXmlFirstChild: function getXmlFirstChild(data, tagName) { - var children = data.getElementsByTagName(tagName); - if (children.length == 0) { - return null; - } else { - return children[0]; - } - }, - ajax: function ajax(options) { - var dataType = options.dataType || 'text'; - var suc = options.success || EMPTYFN; - var error = options.error || EMPTYFN; - var xhr = utils.xmlrequest(); - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - var status = xhr.status || 0; - if (status === 200) { - try { - switch (dataType) { - case 'text': - suc(xhr.responseText); - return; - case 'json': - var json = utils.parseJSON(xhr.responseText); - suc(json, xhr); - return; - case 'xml': - if (xhr.responseXML && xhr.responseXML.documentElement) { - suc(xhr.responseXML.documentElement, xhr); - } else { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - } - return; - } - suc(xhr.response || xhr.responseText, xhr); - } catch (e) { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: e - }); - } - return; - } else { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - return; - } - } - if (xhr.readyState === 0) { - error({ - type: _code.WEBIM_CONNCTION_AJAX_ERROR, - data: xhr.responseText - }); - } - }; - - if (options.responseType) { - if (xhr.responseType) { - xhr.responseType = options.responseType; - } - } - if (options.mimeType) { - if (utils.hasOverrideMimeType) { - xhr.overrideMimeType(options.mimeType); - } - } - - var type = options.type || 'POST', - data = options.data || null, - tempData = ''; - - if (type.toLowerCase() === 'get' && data) { - for (var o in data) { - if (data.hasOwnProperty(o)) { - tempData += o + '=' + data[o] + '&'; - } - } - tempData = tempData ? tempData.slice(0, -1) : tempData; - options.url += (options.url.indexOf('?') > 0 ? '&' : '?') + (tempData ? tempData + '&' : tempData) + '_v=' + new Date().getTime(); - data = null; - tempData = null; - } - xhr.open(type, options.url); - - if (utils.isCanSetRequestHeader) { - var headers = options.headers || {}; - for (var key in headers) { - if (headers.hasOwnProperty(key)) { - xhr.setRequestHeader(key, headers[key]); - } - } - } - - xhr.send(data); - return xhr; - }, - ts: function ts() { - var d = new Date(); - var Hours = d.getHours(); //获取当前小时数(0-23) - var Minutes = d.getMinutes(); //获取当前分钟数(0-59) - var Seconds = d.getSeconds(); //获取当前秒数(0-59) - var Milliseconds = d.getMilliseconds(); //获取当前毫秒 - return (Hours < 10 ? "0" + Hours : Hours) + ':' + (Minutes < 10 ? "0" + Minutes : Minutes) + ':' + (Seconds < 10 ? "0" + Seconds : Seconds) + ':' + Milliseconds + ' '; - }, - - getObjectKey: function getObjectKey(obj, val) { - for (var key in obj) { - if (obj[key] == val) { - return key; - } - } - return ''; - }, - - sprintf: function sprintf() { - var arg = arguments, - str = arg[0] || '', - i, - len; - for (i = 1, len = arg.length; i < len; i++) { - str = str.replace(/%s/, arg[i]); - } - return str; - }, - - encrypt: function encrypt(str) { - var base64 = new _base64(); - var encrypt = base64.encode(str); - return encrypt; - }, - - decrypt: function decrypt(str) { - var base64 = new _base64(); - var decrypt = base64.decode(str); - decrypt = escape(decrypt); - decrypt = decrypt.replace(/%00/g, ''); - decrypt = unescape(decrypt); - return decrypt; - }, - - setCookie: function setCookie(name, value, days) { - var cookie = name + '=' + encodeURIComponent(value); - if (typeof days == 'number') { - cookie += '; max-age: ' + days * 60 * 60 * 24; - } - document.cookie = cookie; - }, - - getCookie: function getCookie() { - var allCookie = {}; - var all = document.cookie; - if (all === "") { - return allCookie; - } - var list = all.split("; "); - for (var i = 0; i < list.length; i++) { - var cookie = list[i]; - var p = cookie.indexOf('='); - var name = cookie.substring(0, p); - var value = cookie.substring(p + 1); - value = decodeURIComponent(value); - allCookie[name] = value; - } - return allCookie; - } - }; - - exports.utils = utils; - })(); - - /***/ - }, - - /***/ 224: /***/ function (module, exports) { - - "use strict"; - - ; - (function () { - - exports.code = { - WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR: 0, - WEBIM_CONNCTION_OPEN_ERROR: 1, - WEBIM_CONNCTION_AUTH_ERROR: 2, - WEBIM_CONNCTION_OPEN_USERGRID_ERROR: 3, - WEBIM_CONNCTION_ATTACH_ERROR: 4, - WEBIM_CONNCTION_ATTACH_USERGRID_ERROR: 5, - WEBIM_CONNCTION_REOPEN_ERROR: 6, - WEBIM_CONNCTION_SERVER_CLOSE_ERROR: 7, //7: client-side network offline (net::ERR_INTERNET_DISCONNECTED) - WEBIM_CONNCTION_SERVER_ERROR: 8, //8: offline by multi login - WEBIM_CONNCTION_IQ_ERROR: 9, - - WEBIM_CONNCTION_PING_ERROR: 10, - WEBIM_CONNCTION_NOTIFYVERSION_ERROR: 11, - WEBIM_CONNCTION_GETROSTER_ERROR: 12, - WEBIM_CONNCTION_CROSSDOMAIN_ERROR: 13, - WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES: 14, - WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR: 15, - WEBIM_CONNCTION_DISCONNECTED: 16, //16: server-side close the websocket connection - WEBIM_CONNCTION_AJAX_ERROR: 17, - WEBIM_CONNCTION_JOINROOM_ERROR: 18, - WEBIM_CONNCTION_GETROOM_ERROR: 19, - - WEBIM_CONNCTION_GETROOMINFO_ERROR: 20, - WEBIM_CONNCTION_GETROOMMEMBER_ERROR: 21, - WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR: 22, - WEBIM_CONNCTION_LOAD_CHATROOM_ERROR: 23, - WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR: 24, - WEBIM_CONNCTION_JOINCHATROOM_ERROR: 25, - WEBIM_CONNCTION_QUITCHATROOM_ERROR: 26, - WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR: 27, - WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR: 28, - WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR: 29, - - WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR: 30, - WEBIM_CONNCTION_CALLBACK_INNER_ERROR: 31, - WEBIM_CONNCTION_CLIENT_OFFLINE: 32, //32: client offline - WEBIM_CONNCTION_CLIENT_LOGOUT: 33, //33: client logout - WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR: 34, // Over amount of the tabs a user opened in the same browser - WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP: 35, - WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP: 36, - WEBIM_CONNECTION_ACCEPT_JOIN_GROUP: 37, - WEBIM_CONNECTION_DECLINE_JOIN_GROUP: 38, - WEBIM_CONNECTION_CLOSED: 39, - - WEBIM_UPLOADFILE_BROWSER_ERROR: 100, - WEBIM_UPLOADFILE_ERROR: 101, - WEBIM_UPLOADFILE_NO_LOGIN: 102, - WEBIM_UPLOADFILE_NO_FILE: 103, - - WEBIM_DOWNLOADFILE_ERROR: 200, - WEBIM_DOWNLOADFILE_NO_LOGIN: 201, - WEBIM_DOWNLOADFILE_BROWSER_ERROR: 202, - - WEBIM_MESSAGE_REC_TEXT: 300, - WEBIM_MESSAGE_REC_TEXT_ERROR: 301, - WEBIM_MESSAGE_REC_EMOTION: 302, - WEBIM_MESSAGE_REC_PHOTO: 303, - WEBIM_MESSAGE_REC_AUDIO: 304, - WEBIM_MESSAGE_REC_AUDIO_FILE: 305, - WEBIM_MESSAGE_REC_VEDIO: 306, - WEBIM_MESSAGE_REC_VEDIO_FILE: 307, - WEBIM_MESSAGE_REC_FILE: 308, - WEBIM_MESSAGE_SED_TEXT: 309, - WEBIM_MESSAGE_SED_EMOTION: 310, - WEBIM_MESSAGE_SED_PHOTO: 311, - WEBIM_MESSAGE_SED_AUDIO: 312, - WEBIM_MESSAGE_SED_AUDIO_FILE: 313, - WEBIM_MESSAGE_SED_VEDIO: 314, - WEBIM_MESSAGE_SED_VEDIO_FILE: 315, - WEBIM_MESSAGE_SED_FILE: 316, - WEBIM_MESSAGE_SED_ERROR: 317, - - STATUS_INIT: 400, - STATUS_DOLOGIN_USERGRID: 401, - STATUS_DOLOGIN_IM: 402, - STATUS_OPENED: 403, - STATUS_CLOSING: 404, - STATUS_CLOSED: 405, - STATUS_ERROR: 406 - }; - })(); - - /***/ - }, - - /***/ 230: /***/ function (module, exports, __webpack_require__) { - - 'use strict'; - - module.exports = __webpack_require__(231); - - /***/ - }, - - /***/ 231: /***/ function (module, exports, __webpack_require__) { - - 'use strict'; - - var _version = '1.4.2'; - var _code = __webpack_require__(224).code; - var _utils = __webpack_require__(223).utils; - var _msg = __webpack_require__(232); - var _message = _msg._msg; - var _msgHash = {}; - var Queue = __webpack_require__(233).Queue; - - window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; - - if (window.XDomainRequest) { - XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send; - XDomainRequest.prototype.send = function () { - XDomainRequest.prototype.oldsend.apply(this, arguments); - this.readyState = 2; - }; - } - - Strophe.Request.prototype._newXHR = function () { - var xhr = _utils.xmlrequest(true); - if (xhr.overrideMimeType) { - xhr.overrideMimeType('text/xml'); - } - // use Function.bind() to prepend ourselves as an argument - xhr.onreadystatechange = this.func.bind(null, this); - return xhr; - }; - - Strophe.Websocket.prototype._closeSocket = function () { - if (this.socket) { - var me = this; - setTimeout(function () { - try { - me.socket.close(); - } catch (e) { - } - }, 0); - } else { - this.socket = null; - } - }; - - /** - * - * Strophe.Websocket has a bug while logout: - * 1.send: is ok; - * 2.send: will cause a problem,log as follows: - * WebSocket connection to 'ws://im-api.easemob.com/ws/' failed: Data frame received after close_connect @ strophe.js:5292connect @ strophe.js:2491_login @ websdk-1.1.2.js:278suc @ websdk-1.1.2.js:636xhr.onreadystatechange @ websdk-1.1.2.js:2582 - * 3 "Websocket error [object Event]" - * _changeConnectStatus - * onError Object {type: 7, msg: "The WebSocket connection could not be established or was disconnected.", reconnect: true} - * - * this will trigger socket.onError, therefore _doDisconnect again. - * Fix it by overide _onMessage - */ - Strophe.Websocket.prototype._onMessage = function (message) { - WebIM && WebIM.config.isDebug && console.log(WebIM.utils.ts() + 'recv:', message.data); - var elem, data; - // check for closing stream - // var close = ''; - // if (message.data === close) { - // this._conn.rawInput(close); - // this._conn.xmlInput(message); - // if (!this._conn.disconnecting) { - // this._conn._doDisconnect(); - // } - // return; - // - // send and receive close xml: - // so we can't judge whether message.data equals close by === simply. - if (message.data.indexOf(" from server"); - // } - } - return; - } else if (message.data.search(" tag before we close the connection - return; - } - this._conn._dataRecv(elem, message.data); - }; - - var _listenNetwork = function _listenNetwork(onlineCallback, offlineCallback) { - - if (window.addEventListener) { - window.addEventListener('online', onlineCallback); - window.addEventListener('offline', offlineCallback); - } else if (window.attachEvent) { - if (document.body) { - document.body.attachEvent('ononline', onlineCallback); - document.body.attachEvent('onoffline', offlineCallback); - } else { - window.attachEvent('load', function () { - document.body.attachEvent('ononline', onlineCallback); - document.body.attachEvent('onoffline', offlineCallback); - }); - } - } else { - /*var onlineTmp = window.ononline; - var offlineTmp = window.onoffline; - window.attachEvent('ononline', function () { - try { - typeof onlineTmp === 'function' && onlineTmp(); - } catch ( e ) {} - onlineCallback(); - }); - window.attachEvent('onoffline', function () { - try { - typeof offlineTmp === 'function' && offlineTmp(); - } catch ( e ) {} - offlineCallback(); - });*/ - } - }; - - var _parseRoom = function _parseRoom(result) { - var rooms = []; - var items = result.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var roomJid = item.getAttribute('jid'); - var tmp = roomJid.split('@')[0]; - var room = { - jid: roomJid, - name: item.getAttribute('name'), - roomId: tmp.split('_')[1] - }; - rooms.push(room); - } - } - return rooms; - }; - - var _parseRoomOccupants = function _parseRoomOccupants(result) { - var occupants = []; - var items = result.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var room = { - jid: item.getAttribute('jid'), - name: item.getAttribute('name') - }; - occupants.push(room); - } - } - return occupants; - }; - - var _parseResponseMessage = function _parseResponseMessage(msginfo) { - var parseMsgData = {errorMsg: true, data: []}; - - var msgBodies = msginfo.getElementsByTagName('body'); - if (msgBodies) { - for (var i = 0; i < msgBodies.length; i++) { - var msgBody = msgBodies[i]; - var childNodes = msgBody.childNodes; - if (childNodes && childNodes.length > 0) { - var childNode = msgBody.childNodes[0]; - if (childNode.nodeType == Strophe.ElementType.TEXT) { - var jsondata = childNode.wholeText || childNode.nodeValue; - jsondata = jsondata.replace('\n', '
'); - try { - var data = eval('(' + jsondata + ')'); - parseMsgData.errorMsg = false; - parseMsgData.data = [data]; - } catch (e) { - } - } - } - } - - var delayTags = msginfo.getElementsByTagName('delay'); - if (delayTags && delayTags.length > 0) { - var delayTag = delayTags[0]; - var delayMsgTime = delayTag.getAttribute('stamp'); - if (delayMsgTime) { - parseMsgData.delayTimeStamp = delayMsgTime; - } - } - } else { - var childrens = msginfo.childNodes; - if (childrens && childrens.length > 0) { - var child = msginfo.childNodes[0]; - if (child.nodeType == Strophe.ElementType.TEXT) { - try { - var data = eval('(' + child.nodeValue + ')'); - parseMsgData.errorMsg = false; - parseMsgData.data = [data]; - } catch (e) { - } - } - } - } - return parseMsgData; - }; - - var _parseNameFromJidFn = function _parseNameFromJidFn(jid, domain) { - domain = domain || ''; - var tempstr = jid; - var findex = tempstr.indexOf('_'); - - if (findex !== -1) { - tempstr = tempstr.substring(findex + 1); - } - var atindex = tempstr.indexOf('@' + domain); - if (atindex !== -1) { - tempstr = tempstr.substring(0, atindex); - } - return tempstr; - }; - - var _parseFriend = function _parseFriend(queryTag, conn, from) { - var rouster = []; - var items = queryTag.getElementsByTagName('item'); - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('jid'); - if (!jid) { - continue; - } - var subscription = item.getAttribute('subscription'); - var friend = { - subscription: subscription, - jid: jid - }; - var ask = item.getAttribute('ask'); - if (ask) { - friend.ask = ask; - } - var name = item.getAttribute('name'); - if (name) { - friend.name = name; - } else { - var n = _parseNameFromJidFn(jid); - friend.name = n; - } - var groups = []; - Strophe.forEachChild(item, 'group', function (group) { - groups.push(Strophe.getText(group)); - }); - friend.groups = groups; - rouster.push(friend); - // B同意之后 -> B订阅A - if (conn && subscription == 'from') { - conn.subscribe({ - toJid: jid - }); - } - - if (conn && subscription == 'to') { - conn.subscribed({ - toJid: jid - }); - } - } - } - return rouster; - }; - - var _login = function _login(options, conn) { - var accessToken = options.access_token || ''; - if (accessToken == '') { - var loginfo = _utils.stringify(options); - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, - data: options - }); - return; - } - conn.context.accessToken = options.access_token; - conn.context.accessTokenExpires = options.expires_in; - var stropheConn = null; - if (conn.isOpening() && conn.context.stropheConn) { - stropheConn = conn.context.stropheConn; - } else if (conn.isOpened() && conn.context.stropheConn) { - // return; - stropheConn = conn.getStrophe(); - } else { - stropheConn = conn.getStrophe(); - } - var callback = function callback(status, msg) { - _loginCallback(status, msg, conn); - }; - - conn.context.stropheConn = stropheConn; - if (conn.route) { - stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold, conn.route); - } else { - stropheConn.connect(conn.context.jid, '$t$' + accessToken, callback, conn.wait, conn.hold); - } - }; - - var _parseMessageType = function _parseMessageType(msginfo) { - var msgtype = 'normal'; - var receiveinfo = msginfo.getElementsByTagName('received'); - if (receiveinfo && receiveinfo.length > 0 && receiveinfo[0].namespaceURI === 'urn:xmpp:receipts') { - msgtype = 'received'; - } else { - var inviteinfo = msginfo.getElementsByTagName('invite'); - if (inviteinfo && inviteinfo.length > 0) { - msgtype = 'invite'; - } - } - return msgtype; - }; - - var _handleMessageQueue = function _handleMessageQueue(conn) { - for (var i in _msgHash) { - if (_msgHash.hasOwnProperty(i)) { - _msgHash[i].send(conn); - } - } - }; - - var _loginCallback = function _loginCallback(status, msg, conn) { - var conflict, error; - - if (msg === 'conflict') { - conflict = true; - } - - if (status == Strophe.Status.CONNFAIL) { - //client offline, ping/pong timeout, server quit, server offline - error = { - type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, - msg: msg, - reconnect: true - }; - - conflict && (error.conflict = true); - conn.onError(error); - } else if (status == Strophe.Status.ATTACHED || status == Strophe.Status.CONNECTED) { - // client should limit the speed of sending ack messages up to 5/s - conn.autoReconnectNumTotal = 0; - conn.intervalId = setInterval(function () { - conn.handelSendQueue(); - }, 200); - var handleMessage = function handleMessage(msginfo) { - var type = _parseMessageType(msginfo); - - if ('received' === type) { - conn.handleReceivedMessage(msginfo); - return true; - } else if ('invite' === type) { - conn.handleInviteMessage(msginfo); - return true; - } else { - conn.handleMessage(msginfo); - return true; - } - }; - var handlePresence = function handlePresence(msginfo) { - conn.handlePresence(msginfo); - return true; - }; - var handlePing = function handlePing(msginfo) { - conn.handlePing(msginfo); - return true; - }; - var handleIqRoster = function handleIqRoster(msginfo) { - conn.handleIqRoster(msginfo); - return true; - }; - var handleIqPrivacy = function handleIqPrivacy(msginfo) { - conn.handleIqPrivacy(msginfo); - return true; - }; - var handleIq = function handleIq(msginfo) { - conn.handleIq(msginfo); - return true; - }; - - conn.addHandler(handleMessage, null, 'message', null, null, null); - conn.addHandler(handlePresence, null, 'presence', null, null, null); - conn.addHandler(handlePing, 'urn:xmpp:ping', 'iq', 'get', null, null); - conn.addHandler(handleIqRoster, 'jabber:iq:roster', 'iq', 'set', null, null); - conn.addHandler(handleIqPrivacy, 'jabber:iq:privacy', 'iq', 'set', null, null); - conn.addHandler(handleIq, null, 'iq', null, null, null); - - conn.context.status = _code.STATUS_OPENED; - - var supportRecMessage = [_code.WEBIM_MESSAGE_REC_TEXT, _code.WEBIM_MESSAGE_REC_EMOJI]; - - if (_utils.isCanDownLoadFile) { - supportRecMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); - supportRecMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); - } - var supportSedMessage = [_code.WEBIM_MESSAGE_SED_TEXT]; - if (_utils.isCanUploadFile) { - supportSedMessage.push(_code.WEBIM_MESSAGE_REC_PHOTO); - supportSedMessage.push(_code.WEBIM_MESSAGE_REC_AUDIO_FILE); - } - conn.notifyVersion(); - conn.retry && _handleMessageQueue(conn); - conn.heartBeat(); - conn.isAutoLogin && conn.setPresence(); - conn.onOpened({ - canReceive: supportRecMessage, - canSend: supportSedMessage, - accessToken: conn.context.accessToken - }); - } else if (status == Strophe.Status.DISCONNECTING) { - if (conn.isOpened()) { - conn.stopHeartBeat(); - conn.context.status = _code.STATUS_CLOSING; - - error = { - type: _code.WEBIM_CONNCTION_SERVER_CLOSE_ERROR, - msg: msg, - reconnect: true - }; - - conflict && (error.conflict = true); - conn.onError(error); - } - } else if (status == Strophe.Status.DISCONNECTED) { - if (conn.isOpened()) { - if (conn.autoReconnectNumTotal < conn.autoReconnectNumMax) { - conn.reconnect(); - return; - } else { - error = { - type: _code.WEBIM_CONNCTION_DISCONNECTED - }; - conn.onError(error); - } - } - conn.context.status = _code.STATUS_CLOSED; - conn.clear(); - conn.onClosed(); - } else if (status == Strophe.Status.AUTHFAIL) { - error = { - type: _code.WEBIM_CONNCTION_AUTH_ERROR - }; - - conflict && (error.conflict = true); - conn.onError(error); - conn.clear(); - } else if (status == Strophe.Status.ERROR) { - conn.context.status = _code.STATUS_ERROR; - error = { - type: _code.WEBIM_CONNCTION_SERVER_ERROR - }; - - conflict && (error.conflict = true); - conn.onError(error); - } - conn.context.status_now = status; - }; - - var _getJid = function _getJid(options, conn) { - var jid = options.toJid || ''; - - if (jid === '') { - var appKey = conn.context.appKey || ''; - var toJid = appKey + '_' + options.to + '@' + conn.domain; - - if (options.resource) { - toJid = toJid + '/' + options.resource; - } - jid = toJid; - } - return jid; - }; - - var _getJidByName = function _getJidByName(name, conn) { - var options = { - to: name - }; - return _getJid(options, conn); - }; - - var _validCheck = function _validCheck(options, conn) { - options = options || {}; - - if (options.user == '') { - conn.onError({ - type: _code.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR - }); - return false; - } - - var user = options.user + '' || ''; - var appKey = options.appKey || ''; - var devInfos = appKey.split('#'); - - if (devInfos.length !== 2) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } - var orgName = devInfos[0]; - var appName = devInfos[1]; - - if (!orgName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } - if (!appName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return false; - } - - var jid = appKey + '_' + user.toLowerCase() + '@' + conn.domain, - resource = options.resource || 'webim'; - - if (conn.isMultiLoginSessions) { - resource += user + new Date().getTime() + Math.floor(Math.random().toFixed(6) * 1000000); - } - conn.context.jid = jid + '/' + resource; - /*jid: {appkey}_{username}@domain/resource*/ - conn.context.userId = user; - conn.context.appKey = appKey; - conn.context.appName = appName; - conn.context.orgName = orgName; - - return true; - }; - - var _getXmppUrl = function _getXmppUrl(baseUrl, https) { - if (/^(ws|http)s?:\/\/?/.test(baseUrl)) { - return baseUrl; - } - - var url = { - prefix: 'http', - base: '://' + baseUrl, - suffix: '/http-bind/' - }; - - if (https && _utils.isSupportWss) { - url.prefix = 'wss'; - url.suffix = '/ws/'; - } else { - if (https) { - url.prefix = 'https'; - } else if (window.WebSocket) { - url.prefix = 'ws'; - url.suffix = '/ws/'; - } - } - - return url.prefix + url.base + url.suffix; - }; - - //class - var connection = function connection(options) { - if (!this instanceof connection) { - return new connection(options); - } - - var options = options || {}; - - this.isHttpDNS = options.isHttpDNS || false; - this.isMultiLoginSessions = options.isMultiLoginSessions || false; - this.wait = options.wait || 30; - this.retry = options.retry || false; - this.https = options.https || location.protocol === 'https:'; - this.url = _getXmppUrl(options.url, this.https); - this.hold = options.hold || 1; - this.route = options.route || null; - this.domain = options.domain || 'easemob.com'; - this.inactivity = options.inactivity || 30; - this.heartBeatWait = options.heartBeatWait || 4500; - this.maxRetries = options.maxRetries || 5; - this.isAutoLogin = options.isAutoLogin === false ? false : true; - this.pollingTime = options.pollingTime || 800; - this.stropheConn = false; - this.autoReconnectNumMax = options.autoReconnectNumMax || 0; - this.autoReconnectNumTotal = 0; - this.autoReconnectInterval = options.autoReconnectInterval || 0; - this.context = {status: _code.STATUS_INIT}; - this.sendQueue = new Queue(); //instead of sending message immediately,cache them in this queue - this.intervalId = null; //clearInterval return value - this.apiUrl = options.apiUrl || ''; - this.isWindowSDK = options.isWindowSDK || false; - - this.dnsArr = ['https://rs.easemob.com', 'https://rsbak.easemob.com', 'http://182.92.174.78', 'http://112.126.66.111']; //http dns server hosts - this.dnsIndex = 0; //the dns ip used in dnsArr currently - this.dnsTotal = this.dnsArr.length; //max number of getting dns retries - this.restHosts = null; //rest server ips - this.restIndex = 0; //the rest ip used in restHosts currently - this.restTotal = 0; //max number of getting rest token retries - this.xmppHosts = null; //xmpp server ips - this.xmppIndex = 0; //the xmpp ip used in xmppHosts currently - this.xmppTotal = 0; //max number of creating xmpp server connection(ws/bosh) retries - - this.groupOption = {}; - }; - - connection.prototype.registerUser = function (options) { - if (location.protocol != 'https:' && this.isHttpDNS) { - this.dnsIndex = 0; - this.getHttpDNS(options, 'signup'); - } else { - this.signup(options); - } - }; - - connection.prototype.handelSendQueue = function () { - var options = this.sendQueue.pop(); - if (options !== null) { - this.sendReceiptsMessage(options); - } - }; - connection.prototype.listen = function (options) { - this.onOpened = options.onOpened || _utils.emptyfn; - this.onClosed = options.onClosed || _utils.emptyfn; - this.onTextMessage = options.onTextMessage || _utils.emptyfn; - this.onEmojiMessage = options.onEmojiMessage || _utils.emptyfn; - this.onPictureMessage = options.onPictureMessage || _utils.emptyfn; - this.onAudioMessage = options.onAudioMessage || _utils.emptyfn; - this.onVideoMessage = options.onVideoMessage || _utils.emptyfn; - this.onFileMessage = options.onFileMessage || _utils.emptyfn; - this.onLocationMessage = options.onLocationMessage || _utils.emptyfn; - this.onCmdMessage = options.onCmdMessage || _utils.emptyfn; - this.onPresence = options.onPresence || _utils.emptyfn; - this.onRoster = options.onRoster || _utils.emptyfn; - this.onError = options.onError || _utils.emptyfn; - this.onReceivedMessage = options.onReceivedMessage || _utils.emptyfn; - this.onInviteMessage = options.onInviteMessage || _utils.emptyfn; - this.onOffline = options.onOffline || _utils.emptyfn; - this.onOnline = options.onOnline || _utils.emptyfn; - this.onConfirmPop = options.onConfirmPop || _utils.emptyfn; - //for WindowSDK start - this.onUpdateMyGroupList = options.onUpdateMyGroupList || _utils.emptyfn; - this.onUpdateMyRoster = options.onUpdateMyRoster || _utils.emptyfn; - //for WindowSDK end - this.onBlacklistUpdate = options.onBlacklistUpdate || _utils.emptyfn; - - _listenNetwork(this.onOnline, this.onOffline); - }; - - connection.prototype.heartBeat = function () { - var me = this; - //IE8: strophe auto switch from ws to BOSH, need heartbeat - var isNeed = !/^ws|wss/.test(me.url) || /mobile/.test(navigator.userAgent); - - if (this.heartBeatID || !isNeed) { - return; - } - - var options = { - toJid: this.domain, - type: 'normal' - }; - this.heartBeatID = setInterval(function () { - me.ping(options); - }, this.heartBeatWait); - }; - - connection.prototype.stopHeartBeat = function () { - if (typeof this.heartBeatID == "number") { - this.heartBeatID = clearInterval(this.heartBeatID); - } - }; - - connection.prototype.sendReceiptsMessage = function (options) { - var dom = $msg({ - from: this.context.jid || '', - to: this.domain, - id: options.id || '' - }).c('received', { - xmlns: 'urn:xmpp:receipts', - id: options.id || '' - }); - this.sendCommand(dom.tree()); - }; - - connection.prototype.cacheReceiptsMessage = function (options) { - this.sendQueue.push(options); - }; - - connection.prototype.getStrophe = function () { - if (location.protocol != 'https:' && this.isHttpDNS) { - //TODO: try this.xmppTotal times on fail - var url = ''; - var host = this.xmppHosts[this.xmppIndex]; - var domain = _utils.getXmlFirstChild(host, 'domain'); - var ip = _utils.getXmlFirstChild(host, 'ip'); - if (ip) { - url = ip.textContent; - var port = _utils.getXmlFirstChild(host, 'port'); - if (port.textContent != '80') { - url += ':' + port.textContent; - } - } else { - url = domain.textContent; - } - - if (url != '') { - var parter = /(.+\/\/).+(\/.+)/; - this.url = this.url.replace(parter, "$1" + url + "$2"); - } - } - - var stropheConn = new Strophe.Connection(this.url, { - inactivity: this.inactivity, - maxRetries: this.maxRetries, - pollingTime: this.pollingTime - }); - return stropheConn; - }; - connection.prototype.getHostsByTag = function (data, tagName) { - var tag = _utils.getXmlFirstChild(data, tagName); - if (!tag) { - console.log(tagName + ' hosts error'); - return null; - } - var hosts = tag.getElementsByTagName('hosts'); - if (hosts.length == 0) { - console.log(tagName + ' hosts error2'); - return null; - } - return hosts[0].getElementsByTagName('host'); - }; - connection.prototype.getRestFromHttpDNS = function (options, type) { - if (this.restIndex > this.restTotal) { - console.log('rest hosts all tried,quit'); - return; - } - var url = ''; - var host = this.restHosts[this.restIndex]; - var domain = _utils.getXmlFirstChild(host, 'domain'); - var ip = _utils.getXmlFirstChild(host, 'ip'); - if (ip) { - var port = _utils.getXmlFirstChild(host, 'port'); - url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + ip.textContent + ':' + port.textContent; - } else { - url = (location.protocol === 'https:' ? 'https:' : 'http:') + '//' + domain.textContent; - } - - if (url != '') { - this.apiUrl = url; - options.apiUrl = url; - } - - if (type == 'login') { - this.login(options); - } else { - this.signup(options); - } - }; - - connection.prototype.getHttpDNS = function (options, type) { - if (this.restHosts) { - this.getRestFromHttpDNS(options, type); - return; - } - var self = this; - var suc = function suc(data, xhr) { - data = new DOMParser().parseFromString(data, "text/xml").documentElement; - //get rest ips - var restHosts = self.getHostsByTag(data, 'rest'); - if (!restHosts) { - console.log('rest hosts error3'); - return; - } - self.restHosts = restHosts; - self.restTotal = restHosts.length; - - //get xmpp ips - var xmppHosts = self.getHostsByTag(data, 'xmpp'); - if (!xmppHosts) { - console.log('xmpp hosts error3'); - return; - } - self.xmppHosts = xmppHosts; - self.xmppTotal = xmppHosts.length; - - self.getRestFromHttpDNS(options, type); - }; - var error = function error(res, xhr, msg) { - - console.log('getHttpDNS error', res, msg); - self.dnsIndex++; - if (self.dnsIndex < self.dnsTotal) { - self.getHttpDNS(options, type); - } - }; - var options2 = { - url: this.dnsArr[this.dnsIndex] + '/easemob/server.xml', - dataType: 'text', - type: 'GET', - - // url: 'http://www.easemob.com/easemob/server.xml', - // dataType: 'xml', - data: {app_key: encodeURIComponent(options.appKey)}, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn - }; - _utils.ajax(options2); - }; - - connection.prototype.signup = function (options) { - var self = this; - var orgName = options.orgName || ''; - var appName = options.appName || ''; - var appKey = options.appKey || ''; - var suc = options.success || EMPTYFN; - var err = options.error || EMPTYFN; - - if (!orgName && !appName && appKey) { - var devInfos = appKey.split('#'); - if (devInfos.length === 2) { - orgName = devInfos[0]; - appName = devInfos[1]; - } - } - if (!orgName && !appName) { - err({ - type: _code.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR - }); - return; - } - - var error = function error(res, xhr, msg) { - if (location.protocol != 'https:' && self.isHttpDNS) { - if (self.restIndex + 1 < self.restTotal) { - self.restIndex++; - self.getRestFromHttpDNS(options, 'signup'); - return; - } - } - self.clear(); - err(res); - }; - var https = options.https || https; - var apiUrl = options.apiUrl; - var restUrl = apiUrl + '/' + orgName + '/' + appName + '/users'; - - var userjson = { - username: options.username, - password: options.password, - nickname: options.nickname || '' - }; - - var userinfo = _utils.stringify(userjson); - var options2 = { - url: restUrl, - dataType: 'json', - data: userinfo, - success: suc, - error: error - }; - _utils.ajax(options2); - }; - - connection.prototype.open = function (options) { - if (location.protocol != 'https:' && this.isHttpDNS) { - this.dnsIndex = 0; - this.getHttpDNS(options, 'login'); - } else { - this.login(options); - } - }; - - connection.prototype.login = function (options) { - var pass = _validCheck(options, this); - - if (!pass) { - return; - } - - var conn = this; - - if (conn.isOpened()) { - return; - } - - if (options.accessToken) { - options.access_token = options.accessToken; - _login(options, conn); - } else { - var apiUrl = options.apiUrl; - var userId = this.context.userId; - var pwd = options.pwd || ''; - var appName = this.context.appName; - var orgName = this.context.orgName; - - var suc = function suc(data, xhr) { - conn.context.status = _code.STATUS_DOLOGIN_IM; - conn.context.restTokenData = data; - if (options.success) options.success(data); - _login(data, conn); - }; - var error = function error(res, xhr, msg) { - if (options.error) options.error(); - if (location.protocol != 'https:' && conn.isHttpDNS) { - if (conn.restIndex + 1 < conn.restTotal) { - conn.restIndex++; - conn.getRestFromHttpDNS(options, 'login'); - return; - } - } - conn.clear(); - if (res.error && res.error_description) { - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_USERGRID_ERROR, - data: res, - xhr: xhr - }); - } else { - conn.onError({ - type: _code.WEBIM_CONNCTION_OPEN_ERROR, - data: res, - xhr: xhr - }); - } - }; - - this.context.status = _code.STATUS_DOLOGIN_USERGRID; - - var loginJson = { - grant_type: 'password', - username: userId, - password: pwd, - timestamp: +new Date() - }; - var loginfo = _utils.stringify(loginJson); - - var options2 = { - url: apiUrl + '/' + orgName + '/' + appName + '/token', - dataType: 'json', - data: loginfo, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn - }; - _utils.ajax(options2); - } - }; - - // attach to xmpp server for BOSH - connection.prototype.attach = function (options) { - var pass = _validCheck(options, this); - - if (!pass) { - return; - } - - options = options || {}; - - var accessToken = options.accessToken || ''; - if (accessToken == '') { - this.onError({ - type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR - }); - return; - } - - var sid = options.sid || ''; - if (sid === '') { - this.onError({ - type: _code.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR - }); - return; - } - - var rid = options.rid || ''; - if (rid === '') { - this.onError({ - type: _code.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR - }); - return; - } - - var stropheConn = this.getStrophe(); - - this.context.accessToken = accessToken; - this.context.stropheConn = stropheConn; - this.context.status = _code.STATUS_DOLOGIN_IM; - - var conn = this; - var callback = function callback(status, msg) { - _loginCallback(status, msg, conn); - }; - - var jid = this.context.jid; - var wait = this.wait; - var hold = this.hold; - var wind = this.wind || 5; - stropheConn.attach(jid, sid, rid, callback, wait, hold, wind); - }; - - connection.prototype.close = function (reason) { - this.stopHeartBeat(); - - var status = this.context.status; - if (status == _code.STATUS_INIT) { - return; - } - - if (this.isClosed() || this.isClosing()) { - return; - } - - this.context.status = _code.STATUS_CLOSING; - this.context.stropheConn.disconnect(reason); - }; - - connection.prototype.addHandler = function (handler, ns, name, type, id, from, options) { - this.context.stropheConn.addHandler(handler, ns, name, type, id, from, options); - }; - - connection.prototype.notifyVersion = function (suc, fail) { - var jid = _getJid({}, this); - var dom = $iq({ - from: this.context.jid || '', - to: this.domain, - type: 'result' - }).c('query', {xmlns: 'jabber:iq:version'}).c('name').t('easemob').up().c('version').t(_version).up().c('os').t('webim'); - - var suc = suc || _utils.emptyfn; - var error = fail || this.onError; - var failFn = function failFn(ele) { - error({ - type: _code.WEBIM_CONNCTION_NOTIFYVERSION_ERROR, - data: ele - }); - }; - this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); - return; - }; - - // handle all types of presence message - connection.prototype.handlePresence = function (msginfo) { - if (this.isClosed()) { - return; - } - var from = msginfo.getAttribute('from') || ''; - var to = msginfo.getAttribute('to') || ''; - var type = msginfo.getAttribute('type') || ''; - var presence_type = msginfo.getAttribute('presence_type') || ''; - var fromUser = _parseNameFromJidFn(from); - var toUser = _parseNameFromJidFn(to); - var isCreate = false; - var info = { - from: fromUser, - to: toUser, - fromJid: from, - toJid: to, - type: type, - chatroom: msginfo.getElementsByTagName('roomtype').length ? true : false - }; - - var showTags = msginfo.getElementsByTagName('show'); - if (showTags && showTags.length > 0) { - var showTag = showTags[0]; - info.show = Strophe.getText(showTag); - } - var statusTags = msginfo.getElementsByTagName('status'); - if (statusTags && statusTags.length > 0) { - var statusTag = statusTags[0]; - info.status = Strophe.getText(statusTag); - info.code = statusTag.getAttribute('code'); - } - - var priorityTags = msginfo.getElementsByTagName('priority'); - if (priorityTags && priorityTags.length > 0) { - var priorityTag = priorityTags[0]; - info.priority = Strophe.getText(priorityTag); - } - - var error = msginfo.getElementsByTagName('error'); - if (error && error.length > 0) { - var error = error[0]; - info.error = { - code: error.getAttribute('code') - }; - } - - var destroy = msginfo.getElementsByTagName('destroy'); - if (destroy && destroy.length > 0) { - var destroy = destroy[0]; - info.destroy = true; - - var reason = destroy.getElementsByTagName('reason'); - if (reason && reason.length > 0) { - info.reason = Strophe.getText(reason[0]); - } - } - - var members = msginfo.getElementsByTagName('item'); - if (members && members.length > 0) { - var member = members[0]; - var role = member.getAttribute('role'); - var jid = member.getAttribute('jid'); - var affiliation = member.getAttribute('affiliation'); - // dismissed by group - if (role == 'none' && jid) { - var kickedMember = _parseNameFromJidFn(jid); - var actor = member.getElementsByTagName('actor')[0]; - var actorNick = actor.getAttribute('nick'); - info.actor = actorNick; - info.kicked = kickedMember; - } - // Service Acknowledges Room Creation `createGroupACK` - if (role == 'moderator' && info.code == '201') { - if (affiliation === 'owner') { - info.type = 'createGroupACK'; - isCreate = true; - } else info.type = 'joinPublicGroupSuccess'; - } - } - - var apply = msginfo.getElementsByTagName('apply'); - if (apply && apply.length > 0) { - apply = apply[0]; - var toNick = apply.getAttribute('toNick'); - var groupJid = apply.getAttribute('to'); - var userJid = apply.getAttribute('from'); - var groupName = _parseNameFromJidFn(groupJid); - var userName = _parseNameFromJidFn(userJid); - info.toNick = toNick; - info.groupName = groupName; - info.type = 'joinGroupNotifications'; - var reason = apply.getElementsByTagName('reason'); - if (reason && reason.length > 0) { - info.reason = Strophe.getText(reason[0]); - } - } - - if (info.chatroom) { - // diff the - info.presence_type = presence_type; - info.original_type = info.type; - var reflectUser = from.slice(from.lastIndexOf('/') + 1); - - if (reflectUser === this.context.userId) { - if (info.type === '' && !info.code) { - info.type = 'joinChatRoomSuccess'; - } else if (presence_type === 'unavailable' || info.type === 'unavailable') { - if (!info.status) { - // logout successfully. - info.type = 'leaveChatRoom'; - } else if (info.code == 110) { - // logout or dismissied by admin. - info.type = 'leaveChatRoom'; - } else if (info.error && info.error.code == 406) { - // The chat room is full. - info.type = 'reachChatRoomCapacity'; - } - } - } - } else { - info.presence_type = presence_type; - info.original_type = type; - - if (/subscribe/.test(info.type)) { - //subscribe | subscribed | unsubscribe | unsubscribed - } else if (type == "" && !info.status && !info.error && !isCreate) { - info.type = 'joinPublicGroupSuccess'; - } else if (presence_type === 'unavailable' || type === 'unavailable') { - // There is no roomtype when a chat room is deleted. - if (info.destroy) { - // Group or Chat room Deleted. - info.type = 'deleteGroupChat'; - } else if (info.code == 307 || info.code == 321) { - // Dismissed by group. - var nick = msginfo.getAttribute('nick'); - if (!nick) info.type = 'leaveGroup'; else info.type = 'removedFromGroup'; - } - } - } - this.onPresence(info, msginfo); - }; - - connection.prototype.handlePing = function (e) { - if (this.isClosed()) { - return; - } - var id = e.getAttribute('id'); - var from = e.getAttribute('from'); - var to = e.getAttribute('to'); - var dom = $iq({ - from: to, - to: from, - id: id, - type: 'result' - }); - this.sendCommand(dom.tree()); - }; - - connection.prototype.handleIq = function (iq) { - return true; - }; - - connection.prototype.handleIqPrivacy = function (msginfo) { - var list = msginfo.getElementsByTagName('list'); - if (list.length == 0) { - return; - } - this.getBlacklist(); - }; - - connection.prototype.handleIqRoster = function (e) { - var id = e.getAttribute('id'); - var from = e.getAttribute('from') || ''; - var name = _parseNameFromJidFn(from); - var curJid = this.context.jid; - var curUser = this.context.userId; - - var iqresult = $iq({type: 'result', id: id, from: curJid}); - this.sendCommand(iqresult.tree()); - - var msgBodies = e.getElementsByTagName('query'); - if (msgBodies && msgBodies.length > 0) { - var queryTag = msgBodies[0]; - var rouster = _parseFriend(queryTag, this, from); - this.onRoster(rouster); - } - return true; - }; - - connection.prototype.handleMessage = function (msginfo) { - var self = this; - if (this.isClosed()) { - return; - } - - var id = msginfo.getAttribute('id') || ''; - - // cache ack into sendQueue first , handelSendQueue will do the send thing with the speed of 5/s - this.cacheReceiptsMessage({ - id: id - }); - var parseMsgData = _parseResponseMessage(msginfo); - if (parseMsgData.errorMsg) { - this.handlePresence(msginfo); - return; - } - // send error - var error = msginfo.getElementsByTagName('error'); - var errorCode = ''; - var errorText = ''; - var errorBool = false; - if (error.length > 0) { - errorBool = true; - errorCode = error[0].getAttribute('code'); - var textDOM = error[0].getElementsByTagName('text'); - errorText = textDOM[0].textContent || textDOM[0].text; - log('handle error', errorCode, errorText); - } - - var msgDatas = parseMsgData.data; - for (var i in msgDatas) { - if (!msgDatas.hasOwnProperty(i)) { - continue; - } - var msg = msgDatas[i]; - if (!msg.from || !msg.to) { - continue; - } - - var from = (msg.from + '').toLowerCase(); - var too = (msg.to + '').toLowerCase(); - var extmsg = msg.ext || {}; - var chattype = ''; - var typeEl = msginfo.getElementsByTagName('roomtype'); - if (typeEl.length) { - chattype = typeEl[0].getAttribute('type') || 'chat'; - } else { - chattype = msginfo.getAttribute('type') || 'chat'; - } - - var msgBodies = msg.bodies; - if (!msgBodies || msgBodies.length == 0) { - continue; - } - var msgBody = msg.bodies[0]; - var type = msgBody.type; - - try { - switch (type) { - case 'txt': - var receiveMsg = msgBody.msg; - var emojibody = _utils.parseTextMessage(receiveMsg, WebIM.Emoji); - if (emojibody.isemoji) { - var msg = { - id: id, - type: chattype, - from: from, - to: too, - delay: parseMsgData.delayTimeStamp, - data: emojibody.body, - ext: extmsg - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onEmojiMessage(msg); - } else { - var msg = { - id: id, - type: chattype, - from: from, - to: too, - delay: parseMsgData.delayTimeStamp, - data: receiveMsg, - ext: extmsg - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onTextMessage(msg); - } - break; - case 'img': - var rwidth = 0; - var rheight = 0; - if (msgBody.size) { - rwidth = msgBody.size.width; - rheight = msgBody.size.height; - } - var msg = { - id: id, - type: chattype, - from: from, - to: too, - - url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, - secret: msgBody.secret, - filename: msgBody.filename, - thumb: msgBody.thumb, - thumb_secret: msgBody.thumb_secret, - file_length: msgBody.file_length || '', - width: rwidth, - height: rheight, - filetype: msgBody.filetype || '', - accessToken: this.context.accessToken || '', - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onPictureMessage(msg); - break; - case 'audio': - var msg = { - id: id, - type: chattype, - from: from, - to: too, - - url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, - secret: msgBody.secret, - filename: msgBody.filename, - length: msgBody.length || '', - file_length: msgBody.file_length || '', - filetype: msgBody.filetype || '', - accessToken: this.context.accessToken || '', - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onAudioMessage(msg); - break; - case 'file': - var msg = { - id: id, - type: chattype, - from: from, - to: too, - - url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, - secret: msgBody.secret, - filename: msgBody.filename, - file_length: msgBody.file_length, - accessToken: this.context.accessToken || '', - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onFileMessage(msg); - break; - case 'loc': - var msg = { - id: id, - type: chattype, - from: from, - to: too, - addr: msgBody.addr, - lat: msgBody.lat, - lng: msgBody.lng, - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onLocationMessage(msg); - break; - case 'video': - var msg = { - id: id, - type: chattype, - from: from, - to: too, - - url: location.protocol != 'https:' && self.isHttpDNS ? self.apiUrl + msgBody.url.substr(msgBody.url.indexOf("/", 9)) : msgBody.url, - secret: msgBody.secret, - filename: msgBody.filename, - file_length: msgBody.file_length, - accessToken: this.context.accessToken || '', - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onVideoMessage(msg); - break; - case 'cmd': - var msg = { - id: id, - from: from, - to: too, - action: msgBody.action, - ext: extmsg, - delay: parseMsgData.delayTimeStamp - }; - !msg.delay && delete msg.delay; - msg.error = errorBool; - msg.errorText = errorText; - msg.errorCode = errorCode; - this.onCmdMessage(msg); - break; - } - ; - } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, - data: e - }); - } - } - }; - - connection.prototype.handleReceivedMessage = function (message) { - try { - this.onReceivedMessage(message); - } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, - data: e - }); - } - - var rcv = message.getElementsByTagName('received'), - id, - mid; - - if (rcv.length > 0) { - if (rcv[0].childNodes && rcv[0].childNodes.length > 0) { - id = rcv[0].childNodes[0].nodeValue; - } else { - id = rcv[0].innerHTML || rcv[0].innerText; - } - mid = rcv[0].getAttribute('mid'); - } - - if (_msgHash[id]) { - try { - _msgHash[id].msg.success instanceof Function && _msgHash[id].msg.success(id, mid); - } catch (e) { - this.onError({ - type: _code.WEBIM_CONNCTION_CALLBACK_INNER_ERROR, - data: e - }); - } - delete _msgHash[id]; - } - }; - - connection.prototype.handleInviteMessage = function (message) { - var form = null; - var invitemsg = message.getElementsByTagName('invite'); - var reasonDom = message.getElementsByTagName('reason')[0]; - var reasonMsg = reasonDom.textContent; - var id = message.getAttribute('id') || ''; - this.sendReceiptsMessage({ - id: id - }); - - if (invitemsg && invitemsg.length > 0) { - var fromJid = invitemsg[0].getAttribute('from'); - form = _parseNameFromJidFn(fromJid); - } - var xmsg = message.getElementsByTagName('x'); - var roomid = null; - if (xmsg && xmsg.length > 0) { - for (var i = 0; i < xmsg.length; i++) { - if ('jabber:x:conference' === xmsg[i].namespaceURI) { - var roomjid = xmsg[i].getAttribute('jid'); - roomid = _parseNameFromJidFn(roomjid); - } - } - } - this.onInviteMessage({ - type: 'invite', - from: form, - roomid: roomid, - reason: reasonMsg - }); - }; - - connection.prototype.sendCommand = function (dom, id) { - if (this.isOpened()) { - this.context.stropheConn.send(dom); - } else { - this.onError({ - type: _code.WEBIM_CONNCTION_DISCONNECTED, - reconnect: true - }); - } - }; - - connection.prototype.getUniqueId = function (prefix) { - var cdate = new Date(); - var offdate = new Date(2010, 1, 1); - var offset = cdate.getTime() - offdate.getTime(); - var hexd = parseInt(offset).toString(16); - - if (typeof prefix === 'string' || typeof prefix === 'number') { - return prefix + '_' + hexd; - } else { - return 'WEBIM_' + hexd; - } - }; - - connection.prototype.send = function (message) { - var self = this; - if (this.isWindowSDK) { - WebIM.doQuery('{"type":"sendMessage","to":"' + message.to + '","message_type":"' + message.type + '","msg":"' + encodeURI(message.msg) + '","chatType":"' + message.chatType + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "send" - }, - type: _code.WEBIM_MESSAGE_SED_ERROR - }; - self.onError(message); - }); - } else { - if (Object.prototype.toString.call(message) === '[object Object]') { - var appKey = this.context.appKey || ''; - var toJid = appKey + '_' + message.to + '@' + this.domain; - - if (message.group) { - toJid = appKey + '_' + message.to + '@conference.' + this.domain; - } - if (message.resource) { - toJid = toJid + '/' + message.resource; - } - - message.toJid = toJid; - message.id = message.id || this.getUniqueId(); - _msgHash[message.id] = new _message(message); - _msgHash[message.id].send(this); - } else if (typeof message === 'string') { - _msgHash[message] && _msgHash[message].send(this); - } - } - }; - - connection.prototype.addRoster = function (options) { - var jid = _getJid(options, this); - var name = options.name || ''; - var groups = options.groups || ''; - - var iq = $iq({type: 'set'}); - iq.c('query', {xmlns: 'jabber:iq:roster'}); - iq.c('item', {jid: jid, name: name}); - - if (groups) { - for (var i = 0; i < groups.length; i++) { - iq.c('group').t(groups[i]).up(); - } - } - var suc = options.success || _utils.emptyfn; - var error = options.error || _utils.emptyfn; - this.context.stropheConn.sendIQ(iq.tree(), suc, error); - }; - - connection.prototype.removeRoster = function (options) { - var jid = _getJid(options, this); - var iq = $iq({type: 'set'}).c('query', {xmlns: 'jabber:iq:roster'}).c('item', { - jid: jid, - subscription: 'remove' - }); - - var suc = options.success || _utils.emptyfn; - var error = options.error || _utils.emptyfn; - this.context.stropheConn.sendIQ(iq, suc, error); - }; - - connection.prototype.getRoster = function (options) { - var conn = this; - var dom = $iq({ - type: 'get' - }).c('query', {xmlns: 'jabber:iq:roster'}); - - var options = options || {}; - var suc = options.success || this.onRoster; - var completeFn = function completeFn(ele) { - var rouster = []; - var msgBodies = ele.getElementsByTagName('query'); - if (msgBodies && msgBodies.length > 0) { - var queryTag = msgBodies[0]; - rouster = _parseFriend(queryTag); - } - suc(rouster, ele); - }; - var error = options.error || this.onError; - var failFn = function failFn(ele) { - error({ - type: _code.WEBIM_CONNCTION_GETROSTER_ERROR, - data: ele - }); - }; - if (this.isOpened()) { - this.context.stropheConn.sendIQ(dom.tree(), completeFn, failFn); - } else { - error({ - type: _code.WEBIM_CONNCTION_DISCONNECTED - }); - } - }; - - connection.prototype.subscribe = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'subscribe'}); - if (options.message) { - pres.c('status').t(options.message).up(); - } - if (options.nick) { - pres.c('nick', {'xmlns': 'http://jabber.org/protocol/nick'}).t(options.nick); - } - this.sendCommand(pres.tree()); - }; - - connection.prototype.subscribed = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'subscribed'}); - - if (options.message) { - pres.c('status').t(options.message).up(); - } - this.sendCommand(pres.tree()); - }; - - connection.prototype.unsubscribe = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'unsubscribe'}); - - if (options.message) { - pres.c('status').t(options.message); - } - this.sendCommand(pres.tree()); - }; - - connection.prototype.unsubscribed = function (options) { - var jid = _getJid(options, this); - var pres = $pres({to: jid, type: 'unsubscribed'}); - - if (options.message) { - pres.c('status').t(options.message).up(); - } - this.sendCommand(pres.tree()); - }; - - connection.prototype.joinPublicGroup = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_JOINROOM_ERROR, - data: ele - }); - }; - var iq = $pres({ - from: this.context.jid, - to: room_nick - }).c('x', {xmlns: Strophe.NS.MUC}); - - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; - - connection.prototype.listRooms = function (options) { - var iq = $iq({ - to: options.server || 'conference.' + this.domain, - from: this.context.jid, - type: 'get' - }).c('query', {xmlns: Strophe.NS.DISCO_ITEMS}); - - var suc = options.success || _utils.emptyfn; - var error = options.error || this.onError; - var completeFn = function completeFn(result) { - var rooms = []; - rooms = _parseRoom(result); - try { - suc(rooms); - } catch (e) { - error({ - type: _code.WEBIM_CONNCTION_GETROOM_ERROR, - data: e - }); - } - }; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOM_ERROR, - data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; - - connection.prototype.queryRoomMember = function (options) { - var domain = this.domain; - var members = []; - var iq = $iq({ - to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain, - type: 'get' - }).c('query', {xmlns: Strophe.NS.MUC + '#admin'}).c('item', {affiliation: 'member'}); - - var suc = options.success || _utils.emptyfn; - var completeFn = function completeFn(result) { - var items = result.getElementsByTagName('item'); - - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var mem = { - jid: item.getAttribute('jid'), - affiliation: 'member' - }; - members.push(mem); - } - } - suc(members); - }; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMMEMBER_ERROR, - data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; - - connection.prototype.queryRoomInfo = function (options) { - var domain = this.domain; - var iq = $iq({ - to: this.context.appKey + '_' + options.roomId + '@conference.' + domain, - type: 'get' - }).c('query', {xmlns: Strophe.NS.DISCO_INFO}); - - var suc = options.success || _utils.emptyfn; - var members = []; - - var completeFn = function completeFn(result) { - var settings = ''; - var features = result.getElementsByTagName('feature'); - if (features) { - settings = features[1].getAttribute('var') + '|' + features[3].getAttribute('var') + '|' + features[4].getAttribute('var'); - } - switch (settings) { - case 'muc_public|muc_membersonly|muc_notallowinvites': - settings = 'PUBLIC_JOIN_APPROVAL'; - break; - case 'muc_public|muc_open|muc_notallowinvites': - settings = 'PUBLIC_JOIN_OPEN'; - break; - case 'muc_hidden|muc_membersonly|muc_allowinvites': - settings = 'PRIVATE_MEMBER_INVITE'; - break; - case 'muc_hidden|muc_membersonly|muc_notallowinvites': - settings = 'PRIVATE_OWNER_INVITE'; - break; - } - var owner = ''; - var fields = result.getElementsByTagName('field'); - var fieldValues = {}; - if (fields) { - for (var i = 0; i < fields.length; i++) { - var field = fields[i]; - var fieldVar = field.getAttribute('var'); - var fieldSimplify = fieldVar.split('_')[1]; - switch (fieldVar) { - case 'muc#roominfo_occupants': - case 'muc#roominfo_maxusers': - case 'muc#roominfo_affiliations': - case 'muc#roominfo_description': - fieldValues[fieldSimplify] = field.textContent || field.text || ''; - break; - case 'muc#roominfo_owner': - var mem = { - jid: (field.textContent || field.text) + '@' + domain, - affiliation: 'owner' - }; - members.push(mem); - fieldValues[fieldSimplify] = field.textContent || field.text; - break; - } - - // if (field.getAttribute('label') === 'owner') { - // var mem = { - // jid: (field.textContent || field.text) + '@' + domain - // , affiliation: 'owner' - // }; - // members.push(mem); - // break; - // } - } - fieldValues['name'] = result.getElementsByTagName('identity')[0].getAttribute('name'); - } - log(settings, members, fieldValues); - suc(settings, members, fieldValues); - }; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMINFO_ERROR, - data: ele - }); - }; - this.context.stropheConn.sendIQ(iq.tree(), completeFn, errorFn); - }; - - connection.prototype.queryRoomOccupants = function (options) { - var suc = options.success || _utils.emptyfn; - var completeFn = function completeFn(result) { - var occupants = []; - occupants = _parseRoomOccupants(result); - suc(occupants); - }; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR, - data: ele - }); - }; - var attrs = { - xmlns: Strophe.NS.DISCO_ITEMS - }; - var info = $iq({ - from: this.context.jid, - to: this.context.appKey + '_' + options.roomId + '@conference.' + this.domain, - type: 'get' - }).c('query', attrs); - this.context.stropheConn.sendIQ(info.tree(), completeFn, errorFn); - }; - - connection.prototype.setUserSig = function (desc) { - var dom = $pres({xmlns: 'jabber:client'}); - desc = desc || ''; - dom.c('status').t(desc); - this.sendCommand(dom.tree()); - }; - - connection.prototype.setPresence = function (type, status) { - var dom = $pres({xmlns: 'jabber:client'}); - if (type) { - if (status) { - dom.c('show').t(type); - dom.up().c('status').t(status); - } else { - dom.c('show').t(type); - } - } - this.sendCommand(dom.tree()); - }; - - connection.prototype.getPresence = function () { - var dom = $pres({xmlns: 'jabber:client'}); - var conn = this; - this.sendCommand(dom.tree()); - }; - - connection.prototype.ping = function (options) { - var options = options || {}; - var jid = _getJid(options, this); - - var dom = $iq({ - from: this.context.jid || '', - to: jid, - type: 'get' - }).c('ping', {xmlns: 'urn:xmpp:ping'}); - - var suc = options.success || _utils.emptyfn; - var error = options.error || this.onError; - var failFn = function failFn(ele) { - error({ - type: _code.WEBIM_CONNCTION_PING_ERROR, - data: ele - }); - }; - if (this.isOpened()) { - this.context.stropheConn.sendIQ(dom.tree(), suc, failFn); - } else { - error({ - type: _code.WEBIM_CONNCTION_DISCONNECTED - }); - } - return; - }; - - connection.prototype.isOpened = function () { - return this.context.status == _code.STATUS_OPENED; - }; - - connection.prototype.isOpening = function () { - var status = this.context.status; - return status == _code.STATUS_DOLOGIN_USERGRID || status == _code.STATUS_DOLOGIN_IM; - }; - - connection.prototype.isClosing = function () { - return this.context.status == _code.STATUS_CLOSING; - }; - - connection.prototype.isClosed = function () { - return this.context.status == _code.STATUS_CLOSED; - }; - - connection.prototype.clear = function () { - var key = this.context.appKey; - if (this.errorType != _code.WEBIM_CONNCTION_DISCONNECTED) { - this.context = { - status: _code.STATUS_INIT, - appKey: key - }; - } - if (this.intervalId) { - clearInterval(this.intervalId); - } - this.restIndex = 0; - this.xmppIndex = 0; - - if (this.errorType == _code.WEBIM_CONNCTION_CLIENT_LOGOUT || this.errorType == -1) { - var message = { - data: { - data: "logout" - }, - type: _code.WEBIM_CONNCTION_CLIENT_LOGOUT - }; - this.onError(message); - } - }; - - connection.prototype.getChatRooms = function (options) { - - if (!_utils.isCanSetRequestHeader) { - conn.onError({ - type: _code.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR - }); - return; - } - - var conn = this, - token = options.accessToken || this.context.accessToken; - - if (token) { - var apiUrl = options.apiUrl; - var appName = this.context.appName; - var orgName = this.context.orgName; - - if (!appName || !orgName) { - conn.onError({ - type: _code.WEBIM_CONNCTION_AUTH_ERROR - }); - return; - } - - var suc = function suc(data, xhr) { - typeof options.success === 'function' && options.success(data); - }; - - var error = function error(res, xhr, msg) { - if (res.error && res.error_description) { - conn.onError({ - type: _code.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR, - msg: res.error_description, - data: res, - xhr: xhr - }); - } - }; - - var pageInfo = { - pagenum: parseInt(options.pagenum) || 1, - pagesize: parseInt(options.pagesize) || 20 - }; - - var opts = { - url: apiUrl + '/' + orgName + '/' + appName + '/chatrooms', - dataType: 'json', - type: 'GET', - headers: {'Authorization': 'Bearer ' + token}, - data: pageInfo, - success: suc || _utils.emptyfn, - error: error || _utils.emptyfn - }; - _utils.ajax(opts); - } else { - conn.onError({ - type: _code.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR - }); - } - }; - - connection.prototype.joinChatRoom = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_JOINCHATROOM_ERROR, - data: ele - }); - }; - - var iq = $pres({ - from: this.context.jid, - to: room_nick - }).c('x', {xmlns: Strophe.NS.MUC + '#user'}).c('item', { - affiliation: 'member', - role: 'participant' - }).up().up().c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); - - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; - - connection.prototype.quitChatRoom = function (options) { - var roomJid = this.context.appKey + '_' + options.roomId + '@conference.' + this.domain; - var room_nick = roomJid + '/' + this.context.userId; - var suc = options.success || _utils.emptyfn; - var err = options.error || _utils.emptyfn; - var errorFn = function errorFn(ele) { - err({ - type: _code.WEBIM_CONNCTION_QUITCHATROOM_ERROR, - data: ele - }); - }; - var iq = $pres({ - from: this.context.jid, - to: room_nick, - type: 'unavailable' - }).c('x', {xmlns: Strophe.NS.MUC + '#user'}).c('item', { - affiliation: 'none', - role: 'none' - }).up().up().c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); - - this.context.stropheConn.sendIQ(iq.tree(), suc, errorFn); - }; - - connection.prototype._onReceiveInviteFromGroup = function (info) { - info = eval('(' + info + ')'); - var self = this; - var options = { - title: "Group invitation", - msg: info.user + " invites you to join into group:" + info.group_id, - agree: function agree() { - WebIM.doQuery('{"type":"acceptInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "acceptInvitationFromGroup error:" + msg - }, - type: _code.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP - }; - self.onError(message); - }); - }, - reject: function reject() { - WebIM.doQuery('{"type":"declineInvitationFromGroup","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "declineInvitationFromGroup error:" + msg - }, - type: _code.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP - }; - self.onError(message); - }); - } - }; - - this.onConfirmPop(options); - }; - connection.prototype._onReceiveInviteAcceptionFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation response", - msg: info.user + " agreed to join into group:" + info.group_id, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onReceiveInviteDeclineFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation response", - msg: info.user + " rejected to join into group:" + info.group_id, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onAutoAcceptInvitationFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group invitation", - msg: "You had joined into the group:" + info.group_name + " automatically.Inviter:" + info.user, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onLeaveGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You have been out of the group:" + info.group_id + ".Reason:" + info.msg, - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onReceiveJoinGroupApplication = function (info) { - info = eval('(' + info + ')'); - var self = this; - var options = { - title: "Group join application", - msg: info.user + " applys to join into group:" + info.group_id, - agree: function agree() { - WebIM.doQuery('{"type":"acceptJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "acceptJoinGroupApplication error:" + msg - }, - type: _code.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP - }; - self.onError(message); - }); - }, - reject: function reject() { - WebIM.doQuery('{"type":"declineJoinGroupApplication","id":"' + info.group_id + '","user":"' + info.user + '"}', function (response) { - }, function (code, msg) { - var message = { - data: { - data: "declineJoinGroupApplication error:" + msg - }, - type: _code.WEBIM_CONNECTION_DECLINE_JOIN_GROUP - }; - self.onError(message); - }); - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onReceiveAcceptionFromGroup = function (info) { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You had joined into the group:" + info.group_name + ".", - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onReceiveRejectionFromGroup = function () { - info = eval('(' + info + ')'); - var options = { - title: "Group notification", - msg: "You have been rejected to join into the group:" + info.group_name + ".", - agree: function agree() { - } - }; - this.onConfirmPop(options); - }; - connection.prototype._onUpdateMyGroupList = function (options) { - this.onUpdateMyGroupList(options); - }; - connection.prototype._onUpdateMyRoster = function (options) { - this.onUpdateMyRoster(options); - }; - connection.prototype.reconnect = function () { - var that = this; - setTimeout(function () { - _login(that.context.restTokenData, that); - }, (this.autoReconnectNumTotal == 0 ? 0 : this.autoReconnectInterval) * 1000); - this.autoReconnectNumTotal++; - }; - - connection.prototype.closed = function () { - var message = { - data: { - data: "Closed error" - }, - type: _code.WEBIM_CONNECTION_CLOSED - }; - this.onError(message); - }; - - // used for blacklist - function _parsePrivacy(iq) { - var list = []; - var items = iq.getElementsByTagName('item'); - - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('value'); - var order = item.getAttribute('order'); - var type = item.getAttribute('type'); - if (!jid) { - continue; - } - var n = _parseNameFromJidFn(jid); - list[n] = { - type: type, - order: order, - jid: jid, - name: n - }; - } - } - return list; - }; - - // used for blacklist - connection.prototype.getBlacklist = function (options) { - options = options || {}; - var iq = $iq({type: 'get'}); - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var me = this; - - iq.c('query', {xmlns: 'jabber:iq:privacy'}).c('list', {name: 'special'}); - - this.context.stropheConn.sendIQ(iq.tree(), function (iq) { - me.onBlacklistUpdate(_parsePrivacy(iq)); - sucFn(); - }, function () { - me.onBlacklistUpdate([]); - errFn(); - }); - }; - - // used for blacklist - connection.prototype.addToBlackList = function (options) { - var iq = $iq({type: 'set'}); - var blacklist = options.list || {}; - var type = options.type || 'jid'; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var piece = iq.c('query', {xmlns: 'jabber:iq:privacy'}).c('list', {name: 'special'}); - - var keys = Object.keys(blacklist); - var len = keys.length; - var order = 2; - - for (var i = 0; i < len; i++) { - var item = blacklist[keys[i]]; - var type = item.type || 'jid'; - var jid = item.jid; - - piece = piece.c('item', {action: 'deny', order: order++, type: type, value: jid}).c('message'); - if (i !== len - 1) { - piece = piece.up().up(); - } - } - - // log('addToBlackList', blacklist, piece.tree()); - this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); - }; - - // used for blacklist - connection.prototype.removeFromBlackList = function (options) { - - var iq = $iq({type: 'set'}); - var blacklist = options.list || {}; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var piece = iq.c('query', {xmlns: 'jabber:iq:privacy'}).c('list', {name: 'special'}); - - var keys = Object.keys(blacklist); - var len = keys.length; - - for (var i = 0; i < len; i++) { - var item = blacklist[keys[i]]; - var type = item.type || 'jid'; - var jid = item.jid; - var order = item.order; - - piece = piece.c('item', {action: 'deny', order: order, type: type, value: jid}).c('message'); - if (i !== len - 1) { - piece = piece.up().up(); - } - } - - // log('removeFromBlackList', blacklist, piece.tree()); - this.context.stropheConn.sendIQ(piece.tree(), sucFn, errFn); - }; - - connection.prototype._getGroupJid = function (to) { - var appKey = this.context.appKey || ''; - return appKey + '_' + to + '@conference.' + this.domain; - }; - - // used for blacklist - connection.prototype.addToGroupBlackList = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var jid = _getJid(options, this); - var affiliation = 'admin'; //options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('item', { - affiliation: 'outcast', - jid: jid - }); - - this.context.stropheConn.sendIQ(iq.tree(), sucFn, errFn); - }; - - function _parseGroupBlacklist(iq) { - var list = {}; - var items = iq.getElementsByTagName('item'); - - if (items) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - var jid = item.getAttribute('jid'); - var affiliation = item.getAttribute('affiliation'); - var nick = item.getAttribute('nick'); - if (!jid) { - continue; - } - var n = _parseNameFromJidFn(jid); - list[n] = { - jid: jid, - affiliation: affiliation, - nick: nick, - name: n - }; - } - } - return list; - } - - // used for blacklist - connection.prototype.getGroupBlacklist = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - // var jid = _getJid(options, this); - var affiliation = 'admin'; //options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'get', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('item', { - affiliation: 'outcast' - }); - - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - log('getGroupBlackList'); - sucFn(_parseGroupBlacklist(msginfo)); - }, function () { - errFn(); - }); - }; - - // used for blacklist - connection.prototype.removeGroupMemberFromBlacklist = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - var jid = _getJid(options, this); - var affiliation = 'admin'; //options.affiliation || 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('item', { - affiliation: 'none', - jid: jid - }); - - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; - - /** - * changeGroupSubject 修改群名称 - * - * @param options - */ - // - // - // - // http://jabber.org/protocol/muc#roomconfig - // Room Name - // - // - // - connection.prototype.changeGroupSubject = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - // must be `owner` - var affiliation = 'owner'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('x', { - type: 'submit', - xmlns: 'jabber:x:data' - }).c('field', {'var': 'FORM_TYPE'}).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up().c('field', {'var': 'muc#roomconfig_roomname'}).c('value').t(options.subject).up().up().c('field', {'var': 'muc#roomconfig_roomdesc'}).c('value').t(options.description); - - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; - - /** - * destroyGroup 删除群组 - * - * @param options - */ - // - // - // - // xxx destory group yyy - // - // - // - connection.prototype.destroyGroup = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - // must be `owner` - var affiliation = 'owner'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('destroy').c('reason').t(options.reason || ''); - - this.context.stropheConn.sendIQ(iq.tree(), function (msginfo) { - sucFn(); - }, function () { - errFn(); - }); - }; - - /** - * leaveGroupBySelf 主动离开群组 - * - * @param options - */ - // - // - // - // - // - // - - connection.prototype.leaveGroupBySelf = function (options) { - var self = this; - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - - // must be `owner` - var jid = _getJid(options, this); - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - - iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}).c('item', { - affiliation: 'none', - jid: jid - }); - - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - var pres = $pres({type: 'unavailable', to: to + '/' + self.context.userId}); - self.sendCommand(pres.tree()); - }, function (errInfo) { - errFn(errInfo); - }); - }; - - /** - * leaveGroup 被踢出群组 - * - * @param options - */ - // - // - // - // - // - // - // - // - connection.prototype.leaveGroup = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var list = options.list || []; - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - var piece = iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}); - var keys = Object.keys(list); - var len = keys.length; - - for (var i = 0; i < len; i++) { - var name = list[keys[i]]; - var jid = _getJidByName(name, this); - - piece = piece.c('item', { - affiliation: 'none', - jid: jid - }).up().c('item', { - role: 'none', - jid: jid - }).up(); - } - - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - }, function (errInfo) { - errFn(errInfo); - }); - }; - - /** - * addGroupMembers 添加群组成员 - * - * @param options - - Attention the sequence: message first (每个成员单独发一条message), iq second (多个成员可以合成一条iq发) - - - - - liuwz invite you to join group '谢谢' - - - - - - - - - - */ - - connection.prototype.addGroupMembers = function (options) { - var sucFn = options.success || _utils.emptyfn; - var errFn = options.error || _utils.emptyfn; - var list = options.list || []; - var affiliation = 'admin'; - var to = this._getGroupJid(options.roomId); - var iq = $iq({type: 'set', to: to}); - var piece = iq.c('query', {xmlns: 'http://jabber.org/protocol/muc#' + affiliation}); - var len = list.length; - - for (var i = 0; i < len; i++) { - - var name = list[i]; - var jid = _getJidByName(name, this); - - piece = piece.c('item', { - affiliation: 'member', - jid: jid - }).up(); - - var dom = $msg({ - to: to - }).c('x', { - xmlns: 'http://jabber.org/protocol/muc#user' - }).c('invite', { - to: jid - }).c('reason').t(options.reason || ''); - - this.sendCommand(dom.tree()); - } - - this.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - sucFn(msgInfo); - }, function (errInfo) { - errFn(errInfo); - }); - }; - - /** - * acceptInviteFromGroup 接受加入申请 - * - * @param options - */ - connection.prototype.acceptInviteFromGroup = function (options) { - options.success = function () { - // then send sendAcceptInviteMessage - // connection.prototype.sendAcceptInviteMessage(optoins); - }; - this.addGroupMembers(options); - }; - - /** - * rejectInviteFromGroup 拒绝入群申请 - * - * throw request for now 暂时不处理,直接丢弃 - * - - - - reject - - - - * - * @param options - */ - connection.prototype.rejectInviteFromGroup = function (options) { - // var from = _getJidByName(options.from, this); - // var dom = $msg({ - // from: from, - // to: _getJidByName(options.to, this) - // }).c('x', { - // xmlns: 'http://jabber.org/protocol/muc#user' - // }).c('apply', { - // from: from, - // to: this._getGroupJid(options.groupId), - // toNick: options.groupName - // }).c('reason').t(options.reason || ''); - // - // this.sendCommand(dom.tree()); - }; - - connection.prototype.createGroupAsync = function (p) { - var roomId = p.from; - var me = this; - var toRoom = this._getGroupJid(roomId); - var to = toRoom + '/' + this.context.userId; - var options = this.groupOption; - var suc = p.success || _utils.emptyfn; - - // Creating a Reserved Room - var iq = $iq({type: 'get', to: toRoom}).c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}); - - // Strophe.info('step 1 ----------'); - // Strophe.info(options); - me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - // log(msgInfo); - - // for ie hack - if ('setAttribute' in msgInfo) { - // Strophe.info('step 3 ----------'); - var x = msgInfo.getElementsByTagName('x')[0]; - x.setAttribute('type', 'submit'); - } else { - // Strophe.info('step 4 ----------'); - Strophe.forEachChild(msgInfo, 'x', function (field) { - field.setAttribute('type', 'submit'); - }); - } - - Strophe.info('step 5 ----------'); - Strophe.forEachChild(x, 'field', function (field) { - var fieldVar = field.getAttribute('var'); - var valueDom = field.getElementsByTagName('value')[0]; - Strophe.info(fieldVar); - switch (fieldVar) { - case 'muc#roomconfig_roomname': - _setText(valueDom, options.subject || ''); - break; - case 'muc#roomconfig_roomdesc': - _setText(valueDom, options.description || ''); - break; - case 'muc#roomconfig_publicroom': - // public 1 - _setText(valueDom, +options.optionsPublic); - break; - case 'muc#roomconfig_membersonly': - _setText(valueDom, +options.optionsMembersOnly); - break; - case 'muc#roomconfig_moderatedroom': - _setText(valueDom, +options.optionsModerate); - break; - case 'muc#roomconfig_persistentroom': - _setText(valueDom, 1); - break; - case 'muc#roomconfig_allowinvites': - _setText(valueDom, +options.optionsAllowInvites); - break; - case 'muc#roomconfig_allowvisitornickchange': - _setText(valueDom, 0); - break; - case 'muc#roomconfig_allowvisitorstatus': - _setText(valueDom, 0); - break; - case 'allow_private_messages': - _setText(valueDom, 0); - break; - case 'allow_private_messages_from_visitors': - _setText(valueDom, 'nobody'); - break; - default: - break; - } - }); - - var iq = $iq({ - to: toRoom, - type: 'set' - }).c('query', {xmlns: 'http://jabber.org/protocol/muc#owner'}).cnode(x); - - me.context.stropheConn.sendIQ(iq.tree(), function (msgInfo) { - me.addGroupMembers({ - list: options.members, - roomId: roomId - }); - - suc(options); - }, function (errInfo) { - // errFn(errInfo); - }); - // sucFn(msgInfo); - }, function (errInfo) { - // errFn(errInfo); - }); - }; - - /** - * createGroup 创建群组 - * - * 1. 创建申请 -> 得到房主身份 - * 2. 获取房主信息 -> 得到房间form - * 3. 完善房间form -> 创建成功 - * 4. 添加房间成员 - * 5. 消息通知成员 - * @param options - */ - connection.prototype.createGroup = function (options) { - this.groupOption = options; - var roomId = +new Date(); - var toRoom = this._getGroupJid(roomId); - var to = toRoom + '/' + this.context.userId; - - var pres = $pres({to: to}).c('x', {xmlns: 'http://jabber.org/protocol/muc'}).up().c('create', {xmlns: 'http://jabber.org/protocol/muc'}).up(); - - // createGroupACK - this.sendCommand(pres.tree()); - }; - - function _setText(valueDom, v) { - if ('textContent' in valueDom) { - valueDom.textContent = v; - } else if ('text' in valueDom) { - valueDom.text = v; - } else { - // Strophe.info('_setText 4 ----------'); - // valueDom.innerHTML = v; - } - } - - var WebIM = window.WebIM || {}; - WebIM.connection = connection; - WebIM.utils = _utils; - WebIM.statusCode = _code; - WebIM.message = _msg.message; - WebIM.doQuery = function (str, suc, fail) { - if (typeof window.cefQuery === 'undefined') { - return; - } - window.cefQuery({ - request: str, - persistent: false, - onSuccess: suc, - onFailure: fail - }); - }; - - module.exports = WebIM; - - if (false) { - module.hot.accept(); - } - - /***/ - }, - - /***/ 232: /***/ function (module, exports, __webpack_require__) { - - 'use strict'; - - ; - (function () { - 'use strict'; - - var _utils = __webpack_require__(223).utils; - var Message = function Message(type, id) { - if (!this instanceof Message) { - return new Message(type); - } - - this._msg = {}; - - if (typeof Message[type] === 'function') { - Message[type].prototype.setGroup = this.setGroup; - this._msg = new Message[type](id); - } - return this._msg; - }; - Message.prototype.setGroup = function (group) { - this.body.group = group; - }; - - /* - * text message - */ - Message.txt = function (id) { - this.id = id; - this.type = 'txt'; - this.body = {}; - }; - Message.txt.prototype.set = function (opt) { - this.value = opt.msg; - this.body = { - id: this.id, - to: opt.to, - msg: this.value, - type: this.type, - roomType: opt.roomType, - ext: opt.ext || {}, - success: opt.success, - fail: opt.fail - }; - - !opt.roomType && delete this.body.roomType; - }; - - /* - * cmd message - */ - Message.cmd = function (id) { - this.id = id; - this.type = 'cmd'; - this.body = {}; - }; - Message.cmd.prototype.set = function (opt) { - this.value = ''; - - this.body = { - to: opt.to, - action: opt.action, - msg: this.value, - type: this.type, - roomType: opt.roomType, - ext: opt.ext || {}, - success: opt.success - }; - !opt.roomType && delete this.body.roomType; - }; - - /* - * loc message - */ - Message.location = function (id) { - this.id = id; - this.type = 'loc'; - this.body = {}; - }; - Message.location.prototype.set = function (opt) { - this.body = { - to: opt.to, - type: this.type, - roomType: opt.roomType, - addr: opt.addr, - lat: opt.lat, - lng: opt.lng, - ext: opt.ext || {} - }; - }; - - /* - * img message - */ - Message.img = function (id) { - this.id = id; - this.type = 'img'; - this.body = {}; - }; - Message.img.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - - this.value = opt.file; - - this.body = { - id: this.id, - file: this.value, - apiUrl: opt.apiUrl, - to: opt.to, - type: this.type, - ext: opt.ext || {}, - roomType: opt.roomType, - onFileUploadError: opt.onFileUploadError, - onFileUploadComplete: opt.onFileUploadComplete, - success: opt.success, - fail: opt.fail, - flashUpload: opt.flashUpload, - width: opt.width, - height: opt.height, - body: opt.body, - uploadError: opt.uploadError, - uploadComplete: opt.uploadComplete - }; - - !opt.roomType && delete this.body.roomType; - }; - - /* - * audio message - */ - Message.audio = function (id) { - this.id = id; - this.type = 'audio'; - this.body = {}; - }; - Message.audio.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - - this.value = opt.file; - this.filename = opt.filename || this.value.filename; - - this.body = { - id: this.id, - file: this.value, - filename: this.filename, - apiUrl: opt.apiUrl, - to: opt.to, - type: this.type, - ext: opt.ext || {}, - length: opt.length || 0, - roomType: opt.roomType, - file_length: opt.file_length, - onFileUploadError: opt.onFileUploadError, - onFileUploadComplete: opt.onFileUploadComplete, - success: opt.success, - fail: opt.fail, - flashUpload: opt.flashUpload, - body: opt.body - }; - !opt.roomType && delete this.body.roomType; - }; - - /* - * file message - */ - Message.file = function (id) { - this.id = id; - this.type = 'file'; - this.body = {}; - }; - Message.file.prototype.set = function (opt) { - opt.file = opt.file || _utils.getFileUrl(opt.fileInputId); - - this.value = opt.file; - this.filename = opt.filename || this.value.filename; - - this.body = { - id: this.id, - file: this.value, - filename: this.filename, - apiUrl: opt.apiUrl, - to: opt.to, - type: this.type, - ext: opt.ext || {}, - roomType: opt.roomType, - onFileUploadError: opt.onFileUploadError, - onFileUploadComplete: opt.onFileUploadComplete, - success: opt.success, - fail: opt.fail, - flashUpload: opt.flashUpload, - body: opt.body - }; - !opt.roomType && delete this.body.roomType; - }; - - /* - * video message - */ - Message.video = function (id) { - }; - Message.video.prototype.set = function (opt) { - }; - - var _Message = function _Message(message) { - - if (!this instanceof _Message) { - return new _Message(message, conn); - } - - this.msg = message; - }; - - _Message.prototype.send = function (conn) { - var me = this; - - var _send = function _send(message) { - - message.ext = message.ext || {}; - message.ext.weichat = message.ext.weichat || {}; - message.ext.weichat.originType = message.ext.weichat.originType || 'webim'; - - var json = { - from: conn.context.userId || '', - to: message.to, - bodies: [message.body], - ext: message.ext || {} - }; - - var jsonstr = _utils.stringify(json); - var dom = $msg({ - type: message.group || 'chat', - to: message.toJid, - id: message.id, - xmlns: 'jabber:client' - }).c('body').t(jsonstr); - - if (message.roomType) { - dom.up().c('roomtype', {xmlns: 'easemob:x:roomtype', type: 'chatroom'}); - } - - setTimeout(function () { - if (typeof _msgHash !== 'undefined' && _msgHash[message.id]) { - _msgHash[message.id].msg.fail instanceof Function && _msgHash[message.id].msg.fail(message.id); - } - }, 60000); - conn.sendCommand(dom.tree(), message.id); - }; - - if (me.msg.file) { - if (me.msg.body && me.msg.body.url) { - // Only send msg - _send(me.msg); - return; - } - var _tmpComplete = me.msg.onFileUploadComplete; - var _complete = function _complete(data) { - - if (data.entities[0]['file-metadata']) { - var file_len = data.entities[0]['file-metadata']['content-length']; - me.msg.file_length = file_len; - me.msg.filetype = data.entities[0]['file-metadata']['content-type']; - if (file_len > 204800) { - me.msg.thumbnail = true; - } - } - - me.msg.body = { - type: me.msg.type || 'file', - - url: (location.protocol != 'https:' && conn.isHttpDNS ? conn.apiUrl + data.uri.substr(data.uri.indexOf("/", 9)) : data.uri) + '/' + data.entities[0]['uuid'], - secret: data.entities[0]['share-secret'], - filename: me.msg.file.filename || me.msg.filename, - size: { - width: me.msg.width || 0, - height: me.msg.height || 0 - }, - length: me.msg.length || 0, - file_length: me.msg.file_length || 0, - filetype: me.msg.filetype - }; - _send(me.msg); - _tmpComplete instanceof Function && _tmpComplete(data, me.msg.id); - }; - - me.msg.onFileUploadComplete = _complete; - _utils.uploadFile.call(conn, me.msg); - } else { - me.msg.body = { - type: me.msg.type === 'chat' ? 'txt' : me.msg.type, - msg: me.msg.msg - }; - if (me.msg.type === 'cmd') { - me.msg.body.action = me.msg.action; - } else if (me.msg.type === 'loc') { - me.msg.body.addr = me.msg.addr; - me.msg.body.lat = me.msg.lat; - me.msg.body.lng = me.msg.lng; - } - - _send(me.msg); - } - }; - - exports._msg = _Message; - exports.message = Message; - })(); - - /***/ - }, - - /***/ 233: /***/ function (module, exports) { - - "use strict"; - - ; - (function () { - function Array_h(length) { - this.array = length === undefined ? [] : new Array(length); - } - - Array_h.prototype = { - /** - * 返回数组长度 - * - * @return {Number} length [数组长度] - */ - length: function length() { - return this.array.length; - }, - - at: function at(index) { - return this.array[index]; - }, - - set: function set(index, obj) { - this.array[index] = obj; - }, - - /** - * 向数组的末尾添加一个或多个元素,并返回新的长度。 - * - * @param {*} obj [description] - * @return {Number} length [新数组的长度] - */ - push: function push(obj) { - return this.array.push(obj); - }, - - /** - * 返回数组中选定的元素 - * - * @param {Number} start [开始索引值] - * @param {Number} end [结束索引值] - * @return {Array} newArray [新的数组] - */ - slice: function slice(start, end) { - return this.array = this.array.slice(start, end); - }, - - concat: function concat(array) { - this.array = this.array.concat(array); - }, - - remove: function remove(index, count) { - count = count === undefined ? 1 : count; - this.array.splice(index, count); - }, - - join: function join(separator) { - return this.array.join(separator); - }, - - clear: function clear() { - this.array.length = 0; - } - }; - - /** - * 先进先出队列 (First Input First Output) - * - * 一种先进先出的数据缓存器 - */ - var Queue = function Queue() { - this._array_h = new Array_h(); - }; - - Queue.prototype = { - _index: 0, - - /** - * 排队 - * - * @param {Object} obj [description] - * @return {[type]} [description] - */ - push: function push(obj) { - this._array_h.push(obj); - }, - - /** - * 出队 - * - * @return {Object} [description] - */ - pop: function pop() { - var ret = null; - if (this._array_h.length()) { - ret = this._array_h.at(this._index); - if (++this._index * 2 >= this._array_h.length()) { - this._array_h.slice(this._index); - this._index = 0; - } - } - return ret; - }, - - /** - * 返回队列中头部(即最新添加的)的动态对象 - * - * @return {Object} [description] - */ - head: function head() { - var ret = null, - len = this._array_h.length(); - if (len) { - ret = this._array_h.at(len - 1); - } - return ret; - }, - - /** - * 返回队列中尾部(即最早添加的)的动态对象 - * - * @return {Object} [description] - */ - tail: function tail() { - var ret = null, - len = this._array_h.length(); - if (len) { - ret = this._array_h.at(this._index); - } - return ret; - }, - - /** - * 返回数据队列长度 - * - * @return {Number} [description] - */ - length: function length() { - return this._array_h.length() - this._index; - }, - - /** - * 队列是否为空 - * - * @return {Boolean} [description] - */ - empty: function empty() { - return this._array_h.length() === 0; - }, - - clear: function clear() { - this._array_h.clear(); - } - }; - exports.Queue = Queue; - })(); - - /***/ - } - - /******/ -}); \ No newline at end of file diff --git a/sdk/package.json b/sdk/package.json index 297a67fa..3bfce624 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "easemob-websdk", - "version": "1.4.11", + "version": "1.4.12", "description": "Easemob IM websdk", "main": "index.js", "scripts": { diff --git a/webpack.config.js b/webpack.config.js index 59997d52..c2cea684 100755 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,9 +4,9 @@ path = require('path'); module.exports = { entry: { //add [] to fix: Module not found: Error: a dependency to an entry point is not allowed - './sdk/dist/websdk-1.4.11': ['./sdk/index'], - './demo/javascript/dist/demo-1.4.11': ['./demo/javascript/src/entry'], - './webrtc/dist/webrtc-1.4.11': ['./webrtc/src/entry'] + './sdk/dist/websdk-1.4.12': ['./sdk/index'], + './demo/javascript/dist/demo-1.4.12': ['./demo/javascript/src/entry'], + './webrtc/dist/webrtc-1.4.12': ['./webrtc/src/entry'] }, output: { path: './', diff --git a/webrtc/dist/webrtc-1.4.11.js b/webrtc/dist/webrtc-1.4.12.js similarity index 100% rename from webrtc/dist/webrtc-1.4.11.js rename to webrtc/dist/webrtc-1.4.12.js