!function(a){try{a()}catch(a){}}(function(){function a(){function a(a,b){"keypre"===a&&(f.keypre=b),"domain"===a&&(f.domain=b)}function b(a){return a=f.keypre?f.keypre+a:a,null!==document.cookie.match(new RegExp("(^| )"+a+"="))}function c(a){var b;return a=f.keypre?f.keypre+a:a,b=document.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)")),null!==b?decodeURIComponent(b[2]):null}function d(a,b,c,d,e){var g,h=d||f.keypre,i="",j=e||f.domain||"",k="";c=c||0,"number"==typeof c&&(g=new Date,g.setTime(g.getTime()+1e3*c),i="; expires="+g.toGMTString()),j&&(j="; domain="+j),k="; path=/",a=h?h+a:a,b=escape(b),document.cookie=a+"="+b+i+j+k}function e(a){if("string"==typeof a)b(a)&&d(a,"",-10);else for(var c=0,e=a.length;c','',""].join("")},makePop:function(a,b){var c="index/login",e=window.passport_host+c+"?"+d.util.serialize(b);return d.view.template(e)},makeShadow:function(){return'
'},show:function(a,e,f){if(d.IFRAME.init(),!c.isShow){var g={passport_login_callback:c.CALLBACK.login,passport_reg_callback:c.CALLBACK.reg,passport_close_callback:c.CALLBACK.close,passport_dp_callback:c.CALLBACK.dp,did:window.getDouYuDid||"10000000000000000000000000001501"};e=e||{},e=Object.assign(g,e);var h=d.view.makePop(a,e),i=d.view.makeShadow();b(c.dom.body,h),b(c.dom.body,i),d.view.popDom=document.getElementById("passport-iframe-con"),d.view.shadowDom=document.getElementById("passport-iframe-shadow"),d.view.bindEvt(),d.view.layout(),c.isShow=1,f&&"function"==typeof f&&f()}},layout:function(){var a=d.view.popDom,b=d.view.shadowDom,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;b.style.display="block",b.style.height=c+"px";var e=parseInt(d.util.getStyle(a,"width"),10),f=parseInt(d.util.getStyle(a,"height"),10);a.style.marginTop=-1*f/2+"px",a.style.marginLeft=-1*e/2+"px"},hide:function(a){c.dom.body.removeChild(d.view.shadowDom),c.dom.body.removeChild(d.view.popDom),a&&"function"==typeof a&&a(),c.isShow=0}},d.CALLBACK={register:function(a,b){var d;if(!a)throw new Error("SDK回调函数类型不能为空!");if(!(d=c.CALLBACK[a]))throw new Error("SDK回调类型"+a+"对应函数名称不存在!");window[d]=function(a){b(a)}}},d.PASSPORT={data:{},set:function(a,b,c){var e={};"function"!=typeof a&&"object"!=typeof a&&(e[a]=b,d.PASSPORT.data[c]=e)},get:function(a,b){if(d.PASSPORT.data[b]&&"object"==typeof d.PASSPORT.data[b])return d.PASSPORT.data[b][a]||""}},a.UserJsSDK={init:d.view.init,show:d.view.show,hide:d.view.hide,register:d.CALLBACK.register,POSSPORT:d.PASSPORT}}(window); 百度