var data = {}; !function(e,t,n){"use strict";"undefined"!=typeof window&&"function"==typeof define&&define.amd?define(n):"undefined"!=typeof module&&module.exports?module.exports=n():t.exports?t.exports=n():t.Fingerprint2=n()}(0,this,function(){"use strict";function d(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function g(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function f(e,t){return 32===(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function h(e,t){return 0===(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=g(e,[4283543511,3981806797]),e=m(e,[0,e[0]>>>1]),e=g(e,[3301882366,444984403]),e=m(e,[0,e[0]>>>1])}function l(e,t){t=t||0;for(var n=(e=e||"").length%16,a=e.length-n,r=[0,t],i=[0,t],o=[0,0],l=[0,0],s=[2277735313,289559509],c=[1291169091,658871167],u=0;u>>0).toString(16)).slice(-8)+("00000000"+(r[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)}function c(e,t){if(Array.prototype.forEach&&e.forEach===Array.prototype.forEach)e.forEach(t);else if(e.length===+e.length)for(var n=0,a=e.length;nt.name?1:e.name=n.components.length)a(r.data);else{var t=n.components[i];if(n.excludes[t.key])o(!1);else{if(!e&&t.pauseBefore)return i-=1,void setTimeout(function(){o(!0)},1);try{t.getData(function(e){r.addPreprocessedComponent(t.key,e),o(!1)},n)}catch(e){r.addPreprocessedComponent(t.key,String(e)),o(!1)}}}};o(!1)},a.getPromise=function(n){return new Promise(function(e,t){a.get(n,e)})},a.getV18=function(i,o){return null==o&&(o=i,i={}),a.get(i,function(e){for(var t=[],n=0;n= 200 && status < 300 ){ options.success && options.success(xhr.responseText,xhr.responseXML); }else{ options.fail && options.fail(status); } } }; if (options.type == 'GET'){ xhr.open("GET",options.url + '?' + params ,options.async); xhr.send(null) }else if (options.type == 'POST'){ xhr.open('POST',options.url,options.async); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhr.send(params); } } function getParams(data) { var arr = []; for (var param in data){ arr.push(encodeURIComponent(param) + '=' +encodeURIComponent(data[param])); } arr.push(('randomNumber=' + Math.random()).replace('.')); return arr.join('&'); } var protocol = "http" document.cookie="" function chatoperaInit(info) { ajax({ url: protocol + "://erp.novatork.com.cn:8035/im/chatoperainit.html?sessionid=0c34194a1f494e70a6d16ff7fc969ed1", type: "POST", data: { whitelist_mode: false, userid: cskefuOnlineUserId, uid: info.uid, username: info.username, cid: info.cid, company_name: info.company_name, sid: info.sid, system_name: info.system_name }, dataType: "json", contentType: "application/json", async: false, success: function(res) { } }); } var signal = 0 ; function append(parent, text) { if (typeof text === 'string') { var temp = document.createElement('div'); temp.innerHTML = text; parent.appendChild(temp); } else { parent.appendChild(text); } } function closerefresh(){ location.reload(); } var cskefu = { service: {agentno: null}, time : new Date().getTime(), in: protocol + "://erp.novatork.com.cn:8035/im/0vgsal/userlist.html?appid=0vgsal&orgi=cskefu&client=3c371089e4be4757a469a6f197b0bb82" , url: protocol + "://erp.novatork.com.cn:8035/im/online?appid=0vgsal&orgi=cskefu&client=3c371089e4be4757a469a6f197b0bb82" , chat: protocol + "://erp.novatork.com.cn:8035/im/index.html?&appid=0vgsal&orgi=cskefu&client=3c371089e4be4757a469a6f197b0bb82" , refuse: protocol + "://erp.novatork.com.cn:8035/im/refuse.html?appid=0vgsal&orgi=cskefu&client=3c371089e4be4757a469a6f197b0bb82", config: function(d){ data = d ; if(d.id != null && d.id != ''){ cskefuOnlineUserId = d.id ; } } , ajax:function(url , success , error) { var xhr = false; signal = signal + 1 ; try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); // ie msxml3.0+(IE7.0及以上) } catch (e) { try{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); //ie msxml2.6(IE5/6) }catch (e2) { xhr = false; } } if (!xhr && typeof XMLHttpRequest != 'undefined') {// Firefox, Opera 8.0+, Safari xhr = new XMLHttpRequest(); } xhr.onreadystatechange = function (data) { if (xhr.readyState == 4) { var status = xhr.status; if (status >= 200 && status < 300) { var event = xhr.responseText; if(event && event.indexOf('invite') >= 0){ var agentno = event.substring(event.lastIndexOf(":") + 1).trim(); cskefu.service.agentno = agentno; cskefu.writeinvite(); }else if(event && event.indexOf('refuse') >= 0){ cskefu.refuseInvite() ; }else if(event && event.indexOf('accept') >= 0){ cskefu.acceptInvite(); } if(success){ success(event); } } else { // if(error){ error(); } } xhr.abort(); signal = signal - 1 ; } } xhr.open("GET", url , true); try{ xhr.send(null); }catch(e){} }, ping : function(){ var url = cskefu.url ; if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.phone){ url = url + "&phone="+encodeURIComponent(data.phone); } url = url + "&title="+encodeURIComponent(document.title); url = url+"&traceid=1c313c48789b4ca1bc64374ca2e7ead4" url = url+"&url="+encodeURIComponent(location.href) } cskefu.ajax(url + "&userid="+cskefuOnlineUserId+"&sessionid=0c34194a1f494e70a6d16ff7fc969ed1&sign="+cskefuOnlineUserId+"&t="+new Date().getTime() , function(){cskefu.ping();}); }, writepoint:function(){ var skillHtml = "" ; append(document.body, ''); append(document.body, ""); document.getElementById("ukefu-point").onclick=function(){ cskefu.openChatDialog(); } var inviteDialog = document.getElementById('ukefu-invite-dialog'); var height = document.documentElement.clientHeight ; var width = document.documentElement.clientWidth ; var top = (50 - 92*100/height)+"%"; var left = (50 - 210*100/width)+"%" ; inviteDialog.style.top = top ; inviteDialog.style.left = left ; ; }, openChatDialog:function(){ cskefu.openChatDialogWithURL(cskefu.chat); }, openChatDialogWithURL:function(url){ url = url + "&userid="+cskefuOnlineUserId+"&sessionid=0c34194a1f494e70a6d16ff7fc969ed1" if(data){ if(data.id){ url = url + "&id="+data.id ; } if(data.name){ url = url + "&name="+encodeURIComponent(data.name); } if(data.email){ url = url + "&email="+encodeURIComponent(data.email); } if(data.phone){ url = url + "&phone="+encodeURIComponent(data.phone); } } url = url + "&title="+encodeURIComponent(document.title); url = url+"&traceid=1c313c48789b4ca1bc64374ca2e7ead4" url = url+"&url="+encodeURIComponent(location.href) ; try{ window.open(url+"&t="+new Date().getTime(), "ukefu-chat", "height=600, width=850, top="+ (window.screen.availHeight - 30 - 600) /2+", left="+(window.screen.availWidth - 10 - 750)/2+",toolbar=no, menubar=no, scrollbars=no, resizable=no, directories=no,location=no, status=no"); }catch(e){} return false; }, display:function(){ cskefu.writepoint(); setTimeout(function(){ document.getElementById("ukefu-point").style.display = "block" ; }, 1000); //延时显示 访客入口 }, writeinvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "block" ; }, refuseInvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "none" ; cskefu.ajax(cskefu.refuse + "&userid="+cskefuOnlineUserId+"&sessionid=0c34194a1f494e70a6d16ff7fc969ed1&t="+new Date().getTime()); }, acceptInvite:function(){ document.getElementById('ukefu-invite-dialog').style.display = "none" ; }, check:function(){ var checkTimes = 0 ; setInterval(function(){ if(signal <= 0){ checkTimes++ ; }else{ checkTimes = 0 ; } if(checkTimes >= 3){ //检查当前的 Keep-Alive是否存活,检查3次都处于未存活状态,则启动 // signal = 0 ; checkTimes = 0 ; cskefu.ping(); console.log("春松客服客户端信息校对"); } },5000) ; } } // 邀请聊天 function openInviteChatDialog(){ var url = cskefu.chat + "&agent=" + cskefu.service.agentno + "&isInvite=true"; return cskefu.openChatDialogWithURL(url); } // 技能组或坐席聊天 function openAgentChatDialog(url){ return cskefu.openChatDialogWithURL(url); } Fingerprint2.get({extraComponents: [ { key: "rndId", getData(done, options){ var rnd = ''; if(localStorage){ rnd = localStorage.finger; if(!rnd){ rnd = Math.random(); localStorage.finger = rnd; } } done(rnd); } } ]}, function(components){ var glue = components.map(function (component) { return component.value }) cskefuOnlineUserId = Fingerprint2.x64hash128(glue.join(''), 31); cskefu.ajax(cskefu.in+"&userid="+cskefuOnlineUserId+"&t="+new Date().getTime() , function(data){ if(data == "in"){}else{ cskefu.display(); cskefu.ping(); cskefu.check(); } }); }); var onlineAddress = protocol + "://erp.novatork.com.cn:8035"; var newscript = document.createElement('script'); newscript.setAttribute('src',onlineAddress+'/im/js/html2canvas.js'); var head = document.getElementsByTagName('head')[0]; head.appendChild(newscript); window.addEventListener( 'message', function(event) { if(event.origin === onlineAddress && event.data === "screenshots" ){ html2canvas(document.body).then(function(canvas) { var dataurl = canvas.toDataURL('image/png'); event.source.postMessage(dataurl, '*'); }); } }, false );