!function(){"use strict";var t={"msg":"站点不存在","status":202};"string"==typeof t&&(t=JSON.parse(t));var e=t,n=function(t){return new Promise(function(e,n){var i="jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),a=document.getElementsByTagName("head")[0],o=document.createElement("script"),r=t.data||{},d=t.url,s=[];r.callback=i;for(var c in r)s.push(c+"="+r[c]);d+=/\?/.test(d)?"&":"?",d+=s.join("&"),o.id=i,o.src=d,window[i]=function(t){e(t);var n=document.getElementById(i);a.removeChild(n)},o.type="text/javascript",a.appendChild(o)})},i=function(t){if("string"!=typeof t)return"";var e=document.createElement("a");return e.href=t,e.hostname},a=function(){return/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?2:1},o=function(t){var e=new RegExp("(^| )"+t+"=([^;]*)(;|$)"),n=e.exec(document.cookie);return n?decodeURIComponent(n[2]):null},r="https://aifanfan.baidu.com/aiinvite/wiseQuery",d="https://aifanfan.baidu.com/static/images/defaultBg.png",s="https://aifanfan.baidu.com/i.gif",c=function(){return(new Date).getTime()+(1e7*Math.random()).toString(16).substr(0,4)+"_"+(new Date).getTime()+"_"+Math.random().toString().substr(2,5)}(),m=function(t){if(0==+e.status&&e.data&&e.data.base){var i={t:(new Date).getTime(),dtype:a(),ua:navigator.userAgent,ucid:e.data.base.ucId||-1,bid:c,siteId:e.data.base.siteId||-1,likeCrm:e.data.base.chatToolType||-1};Object.assign(i,t);n({url:s,data:i}).then(function(t){})}else{var o=+e.status,r=6;if(201===o)return;101===o?r=61:202===o?r=62:203===o?r=63:204===o?r=64:301===o?r=65:999===o&&(r=66);var d={url:s,data:{id:"m3",stopIntelWel:r,t:(new Date).getTime(),dtype:a(),ua:navigator.userAgent,ucid:-1,bid:c,siteId:-1,likeCrm:-1}};n(d).then(function(t){})}},p=null,l=null,g=[],v=0,h=1,u="smartInviteOuter",f=-1,b=0,x={show:function(t){var n=t||6e3,i=g.length;v=Math.floor(Math.random()*i),i>0&&(document.getElementById("smartInviteWelcome").innerHTML=g[v]),clearTimeout(l),l=setTimeout(function(){document.getElementById(u).style.display="block",1==+e.data.base.chatToolType&&g[v]&&window.acceptSmartInvite&&window.acceptSmartInvite(g[v]),1==+e.data.inviteSetting.smartBaseSetting.autoHide&&x.autoHide(),m({id:"m2",text:document.getElementById("smartInviteWelcome").innerText,query:f,nthShowInvite:h}),h++},1e3*n)},hide:function(){clearTimeout(p),document.getElementById(u).style.display="none",1==+e.data.inviteSetting.smartBaseSetting.reInvite&&x.show(e.data.inviteSetting.smartBaseSetting.inviteInterval)},autoHide:function(t){clearTimeout(p),p=setTimeout(function(){x.hide(t)},1e3*e.data.inviteSetting.smartBaseSetting.closeTime)},bindEvent:function(){var t=1===a()?"click":"touchend";document.getElementById("smartInviteClose").addEventListener(t,function(t){x.hide(),t.stopPropagation()}),1==+e.data.inviteSetting.smartBaseSetting.buttonType?(1===a()&&document.getElementById("smartInviteCancel").addEventListener(t,function(){x.hide(),m({id:"m1",type:"reject",query:f}),x.hide()}),document.getElementById("smartInviteAccept").addEventListener(t,function(){x.hide(),m({id:"m1",query:f,type:"accept"}),1==+e.data.base.chatToolType?window.acceptSmartInvite&&window.acceptSmartInvite(g[v],1):2==+e.data.base.chatToolType&&(location.href=e.data.base.customParam.chatUrl)})):document.getElementById("smartInviteOuter").addEventListener(t,function(t){m({id:"m1",type:"accept",query:f,device:a()}),t.stopPropagation(),x.hide(),1==+e.data.base.chatToolType?window.acceptSmartInvite&&window.acceptSmartInvite(g[v],1):2==+e.data.base.chatToolType&&(location.href=e.data.base.customParam.chatUrl)})}},y={pcInit:function(t){var n=e.data.inviteSetting.smartCustomerStyle,i="",a=n.welcome,o=a.replace(/<[^<>]+>/g,""),r=a.match(/style=[\'\"]?([^\'\"]*)[\'\"]?/i)?a.match(/style=[\'\"]?([^\'\"]*)[\'\"]?/i)[1]:"",s="",c=e.data.inviteSetting.smartImgMapping.length;if(e.data.inviteSetting.isOpenSmartStyle)if(c>0){i=n.smartBackImg||d,n.smartBackImg&&(b=1);for(var m=0;m<c;m++)e.data.inviteSetting.smartImgMapping[m].imgText===t.data.imgText&&e.data.inviteSetting.smartImgMapping[m]&&e.data.inviteSetting.smartImgMapping[m].backImg&&(i=e.data.inviteSetting.smartImgMapping[m].backImg,b=1)}else i=n.smartBackImg||d,n.smartBackImg&&(b=1);else i=d,b=0;if(g=t.data&&t.data.smartText&&t.data.smartText.length>0?t.data.smartText:[o],t.data&&t.data.commonContent&&n.isShowComContent&&(g=[o]),t.data&&t.data.startObj&&t.data.startObj.query&&(f=t.data.startObj.query),1===n.isInviteFixed){var p=-e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].width/2+"px",l=-e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].height/2+"px";switch(e.data.inviteSetting.smartBaseSetting.position){case"middle":s="left: 50%; top: 50%; margin-left: "+p+"; margin-top: "+l+";";break;case"left-bottom":s=1===e.data.inviteSetting.smartBaseSetting.acceptFontPosition?"left: 0px; bottom: 0px;":"left: 0px; bottom: 36px;";break;case"right-bottom":s=1===e.data.inviteSetting.smartBaseSetting.acceptFontPosition?"right: 0px; bottom: 0px;":"right: 0px; bottom: 36px;";break;default:s="left: 50%; top: 50%; margin-left: "+p+"; margin-top: "+l+";"}}else{var v=window.innerWidth-e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].width,h=window.innerHeight-e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].height;n.inviteLeft<0&&(n.inviteLeft=0),n.inviteTop<0&&(n.inviteTop=0),1===e.data.inviteSetting.smartBaseSetting.acceptFontPosition?(n.inviteLeft>v&&(n.inviteLeft=v),n.inviteTop>h&&(n.inviteTop=h)):(n.inviteLeft>v&&(n.inviteLeft=v-36),n.inviteTop>h&&(n.inviteTop=h-36)),s="left: "+n.inviteLeft+"px; top: "+n.inviteTop+"px;"}var y='\n        <div id="'+u+'"\n            style="position: fixed; '+s+"\n            background: url('"+i+"') center center no-repeat;\n            background-size: cover;\n            z-index: 9999999999; display: none;\n            width: "+e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].width+"px;\n            height: "+e.data.inviteSetting.smartBaseSetting.inviteTypeData[b].height+'px;">\n            <div id="smartInviteClose"\n                style="cursor:pointer; transform: rotate(-45deg); color: #fff; font-size: 24px;\n                width: 12px; height: 12px; position: absolute; right: 24px; top: 6px;">\n                +\n            </div>\n            '+(1===e.data.inviteSetting.smartBaseSetting.acceptFontPosition?'<div id="smartInviteWelcome"\n                style="position: absolute; top: 50px; right: 16px;\n                width: 212px; font-size: 14px;\n                display: -webkit-box;\n                -webkit-box-orient: vertical;\n                -webkit-line-clamp: 2;\n                overflow: hidden;\n                '+r+'">\n                    '+o+"\n            </div>":"")+"\n            "+(1===e.data.inviteSetting.smartBaseSetting.buttonType?'<div\n                style="display: flex; font-size: 12px;\n                line-height: 28px; text-align: center;\n                position: absolute; right: 20px; bottom: 20px;">\n                <div id="smartInviteCancel"\n                    style="color: '+n.cancelFontColor+";\n                    background: "+n.cancelBgColor+';\n                    border-radius: 3px; width: 72px; height: 28px; cursor: pointer;">\n                    '+e.data.base.cancelTextPc+'\n                </div>\n                <div id="smartInviteAccept"\n                    style="margin-left: 12px; color: '+n.acceptFontColor+";\n                    background: "+n.acceptBgColor+';\n                    border-radius: 3px; width: 72px; height: 28px; cursor: pointer;">\n                    '+e.data.base.acceptTextPc+"\n                </div>\n            </div>":"")+"\n            "+(2===e.data.inviteSetting.smartBaseSetting.acceptFontPosition?'<div \n                style="position: absolute; left: 0; bottom: -36px;\n                height: 36px; width: 100%;\n                line-height: 36px; font-size: 12px;\n                background: rgba(0,0,0,0.5); color: #fff; border-radius: 0 0 3px 3px;">\n                    <div id="smartInviteWelcome"\n                    style="margin-left: 12px;\n                    display: -webkit-box;\n                    -webkit-box-orient: vertical;\n                    -webkit-line-clamp: 1;\n                    overflow: hidden;\n                    '+r+'">\n                        '+o+"\n                </div>\n            </div>":"")+"\n        </div>",w=document.createElement("div");w.innerHTML=y,document.body.appendChild(w),x.show(e.data.inviteSetting.smartBaseSetting.stayTime),x.bindEvent()},pcShow:function(){x.show(e.data.inviteSetting.smartBaseSetting.stayTime)},mobileInit:function(t){var n=e.data.inviteSetting.smartCustomerStyle,i=n.welcome,a=i.replace(/<[^<>]+>/g,""),o=i.match(/style=[\'\"]?([^\'\"]*)[\'\"]?/i)?i.match(/style=[\'\"]?([^\'\"]*)[\'\"]?/i)[1]:"";g=t&&t.data&&t.data.smartText&&t.data.smartText.length>0?t.data.smartText:[a],t.data&&t.data.commonContent&&n.isShowComContent&&(g=[a]),t.data&&t.data.startObj&&t.data.startObj.query&&(f=t.data.startObj.query);var r='\n        <div id="'+u+'"\n            style="position: fixed;\n            left: 0;\n            bottom: 0;\n            z-index: 9999999999;\n            width: 100%;\n            height: 44px;\n            padding: 12px 0;\n            background: #fff;\n            border-top: 1px solid #F0F0F0;\n            display: none">\n            <div style="margin: 0 12px; display: flex; height: 44px;">\n                <div id="smartInviteClose"\n                    style="cursor:pointer;\n                    transform: rotate(-45deg);\n                    color: #fff; font-size: 20px;\n                    background: #D8D8D8;\n                    border-radius: 50%;\n                    margin-top: 13px;\n                    margin-right: 12px;\n                    text-align: center;\n                    line-height: 14px;\n                    flex-shrink: 0;\n                    width: 18px; height: 18px;">\n                    +\n                </div>\n                '+(n.mobileIconImg?' <img src="'+n.mobileIconImg+'"\n                        style="width: 44px;\n                        height: 43px;\n                        flex-shrink: 0;\n                        margin-right: 8px;"\n                    ></img>\n                <div id="smartInviteWelcome"\n                    style="flex:1; font-size: 16px;\n                    display: -webkit-box;\n                    -webkit-box-orient: vertical;\n                    -webkit-line-clamp: 2;\n                    align-self: center;\n                    overflow: hidden;\n                    '+o+'">\n                        '+a+"\n                </div>":' <div id="smartInviteWelcome"\n                    style="flex:1; font-size: 16px;\n                    display: -webkit-box;\n                    -webkit-box-orient: vertical;\n                    -webkit-line-clamp: 2;\n                    align-self: center;\n                    overflow: hidden;\n                    '+o+'">\n                        '+a+"\n                </div>")+'\n                <div id="smartInviteAccept"\n                    style="background-image: linear-gradient(90deg, #F03528 0%, #EF1F1F 100%);\n                    flex-shrink: 0;\n                    width: 57px; height: 28px; line-height: 28px; \n                    color: #fff; font-size: 13px; text-align: center;\n                    border-radius: 100px;\n                    margin-top: 6px; margin-left: 8px;">\n                    '+e.data.base.acceptTextMobile+"\n                </div>\n            </div>\n        </div>",d=document.createElement("div");d.innerHTML=r,document.body.appendChild(d),x.show(e.data.inviteSetting.smartBaseSetting.stayTime),x.bindEvent()},mobileShow:function(){x.show(e.data.inviteSetting.smartBaseSetting.stayTime)}},w={pc:function(t){document.getElementById("smartInvite")?y.pcShow(t):y.pcInit(t)},mobile:function(t){document.getElementById("smartInvite")?y.mobileShow(t):y.mobileInit(t)}},I=function(){};I.prototype.data={referrer:document.referrer},I.prototype.init=function(){if(0===e.status)if(this.data.referrer&&e&&e.data&&e.data.base&&e.data.base.isOpenIntel)if(0==+e.data.inviteSetting.smartBaseSetting.startPage){var t=i(this.data.referrer);t===location.hostname?(m({id:"m3",stopIntelWel:3}),this.showCustomizeInvite()):this.getQuery(r,this.showSmartInvite)}else this.getQuery(r,this.showSmartInvite);else m({id:"m3",stopIntelWel:1}),this.showCustomizeInvite();else m({id:"m3",stopIntelWel:2}),this.showCustomizeInvite()},I.prototype.showCustomizeInvite=function(){this.client(function(){window.showOrdinaryInvite&&window.showOrdinaryInvite()},function(){})},I.prototype.getQuery=function(t,i){var r=this,d={url:t,data:{ucId:e.data.base.ucId,tradeId:e.data.base.tradeId,funType:1,siteId:e.data.base.siteId,baiduId:o("BAIDUID"),refer:encodeURIComponent(this.data.referrer),device:a(),extent:""}};n(d).then(function(t){0==+t.code?1===e.data.base.chatToolType?t.data&&Object.keys(d).length>0?i&&i(t):(m({id:"m3",stopIntelWel:4}),r.showCustomizeInvite()):i&&i(t):(m({id:"m3",stopIntelWel:5}),r.showCustomizeInvite())})},I.prototype.showSmartInvite=function(t){1===a()?w.pc(t):w.mobile(t)},I.prototype.client=function(t,n){e&&e.data&&e.data.base&&e.data.base.chatToolType?1===e.data.base.chatToolType?t&&t():2===e.data.base.chatToolType&&n&&n():window.showOrdinaryInvite&&window.showOrdinaryInvite()},(new I).init()}();