if (self.CavalryLogger) { CavalryLogger.start_js(["CpSck"]); } __d("AjaxError",[],(function(a,b,c,d,e,f){a={ERROR:"ar:error",TIMEOUT:"ar:timeout",PROXY_ERROR:"ar:proxy error",TRANSPORT_ERROR:"ar:transport error",SERVER_ERROR:"ar:http error",PARSE_ERROR:"ar:parse error",SERVICE_UNAVAILABLE:"ar:noservice"};e.exports=a}),null); __d("AjaxRequest",["AjaxError","ErrorUtils","Keys","PHPQuerySerializer","TimeSlice","URI","UserAgent_DEPRECATED","ZeroRewrites","clearTimeout","setTimeoutAcrossTransitions"],(function(a,b,c,d,e,f){__p&&__p();var g=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest(),h=[];function a(){var a=h;h=[];a.forEach(function(a){return a.abort()})}function i(a){a.onJSON=a.onError=a.onSuccess=null,b("clearTimeout")(a._timer),a.xhr&&a.xhr.readyState<4&&(a.xhr.abort(),a.xhr=null),h=h.filter(function(b){return b&&b!=a&&b.xhr&&b.xhr.readyState<4})}c=function(){"use strict";__p&&__p();function a(a,c,d){this.timeout=6e4,this.streamMode=!0,this.prelude=/^for \(;;\);/,this.status=null,this.$1=-1,this.$2=null,this.$3=0,this.$4=null,this.json=null,this.errorType=null,this.errorText=null,this.onJSON=null,this.onSuccess=null,this.onError=null,c instanceof b("URI")||(c=new(b("URI"))(c)),this.xhr=b("ZeroRewrites").getTransportBuilderForURI(c)(),d&&a=="GET"&&c.setQueryData(d),this.method=a,this.uri=c,this.xhr.open(a,c)}a.supportsCORS=function(){return g};var c=a.prototype;c.send=function(a){__p&&__p();var c=this,d=b("TimeSlice").getReusableContinuation("AjaxRequest xhr.onreadystatechange");this.xhr.onreadystatechange=function(){return c.$5(d)};var e=this.timeout;e&&(this.$2=b("setTimeoutAcrossTransitions")(function(){c.errorType=b("AjaxError").TIMEOUT,c.errorText="timeout",c.$4=Date.now()-c.$3,c.onError&&c.onError(c),i(c)},e));h.push(this);this.method=="POST"&&this.xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.$3=Date.now();this.xhr.send(a?b("PHPQuerySerializer").serialize(a):"")};c.abort=function(){i(this)};c.toString=function(){var a="[AjaxRequest readyState="+this.xhr.readyState;this.errorType&&(a+=" errorType="+this.errorType,this.errorText&&(a+=" ("+this.errorText+")"));return a+"]"};c.toJSON=function(){var a={};this.json&&(a.json=this.json);this.status&&(a.status=this.status);this.errorType&&(a.errorType=this.errorType,a.uri=this.uri);this.errorText&&(a.errorText=this.errorText);this.$4&&(a.time=this.$4);return a};c.onJSONSafe=function(){this.onJSON&&this.onJSON(this)};c.onSuccessSafe=function(){this.onSuccess&&this.onSuccess(this)};c.onErrorSafe=function(){this.onError&&this.onError(this)};c.$6=function(){__p&&__p();var a;try{this.status=this.xhr.status,a=this.xhr.statusText}catch(a){this.xhr.readyState>=4&&(this.errorType=b("AjaxError").TRANSPORT_ERROR,this.errorText=a.message);return}var c=this.status;if(c==null){this.errorType=b("AjaxError").ERROR;this.errorText="null status code";return}if(c===0&&!/^(file|ftp)/.test(this.uri.toString()))this.errorType=b("AjaxError").TRANSPORT_ERROR;else if(c>=100&&c<200)this.errorType=b("AjaxError").PROXY_ERROR;else if(c>=200&&c<300)return;else if(c>=300&&c<400)this.errorType=b("AjaxError").PROXY_ERROR;else if(c>=400&&c<500)this.errorType=b("AjaxError").SERVER_ERROR;else if(c===503)this.errorType=b("AjaxError").SERVICE_UNAVAILABLE;else if(c>500&&c<600)this.errorType=b("AjaxError").PROXY_ERROR;else if(c==1223)return;else c>=12001&&c<=12156?this.errorType=b("AjaxError").TRANSPORT_ERROR:(a="unrecognized status code: "+c,this.errorType=b("AjaxError").ERROR);this.errorText||(this.errorText=a)};c.$7=function(){__p&&__p();var a,c=this.xhr.readyState;try{a=this.xhr.responseText||""}catch(a){c>=4&&(this.errorType=b("AjaxError").ERROR,this.errorText="responseText not available - "+a.message);return}while(this.xhr){var d=this.$1+1,e=this.streamMode?a.indexOf("\n",d):a.length;e<0&&c==4&&(e=a.length);if(e<=this.$1)break;var f=a;this.streamMode&&(f=a.substr(d,e-d).replace(/^\s*|\s*$/g,""));if(d===0&&this.prelude){var g=this.prelude;g.test(f)&&(f=f.replace(g,""))}this.$1=e;if(f){try{this.json=JSON.parse(f)}catch(c){g=a.match(/(
)/i);e=g!=null&&g.length>0?g[0]:null;g={message:c.message,"char":d,excerpt:(d===0&&e||f).substr(512)};this.errorType=b("AjaxError").PARSE_ERROR;this.errorText="parse error - "+JSON.stringify(g);return}b("ErrorUtils").applyWithGuard(this.onJSONSafe,this)}}};c.$5=function(a){var b=this,c=this.xhr&&this.xhr.readyState||0;this.status==null&&c>=2&&this.$6();!this.errorType&&this.status!=null&&((c===3&&this.streamMode||c===4)&&a(function(){return b.$7()}));(this.errorType||c===4)&&(this.$4=Date.now()-this.$3,a.last(function(){b.errorType?b.onErrorSafe():b.onSuccessSafe(),i(b)}))};return a}();window.addEventListener&&b("UserAgent_DEPRECATED").firefox()&&window.addEventListener("keydown",function(a){a.keyCode===b("Keys").ESC&&a.prevent()},!1);window.attachEvent&&window.attachEvent("onunload",a);e.exports=c}),null); __d("ChannelSubdomain",["Event","JSLogger","Run","LogHistory","clearTimeout","setTimeoutAcrossTransitions","WebStorage"],(function(a,b,c,d,e,f){__p&&__p();var g=b("LogHistory").getInstance("channel"),h=b("JSLogger").create("channel"),i="channel_sub:",j=7,k=100*1e3,l=null,m=null;function n(){var a=b("WebStorage").getLocalStorage();m&&(b("clearTimeout")(m),m=null);a&&l!=null&&a.removeItem(i+l);l=null}function a(a,c,d){__p&&__p();d===void 0&&(d=!1);a=(a-1)*j;d&&(m&&b("clearTimeout")(m),l=m=null);c==null&&(c=Math.floor(Math.random()*a));if(l==null){var e=b("WebStorage").getLocalStorage();if(e){d=[];for(var f=0;f0&&(j=g-this.heartbeats[this.heartbeats.length-1]);i.log("heartbeat_interval",JSON.stringify({client_id:p.sessionID,interval:j}));this.heartbeats.push(g)}break;case"batched":h=d.batches;for(var f=0;f=c){var f=a[e];if(f.type){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","messageReceive."+f.type);if(b("DesktopWebMessageTypesSitevarConfig").ChatProxySupportedMessageTypes.get(f.type)!==!0){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.dropped."+f.type);continue}var g=b("ChannelConstants").getArbiterType(f.type);f.type==="skywalker"?g=b("ChannelConstants").SKYWALKER:f.type==="qprimer"?(f.first=!p.ready,f.first&&(p.ready=!0,p.timeUntilReady=Date.now()-p.created,p.queueMade=f.made),g=b("ChannelConstants").CHANNEL_ESTABLISHED):f.type==="delta"&&(p.sequenceId=f.iseq);try{f.type=="buddylist_overlay"&&f.buffered==1?k?b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.buddylist_overlay.dropped"):(g=b("ChannelConstants").getArbiterType("buddylist_overlay_buffered"),b("Arbiter").inform(g,{obj:f},"persistent")):j&&b("DesktopWebMessageTypesSitevarConfig").MQTTMigrationExcludeMessageTypes.get(f.type)!==!0?b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.migration.list."+f.type):b("Arbiter").inform(g,{obj:f})}catch(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","processMessages.error."+f.type),b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"message threw exception: %s %s",a,f)}}}else i.warn("seq_regression",JSON.stringify({last_seq:c,messages:a.length,seq:d}))}},_enter_init:function(){var a=this;if(r.init>=this.getConfig("MAX_INIT_FAILS",2))return b("setTimeoutAcrossTransitions")(function(){return a.exitState({status:b("ChannelConstants").ERROR_MAX,stateId:q})},0);this._initTimer=b("setTimeoutAcrossTransitions")(function(){return a.exitState({status:b("ChannelConstants").ERROR,stateId:q},"timeout")},p.IFRAME_LOAD_TIMEOUT)},_enter_reconnect:function(a){__p&&__p();var c=this;i.warn("enter_reconnect",a);b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"entered reconnect with reason: %s",a);var d=q;if(!b("PresenceUtil").hasUserCookie()){b("FantailLogger").warn(b("ChannelConstants").FANTAIL_SERVICE,"user has no cookie???");i.warn("no_user_cookie","{}");b("setTimeoutAcrossTransitions")(function(){c._shutdownHint=b("ChannelConstants").HINT_AUTH,c.exitState({status:b("ChannelConstants").ERROR_SHUTDOWN,stateId:d})},0);return}var e={};e.reason=a;e.fb_dtsg=b("DTSG").getToken();b("ISB").token&&(e.fb_isb=b("ISB").token);l&&l(e);var f=new(b("FBAjaxRequest"))("GET","/ajax/presence/reconnect.php",e);f.onSuccess=function(){c.configure(f.json),b("PresenceCookieManager").store(),c.exitState({status:b("ChannelConstants").OK,stateId:d})};f.onError=function(){var a=f.json&&f.json.error;b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"reconnect error: %s",f.errorType);(f.errorType==b("AjaxError").TRANSPORT_ERROR||f.errorType==b("AjaxError").PROXY_ERROR||f.errorType==b("AjaxError").SERVICE_UNAVAILABLE)&&(c._shutdownHint=b("ChannelConstants").HINT_CONN);a&&a==1356007?c._shutdownHint=b("ChannelConstants").HINT_MAINT:a==1357001||a==1357004||a==1348009?c._shutdownHint=b("ChannelConstants").HINT_AUTH:c._shutdownHint=null;c.exitState({status:c._shutdownHint?b("ChannelConstants").ERROR_SHUTDOWN:b("ChannelConstants").ERROR,stateId:d},f)};f.send()},_enter_shutdown:function(){var a=this;b("Arbiter").inform(b("ChannelConstants").ON_SHUTDOWN,{reason:this._shutdownHint});if("shutdown_recovery_interval_seconds"in p&&p.shutdown_recovery_interval_seconds>0){var c=p.shutdown_recovery_interval_seconds*1e3;b("setTimeoutAcrossTransitions")(function(){b("Arbiter").inform(b("ChannelConstants").ATTEMPT_RECONNECT),a._shutdownHint=null,a.state="reconnect!",a.enterState("reconnect!")},c)}},_exit_init:function(a){this._initTimer&&(this._initTimer=b("clearTimeout")(this._initTimer)),a==b("ChannelConstants").ERROR_MAX&&this._sendIframeError(b("ChannelConstants").reason_IFrameLoadGiveUp)},_exit_pull:function(a,c){if(a===b("ChannelConstants").OK){this.lastPullTime=Date.now();return}a="exit status: "+a;c&&c.errorType&&(a+=" ajax request error: "+c.errorType);b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"pull failed with status: %s",a)},_exit_ping:function(a){if(a!==b("ChannelConstants").OK){b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"ping failed with status: %s",a);return}a=Date.now()-(this.lastPullTime||b("Env").start);if(a>p.STALL_THRESHOLD){b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"didnt complete a successful pull for too long");return b("ChannelConstants").ERROR_STALE}},_reportProxyMisguidedMsg:function(a,c){__p&&__p();b("FantailLogger").error(b("ChannelConstants").FANTAIL_SERVICE,"misguided message to %s meant for %s",c,a);var d=Date.now();if(d-this.lastReportOnMisguidedMsgTime<=p.CHANNEL_PROXY_REPORTING_MIN_INTERVAL)return;this.lastReportOnMisguidedMsgTime=d;d={};d.received_uid=a;d.expected_uid=c;p.sticky_token&&(d.sticky_token=p.sticky_token);a=new(b("URI"))("/err_misguided_msg").setDomain(p.host+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(d);c=new(b("AjaxRequest"))("GET",a);b("AjaxRequest").supportsCORS()&&(c.xhr.withCredentials=!0);c.onSuccess=function(a){};c.onError=function(a){};c.onJSON=function(a){};c.send()},_initMonitors:function(){__p&&__p();var a=this,c=Date.now(),d=Date.now(),e={};e.total=0;var f="idle",g=!1;b("SystemEvents").subscribe([b("SystemEvents").USER,b("SystemEvents").ONLINE,b("SystemEvents").TIME_TRAVEL],function(c,e){__p&&__p();w(!0);d=null;a.lastPullTime=Date.now();var f;switch(c){case b("SystemEvents").USER:f=b("SystemEvents").isPageOwner()?b("ChannelConstants").SYS_OWNER:b("ChannelConstants").SYS_NONOWNER;break;case b("SystemEvents").ONLINE:f=e?b("ChannelConstants").SYS_ONLINE:b("ChannelConstants").SYS_OFFLINE;break;case b("SystemEvents").TIME_TRAVEL:if(p.skipTimeTravel)return;if(0 0&&(e[f]=(e[f]||0)+g,e.total+=g)}f=j;d=h;a||(e.lastSuccessTime=t(),e.online=b("SystemEvents").isOnline(),i.log("rollup",JSON.stringify(e)))};b("Arbiter").subscribe(b("ChannelConstants").ON_ENTER_STATE,h);b("setIntervalAcrossTransitions")(h,6e4);b("Arbiter").subscribe(b("JSLogger").DUMP_EVENT,function(a,b){b.channelRollup=e});h=function(){__p&&__p();if(a.isShutdown()||a.shouldIdle())return;b("SystemEvents").checkTimeTravel();var d=Date.now()-(a.lastPullTime||b("Env").start);if(!g&&d>p.STALL_THRESHOLD){var e=t();i.error("stall",JSON.stringify({lastSuccessTime:e,rollupState:f}));b("ChatReliabilityInstrumentation").logCHANNEL_STALLED(d.toString());g=!0}e=Date.now()-(c||0);a.state=="pull"&&e>p.JUMPSTART_THRESHOLD&&(c=null,i.warn("jumpstart",JSON.stringify({state:a.state,dormant:e})),b("Arbiter").inform(b("ChannelConstants").JUMPSTART,e),a.enterState("init"))};b("setIntervalAcrossTransitions")(h,5e3)},_indicateLbInfoUpdated:function(a,c){var d=!b("AjaxRequest").supportsCORS(),e=b("ChannelTransport").isSubdomain(p.subdomain);!e||d?p.fullHost=p.host:p.fullHost=p.subdomain+"-"+p.host;b("FantailLogger").info(b("ChannelConstants").FANTAIL_SERVICE,"received lb info: %s at seq: %s{%s} with ".concat("sticky: %s/%s, subdomain: %s, fullHost: %s, state: %s,").concat(" source: %s, args: %s"),p.sessionID,p.seq,p.sequenceId,p.sticky_token,p.sticky_pool,p.subdomain,p.fullHost,this.state,a,c)},_probeTest:function(){__p&&__p();p.streamingCapable=!1;var a=[],c={};c.mode="stream";c.format="json";p.sticky_token&&(c.sticky_token=p.sticky_token);c=new(b("URI"))("/probe").setDomain(p.fullHost+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(c);b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.attempt");c=new(b("AjaxRequest"))("GET",c);c.onJSON=function(c,d){if(c&&c.json&&c.json.t==="heartbeat"){a.push(Date.now());if(a.length>=2){d=a[1]-a[0];d>=p.PROBE_HEARTBEATS_INTERVAL_LOW&&d<=p.PROBE_HEARTBEATS_INTERVAL_HIGH?(p.streamingCapable=!0,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.switch_to_streaming"),i.log("switch_to_streaming","{}")):b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.delayed")}}};c.onSuccess=function(c){a.length!=2&&(p.streamingCapable=!1,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.data_loss"),i.error("probe_error",JSON.stringify({error:"beats.length = "+a.length}))),b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.success"),i.log("probe_success","{}")};c.onError=function(a){p.streamingCapable=!1,b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","probe.failure.error"),i.error("probe_error",JSON.stringify(a))};c.send()},_sseProbeTest:function(){__p&&__p();if(!window.EventSource){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.no_event_source");i.log("sse_probe.failure.no_event_source","{}");return}var a=[],c={};c.mode="sse";c.format="json";p.sticky_token&&(c.sticky_token=p.sticky_token);c=new(b("URI"))("/sse_probe").setDomain(p.fullHost+"."+p.domain).setPort(p.port).setSecure(new(b("URI"))(window.location.href).isSecure()).setQueryData(c);b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.attempt");var d=new EventSource(c.toString()),e=b("setTimeoutAcrossTransitions")(function(){d.close(),b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.timeout"),i.log("sse_probe.failure.timeout","{}")},p.PROBE_HEARTBEATS_INTERVAL_HIGH*6);d.addEventListener("heartbeat",function(c){a.push(Date.now());if(a.length>=2){c=a[1]-a[0];c>=p.PROBE_HEARTBEATS_INTERVAL_LOW&&c<=p.PROBE_HEARTBEATS_INTERVAL_HIGH?(b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.success"),i.log("sse_probe.success","{}")):(b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.delayed"),i.log("sse_probe.failure.delayed","{}"));b("clearTimeout")(e);d.close()}});d.onerror=function(a){b("BanzaiODS").bumpEntityKey(2966,"ChannelManager","sse_probe.failure.error"),i.error("sse_probe.failure.error",JSON.stringify(a)),b("clearTimeout")(e),d.close()}},startChannelManagerForApp:function(a){this.startChannelManager!==b("emptyFunction")&&this.startChannelManager(),b("ChannelInitialData").channelConfig&&p&&(p.profile=a)},startChannelManager:function(){b("ChannelInitialData").channelConfig?(this.configure(b("ChannelInitialData").channelConfig),/shutdown/.test(b("ChannelInitialData").state)&&(this._shutdownHint=b("ChannelConstants")[b("ChannelInitialData").reason]),this.init(b("ChannelInitialData").state,b("ChannelInitialData").reason),j&&this._mqttInit(),b("ChatReliabilityInstrumentation").logCHANNEL_INIT(),this.startChannelManager=b("emptyFunction")):b("ChatReliabilityInstrumentation").logCHANNEL_NOCONFIG()}};e.exports=c}),null); __d("EmojiDispatcher",["ExplicitRegistrationDispatcher"],(function(a,b,c,d,e,f){"use strict";e.exports=new(b("ExplicitRegistrationDispatcher"))({strict:!1})}),null); __d("EmojiActions",["EmojiDispatcher","keyMirror"],(function(a,b,c,d,e,f){"use strict";__p&&__p();a=b("keyMirror")({CHANGE_CURRENT_CATEGORY:null,CHANGE_EMOJI_COLOR:null,EMOJI_COLOR_READY:null,GET_EMOJI_COLOR:null,TRAY_DATA_READY:null,UPDATE_TRAY_DATA:null});var g={Types:a,loadedTrayData:function(){b("EmojiDispatcher").dispatch({type:g.Types.TRAY_DATA_READY})},updateTrayData:function(){b("EmojiDispatcher").dispatch({type:g.Types.UPDATE_TRAY_DATA})},changeEmojiColor:function(a){b("EmojiDispatcher").dispatch({type:g.Types.CHANGE_EMOJI_COLOR,color:a})},changeCurrentCategory:function(a){b("EmojiDispatcher").dispatch({type:g.Types.CHANGE_CURRENT_CATEGORY,currentCategory:a})},getEmojiColor:function(){b("EmojiDispatcher").dispatch({type:g.Types.GET_EMOJI_COLOR})},emojiColorReady:function(a){b("EmojiDispatcher").dispatch({type:g.Types.EMOJI_COLOR_READY,color:a})}};e.exports=g}),null); __d("FBPaymentsDispatcher",["ExplicitRegistrationReactDispatcher"],(function(a,b,c,d,e,f){"use strict";a=function(a){babelHelpers.inheritsLoose(b,a);function b(b){b=a.call(this,b)||this;babelHelpers.assertThisInitialized(b).dispatch=b.dispatch.bind(babelHelpers.assertThisInitialized(b));return b}return b}(b("ExplicitRegistrationReactDispatcher"));e.exports=new a({strict:!1})}),null); __d("FBPaymentsDialogActions",["FBPaymentsDispatcher","keyMirror"],(function(a,b,c,d,e,f){"use strict";var g={types:b("keyMirror")({SHOW_DIALOG:null,HIDE_DIALOG:null}),showDialog:function(a,c){b("FBPaymentsDispatcher").dispatch({type:g.types.SHOW_DIALOG,data:{dialogClass:a,dialogProps:c}})},hideDialog:function(){b("FBPaymentsDispatcher").dispatch({type:g.types.HIDE_DIALOG,data:{}})}};e.exports=g}),null);