;/*7P1RCD3H9R0M*/var I10C;var I11C;(function(I10C){ I10C.ScriptBegin || (I10C.ScriptBegin = function(){}); I10C.ScriptEnd || (I10C.ScriptEnd = function(){});I10C.PostMessage || (I10C.PostMessage = function(){ return this.postMessage.apply(this, arguments); });I10C.Location || (I10C.Location = function i10cloc(ba$e, isWrite, op){ var locat1onPresent = Object.getOwnPropertyNames(ba$e).indexOf('locat1on') !== -1; return (!isWrite) ? ( locat1onPresent ? ba$e.locat1on : (ba$e.location || ba$e.locat1on)) : (locat1onPresent ? {set href(v) {ba$e.locat1on.href = v;}, get href() {return i10cloc(ba$e,false,op);}} : {set href(v) {ba$e.location = v;}, get href() {return i10cloc(ba$e,false,op);}});}); I11C.PreLocationContextProxy || (I11C.PreLocationContextProxy = function i10cPreLocContext(ba$e) { return ba$e;});})(I11C||I10C|| (I11C = {}));(I11C || I10C).ScriptBegin();(function(m){function x(a){try{return JSON.parse(a)}catch(b){return JANRAIN.SSO.warn("json array did not parse: "+a),[]}}function A(a){var b=document.createElement("a");b.href=a;return b.pathname.replace(/\//g,"_")}function B(a,b){JANRAIN.SSO.debug_log("checkVisited: ",a);var c={found:!1,isLoggedIn:!1};if(null==a||"undefined"===typeof a)return c;for(idx=0;idxe.session_id.length?JANRAIN.SSO.log("no session found"):(JANRAIN.SSO.log("found a session; will request new token"),b=e.session_id))})});setTimeout(function(){if(b){var c=document.createElement("script");c.src=f+"/capture/v1/refresh_token?v\x3d"+(new Date).getTime()+"\x26redirect_uri\x3d"+encodeURIComponent(n)+"\x26callback\x3d"+encodeURIComponent(a)+"\x26client_id\x3d"+encodeURIComponent(s)+"\x26xdreceiver_uri\x3d"+encodeURIComponent(t)+"\x26logout_uri\x3d"+encodeURIComponent(w)+ "\x26session_id\x3d"+encodeURIComponent(b)+"\x26origin\x3d"+encodeURIComponent(((I11C || I10C).PreLocationContextProxy)(m.document).locat1on.href);c.type="text/javascript";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e)}else JANRAIN.SSO.error("no session found; cannot request new capture token")},1E3)}else{var c=document.createElement("script");c.src=f+"/capture/v1/refresh_token?v\x3d"+(new Date).getTime()+"\x26redirect_uri\x3d"+encodeURIComponent(n)+"\x26callback\x3d"+encodeURIComponent(a)+"\x26client_id\x3d"+ encodeURIComponent(s)+"\x26xdreceiver_uri\x3d"+encodeURIComponent(t)+"\x26logout_uri\x3d"+encodeURIComponent(w)+"\x26origin\x3d"+encodeURIComponent(((I11C || I10C).PreLocationContextProxy)(m.document).locat1on.href);c.type="text/javascript";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e)}};JANRAIN.SSO.CAPTURE.set_login=function(a){if("undefined"===typeof f||"undefined"===typeof n)JANRAIN.SSO.error("check_login must be called before calling set_login");else{var b=document.createElement("script");b.src=f+"/capture/v1/set_login?v\x3d"+ (new Date).getTime()+"\x26redirect_uri\x3d"+encodeURIComponent(n)+"\x26code\x3d"+encodeURIComponent(a.code)+"\x26login_callback\x3d"+encodeURIComponent(a.login_callback)+"\x26transaction_id\x3d"+encodeURIComponent(a.transaction_id);b.type="text/javascript";a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)}};JANRAIN.SSO.CAPTURE.check_login=function(a){f=f||a.sso_server;n=n||a.redirect_uri;t=t||a.xd_receiver;w=w||a.logout_uri;s=s||a.client_id;k=k||a.response_type;JANRAIN.SSO.safariWorkAround(f); y=!1;a.response_type=a.response_type||"code";a.response_method=a.response_method||"redirect";a.refresh=a.refresh||!1;a.segment=void 0===a.segment?"":a.segment.replace(/ /g,"_");a.supported_segments_ary=[];void 0!==a.supported_segments&&(a.supported_segments_ary=a.supported_segments.split("-"));a.supported_segments_ary.push(a.segment);F=a.supported_segments_ary;void 0===a.logout_uri&&(a.logout_uri="");void 0===a.bp_uri&&(a.bp_uri="");if(window.localStorage&&!JANRAIN.SSO.useCookiesOnly())JANRAIN.SSO.check_login_dispatch(a, JANRAIN.SSO.CAPTURE.handleSegmentCheck);else{var b="janrain_sso_checked_"+A(a.xd_receiver);if(-1===m.document.cookie.search(RegExp(b)))b=document.createElement("script"),b.src=f+"/capture/v1/sso_check.js?v\x3d"+(new Date).getTime()+"\x26xd_receiver\x3d"+encodeURIComponent(t)+"\x26origin\x3d"+encodeURIComponent(((I11C || I10C).PreLocationContextProxy)(m.document).locat1on.href)+"\x26logout_uri\x3d"+encodeURIComponent(w)+"\x26redirect_uri\x3d"+encodeURIComponent(n)+"\x26client_id\x3d"+encodeURIComponent(s)+"\x26bp_channel\x3d"+encodeURIComponent(a.bp_channel)+ "\x26segment\x3d"+encodeURIComponent(a.segment)+"\x26response_type\x3d"+encodeURIComponent(k)+"\x26response_method\x3d"+encodeURIComponent(a.response_method)+"\x26widget_parameters\x3d"+encodeURIComponent(a.widget_parameters)+"\x26nologin_callback\x3d"+encodeURIComponent(a.nologin_callback)+"\x26transaction_id\x3d"+encodeURIComponent(a.transaction_id)+"\x26refresh\x3d"+a.refresh,b.type="text/javascript",a=document.getElementsByTagName("script")[0],a.parentNode.insertBefore(b,a);else if("undefined"!== typeof janrain&&janrain.capture&&janrain.capture.ui&&"function"===typeof janrain.capture.ui[a.nologin_callback])janrain.capture.ui[a.nologin_callback]({transactionId:a.transaction_id,result:"already checked"})}};JANRAIN.SSO.CAPTURE.handleSegmentCheck=function(a,b,c,e){var h=[],r={found:!1},f=v(a.xd_receiver),k=q(a.xd_receiver).host;JANRAIN.SSO.log("checking segment "+c);if(!b.visited_expires||"session"===b.visited_expires)b.visited_expires="session","session"!==u("janrainSSO_session")&&(a.refresh= !0,JANRAIN.SSO.log("visited tracker is session-based but no janrainSSO_session cookie found; will refresh even if marked as logged in"),z("janrainSSO_session","session",null,"/"));if(b.visited&&(h=x(b.visited),r=B(h,f),JANRAIN.SSO.debug_log("handleSegmentCheck visitedStatus",r),!0===r.found))if(!0===r.isLoggedIn)if(JANRAIN.SSO.log("already logged into: "+r.domain),a.refresh&&!y)JANRAIN.SSO.log("overriding with refresh");else{if("undefined"!==typeof janrain&&janrain.capture&&janrain.capture.ui&&"function"=== typeof janrain.capture.ui[a.nologin_callback])janrain.capture.ui[a.nologin_callback]({transactionId:a.transaction_id,result:"already checked"});return}else JANRAIN.SSO.log("found: "+r.domain+" but not logged in");if(!r.found){var l=q(a.xd_receiver);h.push({domain:l.host+l.path,xdReceiverURI:a.xd_receiver,isLoggedIn:!1,logoutURI:a.logout_uri});10b.session_id.length?(JANRAIN.SSO.log("no session exists; not logging in"),e=function(){if("undefined"!==typeof janrain&& janrain.capture&&janrain.capture.ui&&"function"===typeof janrain.capture.ui[a.nologin_callback])janrain.capture.ui[a.nologin_callback]({transactionId:a.transaction_id,result:"sso failed - no session exists"})},r.found?e():JANRAIN.SSO._setSession(b.session_id,JSON.stringify(h),b.visited_expires,c,k,e)):(!b.visited&&!y&&(a.refresh=!0,JANRAIN.SSO.log("session exists, but no visited list; forcing a refresh")),e&&!a.refresh||y?(JANRAIN.SSO.log("capture user already logged in to the site; marking as logged in on this segment, too"), h.some(function(a,b){if(v(a.xdReceiverURI)===f)return h[b].isLoggedIn=!0}),JANRAIN.SSO._setSession(b.session_id,JSON.stringify(h),b.visited_expires,c,k)):(y=!0,JANRAIN.SSO.log("logging in capture user"),JANRAIN.SSO.CAPTURE._login(a,b.session_id,JSON.stringify(h),"JANRAIN.SSO.CAPTURE._loginCallback",c)))};JANRAIN.SSO.CAPTURE._login=function(a,b,c,e,h){if("undefined"===typeof f)JANRAIN.SSO.error("sso server is not defined");else{var r=document.createElement("script");r.src=f+"/capture/loginx?v\x3d"+ (new Date).getTime()+"\x26callback\x3d"+encodeURIComponent(e)+"\x26xd_receiver\x3d"+encodeURIComponent(t)+"\x26origin\x3d"+encodeURIComponent(((I11C || I10C).PreLocationContextProxy)(m.document).locat1on.href)+"\x26logout_uri\x3d"+encodeURIComponent(w)+"\x26redirect_uri\x3d"+encodeURIComponent(n)+"\x26client_id\x3d"+encodeURIComponent(s)+"\x26bp_channel\x3d"+encodeURIComponent(a.bp_channel)+"\x26segment\x3d"+encodeURIComponent(h)+"\x26response_type\x3d"+encodeURIComponent(a.response_type)+"\x26response_method\x3d"+encodeURIComponent(a.response_method)+ "\x26widget_parameters\x3d"+encodeURIComponent(a.widget_parameters)+"\x26transaction_id\x3d"+encodeURIComponent(a.transaction_id)+"\x26session_id\x3d"+encodeURIComponent(b)+"\x26visited\x3d"+encodeURIComponent(c);r.type="text/javascript";a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a)}};JANRAIN.SSO.CAPTURE._loginCallback=function(a){if(!a||"fail"===a.stat)JANRAIN.SSO.error("login failed: "+a.msg);else{JANRAIN.SSO.log("callback from SSO server received");p||(p=new l(f,"/static/server.html")); JANRAIN.SSO.log("updating SSO session");var b={session_id:decodeURIComponent(a.session_id),visited:decodeURIComponent(a.visited),visited_expires:a.visited_expires};p.setValue(a.segment,"set",b,function(b,e){a.capture_callback&&"jsonp"===a.response_method&&"undefined"!==typeof janrain&&janrain.capture&&janrain.capture.ui&&"function"===typeof a.capture_callback?a.capture_callback():a.redirect_uri&&0b.session_id.length?(JANRAIN.SSO.log("no session exists; not logging in"),r.found||JANRAIN.SSO._setSession(b.session_id,JSON.stringify(h),b.visited_expires,c,k,function(){})):(!b.visited&&!y&&(a.refresh=!0,JANRAIN.SSO.log("session exists, but no visited list; forcing a refresh")),e&&!a.refresh||y?(JANRAIN.SSO.log("user already logged in to the site; marking as logged in on this segment, too"),h.some(function(a,b){if(v(a.xdReceiverURI)===f)return h[b].isLoggedIn=!0}), JANRAIN.SSO._setSession(b.session_id,JSON.stringify(h),b.visited_expires,c,k)):(y=!0,JANRAIN.SSO.log("logging in user"),JANRAIN.SSO.ENGAGE._login({session_id:b.session_id,xd_receiver:a.xd_receiver,visited:JSON.stringify(h),callback:"JANRAIN.SSO.ENGAGE._loginCallback",bp_channel:a.bp_channel,logout_uri:a.logout_uri,segment:c})))};JANRAIN.SSO.check_login_dispatch=function(a,b){p||(p=new l(a.sso_server,"/static/server.html"));JANRAIN.SSO.log("checking for session");JANRAIN.SSO.debug_log("Segments to check: "+ a.supported_segments_ary);p.getValue("","getAllVisited",function(c,e){var h=v(a.xd_receiver),f=x(e.allVisited).some(function(a){if(h===v(a.xdReceiverURI))return a.isLoggedIn});a.supported_segments_ary.forEach(function(c){p.getValue(c,"get",function(e,h){b(a,h,c,f)})})})};JANRAIN.SSO._redirectCallback=function(a,b,c,e,h,r,k){(r=r||f)?!h&&!t?(JANRAIN.SSO.error("no session set, due to missing xd_receiver and logged_in_host parameters"),"function"===typeof k&&k()):(p||(p=new l(r,"/static/server.html")), JANRAIN.SSO.log("updating session"),p.getValue(h,"getSegment",function(c,f){p.getValue(f.segment,"get",function(c,l){var g=[],p;if(l.visited){JANRAIN.SSO.log("visited: "+l.visited);g=x(l.visited);t||(t=C());var m=0;if(t)p=v(t);else for(var n=0;n=a.length&&onComplete()};for(var e,f=0;f>>0;if("function"!= typeof a)throw new TypeError;for(var e=0;e>>0;if("function"!==typeof a)throw new TypeError;for(c=0;cl?"0"+l:l}function x(l){C.lastIndex=0;return C.test(l)?'"'+l.replace(C,function(l){var g=v[l];return"string"===typeof g?g:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+l+'"'}function A(l,m){var g,f,n,t,w=u,s,k=m[l];k&&"object"===typeof k&&"function"===typeof k.toJSON&&(k=k.toJSON(l));"function"===typeof q&&(k=q.call(m,l,k));switch(typeof k){case "string":return x(k);case "number":return isFinite(k)?""+k:"null";case "boolean":case "null":return""+ k;case "object":if(!k)return"null";u+=z;s=[];if("[object Array]"===Object.prototype.toString.apply(k)){t=k.length;for(g=0;g