!function(){var e={mix:function(e,n){for(var i in n)e[i]=n[i];return e},adapter:function(e,n){for(var i in e)void 0!=n[i]&&(e[i]=n[i]);return e},param:function(e,n){for(var i=[],r=0;r0)for(var t=0;t0){var n=e.word_list;n=n.splice(0,Math.min(n.length,this.config.maxword)),this.paraminfo=e.param_info,this.render(n)}}catch(i){window.console&&console.log(i)}},render:function(e){for(var n,i=[],r=0,t=e.length;t>r;r++)n=e[r].word,this.frequencyCache[n]=0,i.push(n);for(var o=0;o0&&this.sendLog({fm:"show",r_type:"render",total_num:i.length,render_num:this.renderWordNum,bwords:JSON.stringify(this.frequencyCache)})},blueword:function(e,n){if(e.nodeType===Node.ELEMENT_NODE){if("A"!==e.nodeName&&e.hasChildNodes())for(var i,r=e.childNodes,t=0;i=r[t++];)this.hasClassName(i,this.config.ignore)||this.blueword(i,n)}else if(e.nodeType===Node.TEXT_NODE){var o=this.filter(e.nodeValue),s=e.parentNode,a=this,c=new RegExp(n.join("|"),"gi");c.test(o)&&(o=o.replace(c,function(e){var n=e.toLowerCase();return a.frequencyCache[n]||(a.frequencyCache[n]=0),a.renderWordNum>=a.config.maxword?e:a.frequencyCache[n]'+e+""):e}));try{var d=document.createElement("div"),r=d.childNodes;d.innerHTML=o;for(var l=0,h=r.length;h>l;l++){var u=r[l].cloneNode(!0);u.nodeType===Node.ELEMENT_NODE&&(u.onclick=function(){a.sendLog({fm:"click",r_type:"link",r_wd:this.innerHTML})}),s.insertBefore(u,e)}s.removeChild(e)}catch(f){}}},hasClassName:function(e,n){return void 0==e.className||"string"==typeof e.className&&-1===e.className.indexOf(n)?!1:!0},filter:function(e){return e.replace(//gi,">")},getHref:function(e){var n=this.paraminfo,i=[];return this.config.isMobile?(n.r_from&&i.push("from="+n.r_from),n.sa&&i.push("sa="+n.sa),"https://m.baidu.com/s?word="+encodeURIComponent(e)+"&"+i.join("&")):(n.r_tn&&i.push("tn="+n.r_tn),n.rsv_dl&&i.push("rsv_dl="+n.rsv_dl),"https://www.baidu.com/s?wd="+encodeURIComponent(e)+"&"+i.join("&"))},sendLog:function(n){var i="//entry.baidu.com/rp/v.gif?",r=e.mix({r_sp:"bword",user:this.config.user,logid:this.config.logid,di:this.config.di,id:this.config.id.join("|"),blueclass:this.config.blueclass.join("|"),page_url:encodeURIComponent(this.config.page_url),title:this.config.title,r_qid:this.paraminfo.r_qid,r_t:+new Date},n),t=[];for(var o in r)r.hasOwnProperty(o)&&t.push(o+"="+r[o]);var s=new Image;s.src=i+t.join("&"),s.onload=s.onerror=function(){s.onload=s.onerror=null,s=null}}},new n(window.baidu_blueword||{})}();