/*!CK:3424901265!*//*1427087293,*/

if (self.CavalryLogger) { CavalryLogger.start_js(["oa8qQ"]); }

__d("GenderConst",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={NOT_A_PERSON:0,FEMALE_SINGULAR:1,MALE_SINGULAR:2,FEMALE_SINGULAR_GUESS:3,MALE_SINGULAR_GUESS:4,MIXED_SINGULAR:5,MIXED_PLURAL:5,NEUTER_SINGULAR:6,UNKNOWN_SINGULAR:7,FEMALE_PLURAL:8,MALE_PLURAL:9,NEUTER_PLURAL:10,UNKNOWN_PLURAL:11,UNKNOWN:0};},null);
__d("MessagesViewerSetID",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={MESSAGES:"messages",MESSAGES_VIEW_ALL_IN_THREAD:"messages:view_all_in_thread"};},null);
__d("MessageTranscriptWaitHandleState",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={BUSY:"BUSY",READY:"READY",UNAVAILABLE:"UNAVAILABLE"};},null);
__d("P2PPaymentLogMessageSubtype",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={CANCELED_SENDER_RISK:"canceled_sender_risk",CANCELED_DECLINED:"canceled_declined",CANCELED_RECIPIENT_RISK:"canceled_recipient_risk",CANCELED_EXPIRED:"canceled_expired",CANCELED_SAME_CARD:"canceled_same_card",CANCELED_CUSTOMER_SERVICE:"canceled_customer_service"};},null);
__d("P2PTransferRiskResult",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={SUCCESS:"SUCCESS",UNDER_MANUAL_REVIEW:"UNDER_MANUAL_REVIEW",REQUIRE_VERIFICATION:"REQUIRE_VERIFICATION"};},null);
__d("StickerAssetType",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports={IMAGE:"BestEffortImage",SPRITE:"SpriteImage",PADDED_SPRITE:"PaddedSpriteImage"};},null);
__d("TypingDetector",["ArbiterMixin","Event","Input","Run","TypingStates","copyProperties","createObjectFrom","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();function o(p,q){this._input=p;this._ignoreKeys={};this._getValueFn=q;}l(o.prototype,g,{_timeout:7000,_currentState:k.INACTIVE,init:function(){this.init=n;this.reset();this._subscription=h.listen(this._input,'keyup',this._update.bind(this));j.onUnload(this._onunload.bind(this));},reset:function(){clearTimeout(this._checkTimer);this._checkTimer=null;this._lastKeystrokeAt=null;this._currentState=k.INACTIVE;},setIgnoreKeys:function(p){this._ignoreKeys=m(p);},destroy:function(){this._subscription.remove();},_onunload:function(){if(this._currentState==k.TYPING)this._transition(k.QUITTING);},_update:function(event){var p=h.getKeyCode(event),q=this._currentState;if(!this._ignoreKeys[p]){var r=this._getValueFn?this._getValueFn():i.getValue(this._input);if(r.trim().length===0){if(q==k.TYPING)this._transition(k.INACTIVE);}else if(q==k.TYPING){this._recordKeystroke();}else if(q==k.INACTIVE){this._transition(k.TYPING);this._recordKeystroke();}}},_transition:function(p){this.reset();this._currentState=p;this.inform('change',p);},_recordKeystroke:function(){this._lastKeystrokeTime=Date.now();if(!this._checkTimer)this._checkTimer=setTimeout(this._checkTyping.bind(this),this._timeout);},_checkTyping:function(){var p=this._lastKeystrokeTime+this._timeout,q=Date.now();if(q>p){this._transition(k.INACTIVE);}else{clearTimeout(this._checkTimer);this._checkTimer=setTimeout(this._checkTyping.bind(this),p-q+10);}}});e.exports=o;},null);
__d("TypingDetectorController",["AsyncRequest","AvailableList","AvailableListConstants","ChannelConnection","ChatVisibility","Keys","TypingDetector","TypingStates","copyProperties","emptyFunction","setTimeoutAcrossTransitions","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();function s(t,u,v,w,x,y){"use strict";this.userID=t;this.input=u;this.source=v;this.threadID=x;this.remoteState=n.INACTIVE;this.notifyTimer=null;w=w||{};this.notifyDelay=w.notifyDelay||this.notifyDelay;this._typingDetector=new m(u,y);this._typingDetector.init(w);this._typingDetector.subscribe('change',this._stateChange.bind(this));}s.prototype.setUserAndThread=function(t,u){"use strict";if(this.userID!==t||this.threadID!==u){this.resetState();this.userID=t;this.threadID=u;}};s.prototype.setIgnoreEnter=function(t){"use strict";var u=t?[l.RETURN]:[];this._typingDetector.setIgnoreKeys(u);};s.prototype.resetState=function(){"use strict";this._notifyState(n.INACTIVE);this.remoteState=n.INACTIVE;this._typingDetector.reset();clearTimeout(this.notifyTimer);this.notifyTimer=null;};s.prototype.destroy=function(){"use strict";this.resetState();this._typingDetector.destroy();};s.prototype._stateChange=function(t,u){"use strict";if(u!=n.QUITTING){clearTimeout(this.notifyTimer);this.notifyTimer=q(r(this._notifyState,this,u),this.notifyDelay);}else this._notifyState(u,true);};s.prototype._notifyState=function(t,u){"use strict";if((!this.userID&&!this.threadID)||!k.isOnline()||t===this.remoteState||j.disconnected())return;this._sendRequest(t,this.userID,u);};s.prototype._sendRequest=function(t,u,v){"use strict";this.remoteState=t;var w={typ:t,to:u,source:this.source,thread:this.threadID};new g().setHandler(this._onTypResponse.bind(this,u)).setErrorHandler(p).setData(w).setURI('/ajax/messaging/typ.php').setAllowCrossPageTransition(true).setOption('asynchronous',!v).send();};s.prototype._onTypResponse=function(t,u){"use strict";var v=u.getPayload()||{};if(v.offline)h.set(t,i.OFFLINE,'typing_response');};o(s.prototype,{notifyDelay:1000});e.exports=s;},null);
__d("VideoCallingTour",["Arbiter","ArbiterMixin","Chat","ChatSidebar","ChatVisibility","CSS","DOM","PresencePrivacy","Run","Toggler","Vector","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();var s,t,u,v,w=[],x=function(){};function y(){if(j.isVisible()){z();}else if(u)aa();}function z(){s.setContext(t.getBody());ba();s.show();ca();}function aa(){if(!v)v=p.createInstance(u.getRoot());var fa=m.scry(u.getRoot(),'div.fbNubFlyout')[0];if(fa){s.setContext(fa);ba();s.show();ca();}}function ba(){var fa=q.getElementDimensions(s.getContext()).y;s.setOffsetY(fa*.6);s.updatePosition();}function ca(){if(u)w.push(u.subscribe('hide',function(){da();if(!j.isVisible())s.hide();}),u.subscribe('show',function(){s.show();}),u.subscribe('resize',function(){ba();s.updatePosition();}));w.push(g.subscribe('sidebar/show',z),g.subscribe('sidebar/hide',aa),g.subscribe('sidebar/resized',ba));}function da(){if(v){v.setSticky(false);v=null;}}function ea(){while(w.length)w.pop().unsubscribe();if(u)da();s.hide();l.show('fbVideoCallingGetStarted');}r(x,h,{start:function(fa){s=fa;l.hide('fbVideoCallingGetStarted');k.goOnline(function(){w.push(n.subscribe('privacy-user-presence-changed',ea));o.onLeave(ea);i.openBuddyList();var ga=null;w.push(j.subscribe('sidebar/initialized',function(ha,ia){t=ia;clearTimeout(ga);ga=setTimeout(y,0);}),x.subscribe('videocallingtour/end',ea));w.push(g.subscribe('buddylist-nub/initialized',function(ha,ia){u=ia;clearTimeout(ga);ga=setTimeout(y,0);}));});x.inform('videocallingtour/start');}});e.exports=x;},null);
__d("ChatMiniSidebarSearchSource",["AbstractSearchSource","AsyncRequest","ChatSortUsers","CurrentUser","MercuryParticipantTypes","OrderedFriendsList","SearchableEntry","SearchSourceCallbackManager","ShortProfiles","TokenizeUtil","copyProperties","emptyFunction","isValidUniqueID"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();'use strict';for(var t in g)if(g.hasOwnProperty(t))v[t]=g[t];var u=g===null?null:g.prototype;v.prototype=Object.create(u);v.prototype.constructor=v;v.__superConstructor__=g;function v(w){this.$ChatMiniSidebarSearchSource0=new n({parseFn:p.parse,matchFn:p.isQueryMatch,indexFn:w.indexFn});this.$ChatMiniSidebarSearchSource1=[];this.$ChatMiniSidebarSearchSource2=w.queryRequests||[];this.$ChatMiniSidebarSearchSource3=false;}v.prototype.bootstrapImpl=function(w){o.fetchAll().then(function(){this.$ChatMiniSidebarSearchSource4();this.$ChatMiniSidebarSearchSource3=true;w();}.bind(this));};v.prototype.searchImpl=function(w,x,y){var z=null,aa={},ba=y&&y.onQueryFinished,ca=y&&y.onQueryStarted,da=this.$ChatMiniSidebarSearchSource0.search(w,function(ga){if(!z){z=ga;z.forEach(function(ha){return aa[ha.getUniqueID()]=true;});}else ga.forEach(function(ha){var ia=ha.getUniqueID();if(!aa[ia]){z.push(ha);aa[ia]=true;}});x(z,w);},y);if(!da||!this.$ChatMiniSidebarSearchSource2||!this.$ChatMiniSidebarSearchSource2.length||w.length<=1){ba&&ba(w);return;}var ea={value:w,existing_ids:z&&z.map(function(ga){return ga.getUniqueID();}).join(','),needs_friends:!this.$ChatMiniSidebarSearchSource3,limit:y.threadLimit};ca&&ca(w);var fa=this.$ChatMiniSidebarSearchSource2.length;this.$ChatMiniSidebarSearchSource2.forEach(function(ga){this.$ChatMiniSidebarSearchSource5(ea,ga,function(ha){this.$ChatMiniSidebarSearchSource6(this.$ChatMiniSidebarSearchSource7(this.$ChatMiniSidebarSearchSource8(ha)),w);fa--;if(fa===0){this.$ChatMiniSidebarSearchSource0.setQueryStringAsExhausted(w);ba&&ba(w);}}.bind(this));}.bind(this),this);};v.prototype.getBootstrappedEntries=function(w){return this.bootstrap(function(){return w(this.$ChatMiniSidebarSearchSource1||[]);}.bind(this));};v.prototype.getAllEntriesMap=function(){return this.$ChatMiniSidebarSearchSource0.getAllEntries();};v.prototype.$ChatMiniSidebarSearchSource4=function(){var w=o.getCachedProfileIDs(),x=w.filter(function(z){var aa=o.getNow(z);return (z==j.getID()||aa.type===k.FRIEND);});x.sort(i.sort);var y=x.map(this.$ChatMiniSidebarSearchSource9);if(y.length){this.$ChatMiniSidebarSearchSource0.addLocalEntries(y);this.$ChatMiniSidebarSearchSource1=this.$ChatMiniSidebarSearchSource1.concat(y);}};v.prototype.$ChatMiniSidebarSearchSource7=function(w){return w.map(this.$ChatMiniSidebarSearchSourcea,this);};v.prototype.$ChatMiniSidebarSearchSourcea=function(w,x){if(w.mercury_thread)return l.normalizeThreadEntry(w,x);var y=w.text,z=w.uid;if(!y||!s(z))return null;return new m({uniqueID:z,title:y,order:l.getActiveRank(z),subtitle:w.subtext,type:w.render_type||w.type,photo:w.photo,uri:w.path,auxiliaryData:{isMessengerUser:w.is_messenger_user}});};v.prototype.$ChatMiniSidebarSearchSource8=function(w){var x=w.getPayload();if(Array.isArray(x)){return x;}else if(x&&x.entries){return x.entries;}else return [];};v.prototype.$ChatMiniSidebarSearchSource9=function(w,x){var y=o.getNow(w),z=w==j.getID()?k.FRIEND:y.type,aa=[y.additionalName,y.alternateName].concat(y.searchTokens||[]).join(' ');return new m({uniqueID:w,title:y.name,order:x,subtitle:y.additionalName,keywordString:aa,type:z,photo:y.thumbSrc,uri:y.uri,auxiliaryData:{isMessengerUser:y.is_messenger_user}});};v.prototype.$ChatMiniSidebarSearchSource5=function(w,x,y,z){new h(x.uri).setData(q({},w,x.data)).setMethod('GET').setReadOnly(true).setHandler(y).setErrorHandler(z||r).setAllowCrossPageTransition(true).send();};v.prototype.$ChatMiniSidebarSearchSource6=function(w,x){if(w.length)this.$ChatMiniSidebarSearchSource0.addQueryEntries(w,x);};v.prototype.addLocalEntries=function(w){this.$ChatMiniSidebarSearchSource0.addLocalEntries(w);};v.prototype.refreshData=function(){o.fetchAll();d(['AvailableList'],function(w){return w.update();});};e.exports=v;},null);
__d("URLScraper",["ArbiterMixin","DataStore","Event","URLMatcher","copyProperties","mixin"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m='scraperLastPermissiveMatch',n=l(g);for(var o in n)if(n.hasOwnProperty(o))q[o]=n[o];var p=n===null?null:n.prototype;q.prototype=Object.create(p);q.prototype.constructor=q;q.__superConstructor__=n;function q(r,s){"use strict";this.input=r;this.enable();this.getValueFn=s;}q.prototype.reset=function(){"use strict";h.set(this.input,m,null);};q.prototype.enable=function(){"use strict";if(this.events)return;var r=function(s){setTimeout(this.check.bind(this,s),30);};this.events=i.listen(this.input,{paste:r.bind(this,false),keydown:r.bind(this,true)});};q.prototype.disable=function(){"use strict";if(!this.events)return;for(var event in this.events)this.events[event].remove();this.events=null;};q.prototype.check=function(r){"use strict";var s=this.getValueFn?this.getValueFn():this.input.value;if(r&&q.trigger(s))return;var t=q.match(s),u=j.permissiveMatch(s);if(u&&(u!=h.get(this.input,m))){h.set(this.input,m,u);this.inform('match',{url:t||u,alt_url:u});}};k(q,j);e.exports=q;},null);
__d("getURLRanges",["URI","URLScraper"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();"use strict";function i(j,k){k=k||0;var l=h.match(j);if(!l)return [];var m=l;if(!(/^[a-z][a-z0-9\-+.]+:\/\//i.test(l)))m='http://'+l;if(!g.isValidURI(m))return [];k+=j.indexOf(l);var n=l.length,o=[{offset:k,length:l.length,entity:{url:m}}];return o.concat(i(j.substr(k+n),k+n));}e.exports=i;},null);
__d("MercuryMessageBody.react",["EmoticonsList","React","Link.react","ReactComponentWithPureRenderMixin","SupportedEmoji","TextWithEntities.react","URI","URLMatcher","cancelAnimationFrame","cx","fbt","getURLRanges","isFacebookURI","requestAnimationFrame"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();var u=h,v=u.PropTypes,w=function(y,z){if(z.entity&&z.entity.url){var aa=new m(z.entity.url);if(s(aa))z.entity.url=aa.addQueryData({__mref:'message_bubble'}).toString();}return (h.createElement(i,{target:"_blank",href:z.entity},y));},x=h.createClass({displayName:"MercuryMessageBody",mixins:[j],propTypes:{body:v.string,ranges:v.array},getInitialState:function(){return {richText:false};},componentDidMount:function(){this._raf=t(function(){delete this._raf;var y=this.props,z=y.body,aa=y.ranges;if((aa&&aa.length)||g.noncapturingRegexp.test(z)||k.findEmoji(z)||n.match(z))this.setState({richText:true});}.bind(this));},componentWillUnmount:function(){this._raf&&o(this._raf);},render:function(){var y=this.props.body||'';if(y.startsWith('?OTR'))return (h.createElement("span",{className:"_89h"},q._("[encrypted message]")));y=y.replace(/\s+$/,'');if(y.length===0)return null;if(!this.state.richText)return h.createElement("span",null,y);var z=this.props.ranges;if(z==undefined)z=r(y);return (h.createElement(l,{interpolator:w,text:y,ranges:z,renderEmoticons:true,renderEmoji:true}));}});e.exports=x;},null);
__d("MercuryMessageError.react",["CurrentUser","ImmutableObject","MercuryErrorInfo","MercuryMessageActions","React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=k,o=n.PropTypes,p=k.createClass({displayName:"MercuryMessageError",propTypes:{authorFBID:o.string,message:o.instanceOf(h).isRequired},getDefaultProps:function(){return {authorFBID:g.getID()};},render:function(){var q=this.props.message,r=q.error_data;return (k.createElement("div",k.__spread({},this.props,{className:m(this.props.className,this._getClassNameFromStatus(q)),tabIndex:i.isTransient(r)?0:null,onClick:i.isTransient(r)?this.messageResend:null}),k.createElement("div",{className:"_2fs1"}),k.createElement("span",{dangerouslySetInnerHTML:{__html:this._getTextFromStatus(q)}})));},messageResend:function(){j.getForFBID(this.props.authorFBID).resend(this.props.message);},_getClassNameFromStatus:function(q){if(i.hasErrorStatus(q)){return (("_2fs2")+(' '+"_2fs3")+(i.isTransient(q.error_data)?' '+"_2fs4":'')+(i.isPermanent(q.error_data)?' '+"_2fs5":''));}else return "_2fs6 _2fs2";},_getTextFromStatus:function(q){var r='',s=q.error_data;if(i.hasErrorStatus(q))r=i.getMessage(s);if(typeof r==='object'&&r.__html)r=r.__html;return r;}});e.exports=p;},null);
__d("MercuryAudioPlayer",["Event","Arbiter","DOM","Flash","UserAgent_DEPRECATED","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=200;function n(){if(k.webkit()&&!k.chrome())return false;var w=i.create('audio'),x=false;try{if(!!w.canPlayType)if(w.canPlayType('video/mp4;').replace(/^no$/,''))x=true;}finally{return x;}}function o(){return j.isAvailable();}var p=function(){this.interval=null;this.arbiterInstance=null;this.audio=i.create('audio');g.listen(this.audio,'playing',function(){this.informAttachment('playing',this.audio.currentTime);this.interval=setInterval(function(){this.informAttachment('playing',this.audio.currentTime);}.bind(this),m);}.bind(this));g.listen(this.audio,'ended',function(){clearInterval(this.interval);this.informAttachment('finished');}.bind(this));};l(p.prototype,{setAudio:function(w,x){this.audio.setAttribute('src',w);this.arbiterInstance=x;},informAttachment:function(w,x){if(this.arbiterInstance)this.arbiterInstance.inform(w,x);},play:function(){this.audio.play();this.informAttachment('played');},resume:function(){this.audio.play();this.informAttachment('played');},pause:function(){this.audio.pause();clearInterval(this.interval);this.informAttachment('paused');},getType:function(){return 'html5';}});var q=function(){this.src=null;this.arbiterInstance=null;var w=i.create('div');document.body.appendChild(w);this.swf=j.embed('/swf/SoundStreamPlayer.swf',w,null,{});this.interval=null;h.subscribe('soundstream/finished',function(){clearInterval(this.interval);this.informAttachment('finished');}.bind(this));};l(q.prototype,{setAudio:function(w,x){this.src=w;this.arbiterInstance=x;},informAttachment:function(w,x){if(this.arbiterInstance)this.arbiterInstance.inform(w,x);},play:function(){this.swf.playSound(this.src);this.interval=setInterval(function(){var w=this.swf.getCurrentTime();this.informAttachment('playing',w);}.bind(this),m);this.informAttachment('played');},resume:function(){this.swf.resume();this.informAttachment('played');},pause:function(){clearInterval(this.interval);this.swf.pause();this.informAttachment('paused');},getType:function(){return 'flash';}});function r(){if(n()){return new p();}else if(o())return new q();return false;}var s=null,t=null,u=0;function v(w,x){this.src=w;this.arbiterInstance=x;this.audio_id=++u;s!==null||(s=r());if(!s)return false;}l(v.prototype,{getType:function(){if(!s){return false;}else return s.getType();},play:function(w){if(w&&t==this.audio_id){s.resume();}else{this.pause();t=this.audio_id;s.setAudio(this.src,this.arbiterInstance);s.play();}},pause:function(){s.pause();}});e.exports=v;},null);
__d("MercuryShareAttachmentRenderLocations",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();'use strict';var g={CHAT:'chat',CHAT_PREVIEW:'chat_preview',MESSENGER:'messenger',WEB_INBOX:'web_inbox',getValues:function(){return [g.CHAT,g.CHAT_PREVIEW,g.MESSENGER,g.WEB_INBOX];},isPreview:function(h){return h===g.CHAT_PREVIEW;}};e.exports=g;},null);
__d("MercuryAttachmentAudioClip.react",["Arbiter","ArbiterMixin","MercuryAudioPlayer","CurrentUser","JSLogger","LeftRight.react","MercuryShareAttachmentRenderLocations","React","SubscriptionsHandler","cx","fbt","joinClasses","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t=n,u=t.PropTypes,v='MercuryAttachmentAudioClip/play',w=k.create('mercury_audio_clip'),x=n.createClass({displayName:"AudioClip",mixins:[h],propTypes:{duration:u.number,location:u.oneOf(m.getValues()),rootClassName:u.string,showHelp:u.bool,src:u.string.isRequired,width:u.number},getInitialState:function(){this.logged=false;var y=this.props.downloadOnly?false:new i(this.props.src,this);return {time:0,playing:false,started:false,duration:this.props.duration,audioPlayer:y};},componentDidMount:function(){this._subscriptionsHandler=new o();this._subscriptionsHandler.addSubscriptions(this.subscribe('playing',this.updateTime),this.subscribe('played',s(this.setState,this,{playing:true,started:true})),this.subscribe('paused',s(this.setState,this,{playing:false})),this.subscribe('finished',s(this.setState,this,{playing:false,started:false,time:this.props.duration})),g.subscribe(v,function(y,z){if(this.props.src!=z)this.setState({time:0});}.bind(this)));},componentWillUnmount:function(){this._subscriptionsHandler&&this._subscriptionsHandler.release();},updateTime:function(y,z){this.setState({time:z});},play:function(){if(this.state.playing){this.state.audioPlayer.pause();}else{this.state.audioPlayer.play(this.state.started);g.inform(v,this.props.src);if(!this.logged){this.logged=true;w.log('play',{uid:j.getID(),duration:this.props.duration});}}},_formatSeconds:function(y){if(y){y=Math.ceil(y);var z=y%60;if(z<10)z='0'+z;var aa=Math.floor(y/60);return aa+':'+z;}else return null;},_renderPlayer:function(y,z){return (n.createElement("a",{className:"_1miz _2e-1",href:"#",style:{width:y},onClick:this.play},n.createElement("span",{className:"_1mi- _2e-2"},n.createElement("i",{className:"_1mi_ _2e-3"})),n.createElement("span",{className:"_1mj0 _2e-4"},z),n.createElement("div",{className:"_1mj1 _2e-5"})));},render:function(){var y=this.state.time,z=this.state.playing,aa=this._formatSeconds(this.state.duration),ba=this.props.location===m.MESSENGER,ca=this.props.width||170;if(ba){var da=this.props.duration;if(da>10){ca=240;}else if(da>5){ca=200;}else if(da>2){ca=160;}else ca=120;}var ea=null,fa=Math.ceil((y*(ca+2))/this.state.duration);if(ba)fa=Math.ceil((y*(ca+24))/this.state.duration);if(this.state.audioPlayer&&this.state.audioPlayer.getType()){var ga=this._renderPlayer(ca,aa),ha=this._renderPlayer(ca,aa),ia=(("_1mj2")+(' '+"_2e-6")+(z&&(y!==0)?' '+"_1mj3":'')+(z&&(y===0)?' '+"_4g4x":''));ea=(n.createElement("div",{className:ia},ga,n.createElement("div",{className:"_1mj4 _2e-7",style:{width:fa}},ha)));}else ea=(n.createElement("div",{className:"_1mj2"},n.createElement("div",{className:"_1miz"},n.createElement(l,null,n.createElement("a",{className:"_1mj5",href:this.props.src},n.createElement("span",{className:"_3qi6"},n.createElement("i",{className:"_1mj6"})),n.createElement("span",{className:"_1mj7"},q._("Voice Message")),n.createElement("span",{className:"_1mj8"},aa)),n.createElement("a",{href:this.props.src,className:"_1mj9"},n.createElement("i",{className:"_1mja"}))))));return (n.createElement("div",{className:r((("_1mjb")+(ba?' '+"_454y":'')),this.props.rootClassName)},ea));}});e.exports=x;},null);
__d("XMessageTranscriptController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/fetch_transcript\/",{message_id:{type:"String",required:true}});},null);
__d("StarsInput.react",["React","TooltipLink.react","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g,l=k.PropTypes,m=g.createClass({displayName:"StarsInput",propTypes:{allowMultipleSubmissions:l.bool,onClick:l.func.isRequired,starLabels:l.array},getDefaultProps:function(){return {allowMultipleSubmissions:false,starLabels:[j._("Poor"),j._("Fair"),j._("Good"),j._("Very Good"),j._("Excellent")]};},getInitialState:function(){return {starRating:0,starsShown:0,canUpdate:true};},_getStarRating:function(n){return parseInt(n.split('.').pop(),10)+1;},onMouseEnter:function(event){if(this.state.canUpdate)this.setState({starsShown:this._getStarRating(event.dispatchMarker)});},onMouseLeave:function(event){if(this.state.canUpdate){var n=this.state.starRating;this.setState({starsShown:n});}},onClick:function(event){if(this.state.canUpdate){var n=this._getStarRating(event.dispatchMarker);this.setState({starRating:n,starsShown:n,canUpdate:this.props.allowMultipleSubmissions});this.props.onClick(n);}},getStars:function(){var n=this.props.starLabels.length,o=[];for(var p=0;p<n;p++)o.push(g.createElement(h,{className:(("mls")+(' '+"_22mm")+(p>=this.state.starsShown?' '+"_22mn":'')+(p<this.state.starsShown?' '+"_22mo":'')+(!this.state.canUpdate?' '+"_1g87":'')),tooltip:this.props.starLabels[p],onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onClick:this.onClick,position:"above",alignH:"center"}));return o;},render:function(){return (g.createElement("div",null,this.getStars()));}});e.exports=m;},null);
__d("Stars.react",["React","cx"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=g,j=i.PropTypes,k=4,l=['emptyStar','onefourthStar','halfStar','threefourthsStar','fullStar'],m=g.createClass({displayName:"Stars",propTypes:{count:j.number.isRequired,max:j.number,size:j.oneOf(['small','large']),title:j.string},getDefaultProps:function(){return {max:5,size:'small'};},getNumSubStars:function(n){return Math.round(n*k);},render:function(){var n=this.getNumSubStars(this.props.count),o=Array.apply(null,{length:this.props.max}).map(function(q,r){return n-r*k;}).map(function(q){return Math.max(0,Math.min(k,q));}).map(function(q){return g.createElement("i",{className:l[q]});}),p=(("uiStars")+(this.props.size==='large'?' '+"largeStars":''));return g.createElement("div",{className:p,title:this.props.title},o);}});e.exports=m;},null);
__d("XMessageTranscriptRatingController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/asr\/transcript\/rate\/",{message_id:{type:"String",required:true},rating:{type:"Int",required:true}});},null);
__d("MercuryAttachmentAudioClipTranscript.react",["AsyncRequest","React","XMessageTranscriptController","MessageTranscriptWaitHandleState","LoadingIndicator.react","StarsInput.react","Stars.react","XMessageTranscriptRatingController","MercuryConfig","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();var r=h.createClass({displayName:"Transcript",fetchTranscript:function(){var s=i.getURIBuilder().setString('message_id',this.props.message_id).getURI();new g(s).setHandler(function(t){var u=t.getPayload();this.setState({transcript:u.transcript?u.transcript.text:null,transcriptState:u.status,transcriptRetryTimeout:u.retryTimeout,rating:u.rating});if(this.state.transcriptState===j.BUSY)setTimeout(this.fetchTranscript,Math.max(this.state.transcriptRetryTimeout,1000));}.bind(this)).send();},componentDidMount:function(){this.fetchTranscript();},getInitialState:function(){return {transcript:null,transcriptState:j.BUSY,transcriptRetryTimeout:null,rating:null};},_submitRating:function(s){var t=n.getURIBuilder().setString('message_id',this.props.message_id).setInt('rating',s).getURI();(new g(t)).send();},render:function(){var s=this.state.transcriptState,t=this.state.transcript,u=null,v=null,w=null;if(s===j.READY){u=h.createElement("p",null,t);if(o.TranscriptRatingGK)if(this.state.rating===null){w=h.createElement(l,{onClick:this._submitRating});}else w=h.createElement(m,{count:this.state.rating});}else if(s===j.UNAVAILABLE){u=(h.createElement("p",null,q._("Transcript unavailable")));}else if(s===j.BUSY)v=h.createElement(k,{size:"small",color:"white"});return (h.createElement("div",{className:"_44v-"},u,w,v));}});e.exports=r;},null);
__d("MercuryAttachmentConstants",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={SIDE_LENGTH:9};e.exports=g;},null);
__d("ChatImageWithArrow.react",["BackgroundImage.react","Link.react","MercuryAttachmentConstants","React","XUISpinner.react","cx","getVendorPrefixedName","joinClasses","keyMirror"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p=j,q=p.PropTypes,r=o({LEFT:null,RIGHT:null,BOTH:null}),s=j.createClass({displayName:"ChatImageWithArrow",propTypes:{arrowDirection:q.oneOf(Object.keys(r)),arrowClassName:q.string,onClick:q.func,height:q.number.isRequired,isLoading:q.bool,rootClassName:q.string,sideLength:q.number,source:q.string,width:q.number.isRequired},getDefaultProps:function(){return {sideLength:i.SIDE_LENGTH,isLoading:false};},_renderLink:function(t){if(this.props.onClick)return (j.createElement(h,{onClick:this.props.onClick},t));return t;},render:function(){this._arrowWidth=this.props.sideLength/Math.sqrt(2);this._extendedPhotoWidth=Math.ceil(this.props.width+this._arrowWidth);if(this.props.isLoading)return this._renderUploadingBubble();var t=n((("_4yp6")+(this.props.arrowDirection!==r.BOTH?' '+"_2nlo":'')),this.props.rootClassName),u,v;switch(this.props.arrowDirection){case r.BOTH:u=[this._renderArrowWithBorder(r.LEFT),this._renderArrowWithBorder(r.RIGHT)];v=[this._renderArrowWithNoBorder(r.LEFT),this._renderArrowWithNoBorder(r.RIGHT)];break;case r.LEFT:case r.RIGHT:u=this._renderArrowWithBorder(this.props.arrowDirection);v=this._renderArrowWithNoBorder(this.props.arrowDirection);break;}return this._renderLink(j.createElement("div",{className:t},u,j.createElement("div",{className:"_4yp8",style:{width:this.props.width,height:this.props.height}},j.createElement("div",{className:"_4yp9",style:{backgroundImage:'url('+this.props.source+')',width:this._extendedPhotoWidth,height:this.props.height}})),v));},_calculateArrowTransform:function(t,u,v,w){if(u===r.LEFT){return 'translate('+v+'px, '+w+'px)'+'rotate(45deg)';}else return 'translate('+(t-v)+'px, '+w+'px)'+'rotate(45deg)';},_calculateArrowImageTransform:function(t,u,v,w){if(u===r.LEFT){return 'rotate(-45deg)'+'translate(-'+(this._arrowWidth+v)+'px,'+'-'+w+'px)';}else return 'rotate(-45deg)'+'translate(-'+(t-v)+'px, -'+w+'px)';},_renderUploadingBubble:function(){var t={width:this.props.sideLength,height:this.props.sideLength},u={width:this.props.sideLength,height:this.props.sideLength},v=m('transform');if(v){t[v]=this._calculateArrowTransform(this.props.width,this.props.arrowDirection,0,this.props.sideLength);u[v]=this._calculateArrowTransform(this.props.width,this.props.arrowDirection,0,Math.floor(this.props.sideLength-this.props.height));}return (j.createElement("div",{className:"_4yp6"},j.createElement("div",{className:"_4ypa",style:t}),j.createElement("div",{className:"_4ypb",style:{width:this.props.width,height:this.props.height}},j.createElement(k,{size:"small"})),j.createElement("div",{className:"_4ype",style:u})));},_renderArrowWithBorder:function(t){var u={width:this.props.sideLength,height:this.props.sideLength},v={},w=m('transform');if(w){u[w]=this._calculateArrowTransform(this.props.width,t,0,this.props.sideLength);v[w]=this._calculateArrowImageTransform(this.props.width,t,0,this.props.sideLength);return (j.createElement("div",{className:n((("_4ypf")+(t===r.LEFT?' '+"_2nlp":'')+(t===r.RIGHT?' '+"_2nlq":'')),this.props.arrowClassName),style:u},j.createElement(g,{backgroundSize:"cover",className:"_4ypg",height:this.props.height,src:this.props.source,style:v,width:this._extendedPhotoWidth})));}},_renderArrowWithNoBorder:function(t){var u={width:this.props.sideLength,height:this.props.sideLength},v={},w=1,x=m('transform');if(x){u[x]=this._calculateArrowTransform(this.props.width,t,w,this.props.sideLength-this.props.height);v[x]=this._calculateArrowImageTransform(this.props.width,t,w,this.props.sideLength);}return (j.createElement("div",{className:n((("_4yph")+(t===r.LEFT?' '+"_2nlp":'')+(t===r.RIGHT?' '+"_2nlq":'')),this.props.arrowClassName),style:u},j.createElement(g,{backgroundSize:"cover",className:"_4ypg",height:this.props.height,src:this.props.source,style:v,width:this._extendedPhotoWidth})));}});e.exports=s;},null);
__d("MercuryAttachmentPhoto.react",["Bootloader","ChatImageWithArrow.react","MercuryMessageInfo","React","cx"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=j,m=l.PropTypes,n=j.createClass({displayName:"MercuryAttachmentPhoto",propTypes:{height:m.number,image:m.object.isRequired,message:m.object.isRequired,width:m.number},_handleClickPicture:function(o){var p=this.props.image;g.loadModules(["MessagesViewer"],function(q){q.bootstrapWithConfig({src:p.preview_url,endpoint:p.url,fbid:p.metadata.fbid,dimensions:p.metadata.dimensions,disablePaging:true},null);});},render:function(){var o=i.isInbound(this.props.message);return (j.createElement("div",{className:"_1rqb"},j.createElement(h,{arrowDirection:o?"LEFT":"RIGHT",source:this.props.image.preview_url,height:this.props.height,width:this.props.width,onClick:this._handleClickPicture,isLoading:!!this.props.image.preview_uploading})));}});e.exports=n;},null);
__d("ChatGridImage.react",["Link.react","React","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=h,k=j.PropTypes,l=h.createClass({displayName:"ChatGridImage",propTypes:{isLoading:k.bool,onClick:k.func,size:k.number.isRequired,source:k.string},render:function(){if(this.props.isLoading)return (h.createElement("div",{className:"_4ypb",style:{width:this.props.size,height:this.props.size}}));return (h.createElement(g,{onClick:this.props.onClick},h.createElement("div",{className:"_332l",style:{backgroundImage:'url('+this.props.source+')',width:this.props.size,height:this.props.size}})));}});e.exports=l;},null);
__d("MercuryAttachmentPhotoGrid.react",["Bootloader","ChatGridImage.react","ChatImageWithArrow.react","Grid.react","MercuryAttachmentType","MercuryMessageInfo","React","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();'use strict';var o=j.GridItem,p=m,q=p.PropTypes,r=m.createClass({displayName:"MercuryAttachmentPhotoGrid",propTypes:{images:q.arrayOf(q.object).isRequired,size:q.number.isRequired,message:q.object.isRequired},_generateClickHandler:function(s){var t=this.props.images.some(function(u){return u.attach_type===k.ANIMATED_IMAGE;});return (function(u){g.loadModules(["MessagesViewer"],function(v){v.bootstrapWithConfig({src:s.preview_url,endpoint:s.url,fbid:s.metadata.fbid,dimensions:s.metadata.dimensions,disablePaging:t},null);});});},render:function(){var s=this.props.images,t=s.length,u=(t==2||t==4)?2:3,v=Math.floor(this.props.size/u),w=l.isInbound(this.props.message),x=w?0:u-1,y=[];for(var z=0;z<s.length;z++)if(z===x){y.push(m.createElement(o,{key:z},m.createElement(i,{arrowDirection:w?'LEFT':'RIGHT',source:s[z].preview_url,height:v,width:v,isLoading:!!s[z].preview_uploading,onClick:this._generateClickHandler(s[z])})));}else y.push(m.createElement(o,{key:z},m.createElement(h,{isLoading:!!s[z].preview_uploading,onClick:this._generateClickHandler(s[z]),size:v,source:s[z].preview_url})));return (m.createElement(j,{cols:u,className:"_5b2w",spacing:"_5b2x",alignh:"right"},y));}});e.exports=r;},null);
__d("MessagingRecipientSelectedList.react",["Image.react","LeftRight.react","Map","MessagingRecipientTypeaheadItem.react","React","cx","fbt","xuiglyph"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=k,p=o.PropTypes,q=k.createClass({displayName:"MessagingRecipientSelectedList",propTypes:{entries:p.instanceOf(i),onSelect:p.func.isRequired},_renderSelectedEntry:function(r){var s=n({name:'cross',shade:'dark',size:'small'});return (k.createElement(j,{key:r.getUniqueID(),entry:r,imageSize:24,onSelect:this.props.onSelect},k.createElement(g,{className:"_1jm4",src:s})));},render:function(){var r=(m._("Selected")),s=[];this.props.entries.forEach(function(t){return s.push(this._renderSelectedEntry(t));}.bind(this));return (k.createElement("div",{className:"_1jm5"},k.createElement(h,{className:"_1jm6 _2ph-"},k.createElement("span",null,r),k.createElement("span",null,this.props.entries.size)),k.createElement("ul",null,s)));}});e.exports=q;},null);
__d("MessagingRecipientTypeaheadView.react",["CenteredContainer.react","Link.react","Map","MessagingRecipientTypeaheadItem.react","React","TypeaheadViewPropTypes","XUISpinner.react","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=k,q=p.PropTypes,r=32,s=k.createClass({displayName:"MessagingRecipientTypeaheadView",propTypes:Object.assign({},l,{selectedEntries:q.instanceOf(i),loading:q.bool}),getDefaultProps:function(){return {role:'listbox'};},_renderItem:function(t){var u=t===this.props.highlightedEntry,v=this.props.selectedEntries.has(t.getUniqueID());return (k.createElement(j,{key:t.getUniqueID(),entry:t,highlighted:u,imageSize:r,selected:v,onSelect:this.props.onSelect,onHighlight:this.props.onHighlight,onRenderHighlight:this.props.onRenderHighlight},k.createElement(h,{"aria-checked":v,className:(("_3hqy")+(v?' '+"_3hqz":'')+(!v?' '+"_3hq-":'')),href:"#",role:"checkbox",tabIndex:"0"})));},render:function(){if(this.props.entries.length===0&&!this.props.loading)return (k.createElement(g,{className:"_2pi1"},o._("No results")));return (k.createElement("ul",{id:this.props.ariaOwneeID,className:"_51do",role:this.props.role},this.props.entries.map(this._renderItem),k.createElement("div",{className:"_51dq"},this.props.loading?k.createElement(m,null):null)));}});e.exports=s;},null);
__d("XMessagingForwardAttachmentController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/mercury\/attachments\/forward\/",{});},null);
__d("MessagingForwardAttachmentDialog.react",["AsyncRequest","ChatMiniSidebarSearchSource","Image.react","LayerFadeOnHide","Layout.react","Map","MessagingRecipientSelectedList.react","MessagingRecipientTypeaheadView.react","OrderedFriendsList","React","SearchableTextInput.react","ScrollableArea.react","XMessagingForwardAttachmentController","XUIDialog.react","XUIDialogBody.react","XUIDialogButton.react","XUIDialogCancelButton.react","XUIDialogFooter.react","XUIDialogTitle.react","XUISpinner.react","cx","fbt","xuiglyph"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca){b.__markCompiled&&b.__markCompiled();var da=k.Column,ea=k.FillColumn,fa=p,ga=fa.PropTypes,ha=p.createClass({displayName:"MessagingForwardAttachmentDialog",propTypes:{attachmentID:ga.string.isRequired,onClose:ga.func,shown:ga.bool.isRequired,title:ga.string.isRequired},getInitialState:function(){return {bootstrappedEntries:[],entries:[],loading:true,selectedEntries:new l(),sendError:null,sending:false,startingThreadingID:Date.now(),query:''};},componentDidMount:function(){this._dataSource=new h({queryRequests:[{uri:'/ajax/mercury/composer_query.php'}]});o.getSearchableEntries(20,function(ia){this.setState({bootstrappedEntries:ia,loading:false});}.bind(this));},_onSelectEntry:function(ia){var ja=ia.getUniqueID(),ka=new l(this.state.selectedEntries);if(ka.has(ja)){ka["delete"](ja);}else ka.set(ja,ia);this.setState({selectedEntries:ka});},_onSearchChange:function(ia){var ja=ia.target.value;this.setState({loading:true,query:ja});},_onSearchEntriesFound:function(ia){this.setState({entries:ia});},_onSearchFinished:function(ia){ia===this.state.query&&this.setState({loading:false});},_onSubmit:function(){var ia={},ja=this.state.startingThreadingID;this.state.selectedEntries.forEach(function(la){ia[ja++]=la.getUniqueID();});var ka=s.getURIBuilder().getURI();new g(ka).setMethod('POST').setHandler(this._onSubmitResponse).setData({attachment_id:this.props.attachmentID,recipient_map:ia}).send();this.setState({sending:true,sendError:null});},_onSubmitResponse:function(ia){if(ia.payload.success){this.props.onClose&&this.props.onClose();this.setState({bootstrappedEntries:[],selectedEntries:new l(),sending:false,startingThreadID:Date.now(),query:''});return;}this.setState({sending:false,sendError:ia.payload.error});},render:function(){var ia=(ba._("Send Message"));if(this.state.selectedEntries.size>1)ia=(ba._("Send Messages"));var ja=null;if(this.state.sending){ja=(p.createElement("div",null,p.createElement(z,null),p.createElement("span",{className:"_5s0d _3-99"},ba._("Sending"))));}else if(this.state.sendError){var ka=ca({name:'error-solid',shade:'dark',size:'medium'});ja=(p.createElement("div",{className:"_5s0d"},p.createElement(i,{src:ka}),p.createElement("span",{className:"_3-99"},this.state.sendError)));}return (p.createElement(t,{shown:this.props.shown,behaviors:{LayerFadeOnHide:j},width:560},p.createElement(y,null,this.props.title),p.createElement(u,{useCustomPadding:true},p.createElement(k,null,p.createElement(da,{className:"_5s0e"},p.createElement("div",{className:"_2ph_"},p.createElement(q,{className:"_5s0f",onChange:this._onSearchChange,onEntriesFound:this._onSearchEntriesFound,placeholder:ba._("Search"),queryString:this.state.query,searchSource:this._dataSource,searchSourceOptions:{onQueryFinished:this._onSearchFinished}})),p.createElement(r,{className:"_5s0g",fade:true,height:400,width:360},p.createElement(n,{entries:this.state.query?this.state.entries:this.state.bootstrappedEntries,loading:this.state.loading,selectedEntries:this.state.selectedEntries,onSelect:this._onSelectEntry}))),p.createElement(ea,{className:"_5s0h"},p.createElement(r,{fade:true,height:457,shadow:false},p.createElement(m,{entries:this.state.selectedEntries,onSelect:this._onSelectEntry}))))),p.createElement(x,{leftContent:ja},p.createElement(w,null),p.createElement(v,{use:"confirm",disabled:!this.state.selectedEntries.size||this.state.sending,label:ia,onClick:this._onSubmit}))));}});e.exports=ha;},null);
__d("Spotlight.react",["LayerHideOnBlur","LayerHideOnEscape","ReactLayer","Spotlight"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=i.createClass({getDefaultEnabledBehaviors:function(){return {hideOnBlur:g,hideOnEscape:h};},createLayer:function(l){var m=this.enumerateBehaviors(this.props.behaviors),n={addedBehaviors:m,rootClassName:this.props.rootClassName},o=new j(n,l);o.conditionShow(this.props.shown);if(this.props.onBeforeHide)o.subscribe('beforehide',this.props.onBeforeHide);if(this.props.onHide)o.subscribe('hide',this.props.onHide);return o;},receiveProps:function(l){this.layer.conditionShow(l.shown);}});e.exports=k;},null);
__d("SpotlightViewer",["React","ReactLayeredComponentMixin","Spotlight.react","cx"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=g.createClass({displayName:"SpotlightViewer",mixins:[h],renderLayers:function(){if(!this.props.open)return null;var l="_n3";if(this.props.className)l+=' '+this.props.className;return {photoLayer:g.createElement(i,{onBeforeHide:this.props.onBeforeHide,onHide:this.props.onHide,rootClassName:this.props.rootClassName,shown:this.props.open},g.createElement("div",{className:l,onClick:this.props.onClick},this.props.children))};},render:function(){return (g.createElement("div",null));}});e.exports=k;},null);
__d("SpotlightViewerBehaviorsMixin",["BehaviorsMixin","copyProperties"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i={componentWillMount:function(){this.behaviors&&this.enableBehaviors(this.behaviors);},componentWillUnmount:function(){this.destroyBehaviors();}};h(i,g);e.exports=i;},null);
__d("SpotlightViewerBottomBar",["LeftRight.react","React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=h.createClass({displayName:"SpotlightViewerBottomBar",render:function(){var l=Array.isArray(this.props.children)?this.props.children:[this.props.children],m="_4_8n _51an";if(this.props.className)m=j(m,this.props.className);if(l.length===1)return (h.createElement("div",{className:m},l[0]));m=j(m,"_50-m");return (h.createElement(g,{className:m},l[0],l[1]));}});e.exports=k;},null);
__d("SpotlightViewerPageWithKeys",["KeyEventController","SubscriptionsHandler"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();function i(j){"use strict";this.$SpotlightViewerPageWithKeys0=j;}i.prototype.enable=function(){"use strict";this.$SpotlightViewerPageWithKeys1=new h();this.$SpotlightViewerPageWithKeys1.addSubscriptions(g.registerKey('LEFT',function(){this.$SpotlightViewerPageWithKeys0.viewState.backward();return false;}.bind(this)),g.registerKey('RIGHT',function(){this.$SpotlightViewerPageWithKeys0.viewState.forward();return false;}.bind(this)));};i.prototype.disable=function(){"use strict";this.$SpotlightViewerPageWithKeys1.release();delete this.$SpotlightViewerPageWithKeys1;};e.exports=i;},null);
__d("SpotlightViewerThumbnailMixin",["PhotoStore","Vector"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i={_getInitialPhotoData:function(){var j=g.getIndexForID(this.props.setid,this.props.photoid),k=g.getByIndexImmediate(this.props.setid,j);return k?k:this._getThumbnailPhotoData();},_getThumbnailPhotoData:function(){if(!this.props.dimensions||!this.props.thumbsrc)return null;var j={id:this.props.photoid};for(var k=0;k<this.props.dimensions.length;++k){var l=h.deserialize(this.props.dimensions[k]);j['image'+k]={width:l.x,height:l.y,uri:this.props.thumbsrc};}return j;}};e.exports=i;},null);
__d("XMessagingPhotoDownloadController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/mercury\/attachments\/photo\/",{photo_id:{type:"String",required:true}});},null);
__d("SpotlightMessagesViewer",["ArbiterMixin","MercuryConfig","MessagingForwardAttachmentDialog.react","PageTransitions","React","ReactLayeredComponentMixin","SpotlightViewer","SpotlightViewerAutoResize","SpotlightViewerBehaviorsMixin","SpotlightViewerBottomBar","SpotlightViewerBottomBarGroup","SpotlightViewerBottomBarLink","SpotlightViewerClose","SpotlightViewerCoreMixin","SpotlightViewerDimensionMixin","SpotlightViewerPagers","SpotlightViewerPageWithKeys","SpotlightViewerThumbnailMixin","SpotlightViewport","SubscriptionsHandler","XMessagingPhotoDownloadController","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba){b.__markCompiled&&b.__markCompiled();var ca=k.createClass({displayName:"SpotlightMessagesViewer",mixins:[g,l,o,t,x,u],behaviors:[w,n],componentWillUnmount:function(){this._subscriptions&&this._subscriptions.release();this._subscriptions=null;},getViewerID:function(){return this.props.setid;},getInitialState:function(){this._subscriptions=new z();return {photoData:this._getInitialPhotoData(),open:true,showForward:false};},_enableSubscriptions:function(){this.props.useloadingindicator&&this._subscriptions.addSubscriptions(this.viewState.subscribe('photo_fetch',function(){return this.setState({photoData:null});}.bind(this)));},_showForwardDialog:function(){this.setState({showForward:true});},_hideForwardDialog:function(){this.setState({showForward:false});},renderLayers:function(){if(this.props.disableForward)return {};var da=(ba._("Send this photo to friends"));return {forwardDialog:(k.createElement(i,{attachmentID:String(this.state.photoData.id),onClose:this._hideForwardDialog,shown:this.state.showForward,title:da}))};},render:function(){var da=this.getMedia(),ea=this.getStageDimensions(),fa=this.props.useloadingindicator&&!this.state.photoData;j.registerCompletionCallback(function(){if(this.state.open)this.close();return true;}.bind(this));return (k.createElement(m,{rootClassName:this.props.rootClassName,open:this.state.open,onHide:this.close},k.createElement(y,{onClick:this._onClickViewport,stageDimensions:ea,media:da,snapToPhoto:this.props.snapToPhoto,showLoadingIndicator:fa},k.createElement(s,{onClick:this.close}),this.props.disablepaging?null:k.createElement(v,null),this._renderBottomBar())));},_renderBottomBar:function(){var da;if(h.ForwardingEnabled&&!this.props.disableForward)da=(k.createElement(r,{onClick:this._showForwardDialog},ba._("Send")));var ea=aa.getURIBuilder().setString('photo_id',String(this.state.photoData.id)).getURI();return (k.createElement(p,null,k.createElement(q,null),k.createElement(q,null,da,k.createElement(r,{rel:"async",ajaxify:ea},ba._("Download")))));}});e.exports=ca;},null);
__d("MessagesViewer",["AsyncRequest","DOM","MessagesViewerSetID","PhotoStore","React","SpotlightMessagesViewer","ge"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();var n={bootstrapWithElem:function(o){n.bootstrapWithConfig({fbid:o.getAttribute('data-fbid'),dimensions:o.getAttribute('data-dimensions'),src:o.getAttribute('href'),endpoint:o.getAttribute('data-endpoint'),disablePaging:o.getAttribute('data-disablepaging')},o);},bootstrapWithConfig:function(o,p){var q=o.setID;if(!q)q=i.MESSAGES;var r=k.createElement(l,{dimensions:[o.dimensions],disablepaging:o.disablePaging,disableForward:o.disableForward,open:true,photoid:o.fbid,reverse:false,rootClassName:o.rootClassName,setid:q,snapToPhoto:o.snapToPhoto,thumbsrc:o.src});n.render(r);if(!j.hasBeenCreated(q)&&o.endpoint){var s=new g(o.endpoint);if(p)s.setRelativeTo(p);s.send();}},render:function(o){var p=m('messages_viewer');if(!p){p=h.create('div',{id:'messages_viewer'});document.body.appendChild(p);}o=k.render(o,p);o.subscribeOnce('close',function(){k.unmountComponentAtNode(p);});}};e.exports=n;},null);
__d("XMessagingVideoAttachmentController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/mercury\/attachments\/video\/",{video_id:{type:"String",required:true},video_container_id:{type:"String",required:true},width:{type:"Int",required:true},height:{type:"Int",required:true}});},null);
__d("MessagingVideoViewer.react",["ActorURI","ArbiterMixin","AsyncRequest","MercuryConfig","MessagingForwardAttachmentDialog.react","React","ReactLayeredComponentMixin","SpotlightViewer","SpotlightViewerBottomBar","SpotlightViewerBottomBarGroup","SpotlightViewerBottomBarLink","SpotlightViewerClose","SpotlightViewport","PageTransitions","PhotoViewerDimensions","XMessagingVideoAttachmentController","Vector","cx","fbt","guid"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){b.__markCompiled&&b.__markCompiled();var aa=l,ba=aa.PropTypes,ca=200,da=l.createClass({displayName:"MessagingVideoViewer",propTypes:{pageID:ba.number,rootClassName:ba.string,videoSize:ba.instanceOf(w).isRequired,videoID:ba.string.isRequired,videoURI:ba.string.isRequired},mixins:[h,m],getInitialState:function(){var ea=new u({verticalPadding:ca});return {dimensions:ea.getStageDimensions(this.props.videoSize),loading:true,open:true,showForward:false};},componentWillMount:function(){this._domID=z();},componentDidMount:function(){this._loadVideoPlayer();t.registerCompletionCallback(function(){this.close();return true;}.bind(this));},_loadVideoPlayer:function(){var ea=v.getURIBuilder().setString('video_id',this.props.videoID).setString('video_container_id',this._domID).setInt('width',this.state.dimensions.x).setInt('height',this.state.dimensions.y).getURI();if(this.props.pageID)ea=g.create(ea,this.props.pageID);this.request=new i().setMethod('GET').setURI(ea).setReadOnly(true).setHandler(function(fa){return this.setState({loading:false});}.bind(this)).send();},close:function(){if(!this.state.open)return;this.setState({open:false},function(){this.inform('close');});},_showForwardDialog:function(){this.setState({showForward:true});},_hideForwardDialog:function(){this.setState({showForward:false});},renderLayers:function(){var ea=(y._("Send this video to friends"));return {forwardDialog:(l.createElement(k,{attachmentID:this.props.videoID,onClose:this._hideForwardDialog,shown:this.state.showForward,title:ea}))};},render:function(){var ea=l.createElement("div",{className:"rfloat",id:this._domID}),fa=j.ForwardingEnabled?l.createElement(q,{onClick:this._showForwardDialog},y._("Send")):null;return (l.createElement(n,{onHide:this.close,open:this.state.open,rootClassName:this.props.rootClassName},l.createElement(s,{className:"_39hc",media:ea,showLoadingIndicator:this.state.loading,stageDimensions:this.state.dimensions},l.createElement(r,{onClick:this.close}),l.createElement(o,{className:"stat_elem"},l.createElement(p,null),l.createElement(p,null,fa,l.createElement(q,{href:this.props.videoURI},y._("Download")))))));}});e.exports=da;},null);
__d("MercuryAttachmentVideo.react",["ChatImageWithArrow.react","CenteredContainer.react","FBOverlayBase.react","FBOverlayContainer.react","FBOverlayElement.react","Image.react","MercuryConfig","MessagesViewer","MessagingVideoViewer.react","React","Vector","cx","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t=p,u=t.PropTypes,v=p.createClass({displayName:"MercuryAttachmentVideo",propTypes:{duration:u.number.isRequired,isChat:u.bool,isInbound:u.bool,name:u.string.isRequired,pageID:u.number,thumbSize:u.shape({height:u.number,width:u.number}).isRequired,thumbnail:u.string.isRequired,videoSize:u.shape({height:u.number,width:u.number}).isRequired,videoID:u.string.isRequired,videoURI:u.string.isRequired},_formatDuration:function(){var w=this.props.duration,x=Math.floor(w/60),y=w%60;if(y<10)return x+':0'+y;return x+':'+y;},openViewer:function(){var w=new q(this.props.videoSize.width,this.props.videoSize.height);n.render(p.createElement(o,{pageID:this.props.pageID,videoID:this.props.videoID,videoSize:w,videoURI:this.props.videoURI}));},_renderImage:function(){if(this.useImageBubbles){return (p.createElement(g,{arrowDirection:this.props.isInbound?"LEFT":"RIGHT",height:this.props.thumbSize.height,source:this.props.thumbnail,width:this.props.thumbSize.width}));}else return (p.createElement(l,{height:this.props.thumbSize.height,width:this.props.thumbSize.width,src:this.props.thumbnail}));},_getStyle:function(){if(this.useImageBubbles)return {};return this.props.thumbSize;},render:function(){this.useImageBubbles=m.MercuryImageBubblesGK&&this.props.isChat;var w=(("_zow")+(' '+"_59go")+(this.useImageBubbles?' '+"_3ds5":''));return (p.createElement(j,{className:w,onClick:this.openViewer,style:this._getStyle()},p.createElement(i,null,this._renderImage()),p.createElement(k,null,p.createElement("div",{className:((!this.useImageBubbles?"_zox":''))},p.createElement("span",{className:"_zoz"},this._formatDuration()))),p.createElement(k,null,p.createElement(h,{vertical:true},p.createElement(l,{src:s('/images/chat/chat_play_icon.png')})))));}});e.exports=v;},null);
__d("Tooltip.react",["React","TooltipMixin"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=g,j=i.PropTypes,k=g.createClass({displayName:"Tooltip",propTypes:{display:j.oneOf(['inline','block'])},getDefaultProps:function(){return {display:'inline'};},mixins:[h],render:function(){if(this.props.display==='block')return (g.createElement("div",g.__spread({},this.props),this.props.children));return g.createElement("span",g.__spread({},this.props),this.props.children);}});e.exports=k;},null);
__d("NubController",["ArbiterMixin","Dock","copyProperties"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();function j(){}i(j.prototype,g,{init:function(k){this.el=k;h.registerNubController(k,this);return this;},buttonContentChanged:function(){this.inform('nub/button/content-changed');},flyoutContentChanged:function(){this.inform('nub/flyout/content-changed');},hide:function(){h.hide(this.el);},show:function(){h.show(this.el);}});e.exports=j;},null);
/**
 * @generated SignedSource<<623c7cbcff19956af736c3d064fc689d>>
 *
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * !! This file is a check-in of a static_upstream project!      !!
 * !!                                                            !!
 * !! You should not modify this file directly. Instead:         !!
 * !! 1) Use `fjs use-upstream` to temporarily replace this with !!
 * !!    the latest version from upstream.                       !!
 * !! 2) Make your changes, test them, etc.                      !!
 * !! 3) Use `fjs push-upstream` to copy your changes back to    !!
 * !!    static_upstream.                                        !!
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 *
 * Copyright (C) 2010 by Johannes Baagoe <baagoe@baagoe.org>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @providesModule Alea
 * @preserve-header
 */__d("Alea",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(){var i=4022871197,j=function(k){k=k.toString();for(var l=0;l<k.length;l++){i+=k.charCodeAt(l);var m=.02519603282416938*i;i=m>>>0;m-=i;m*=i;i=m>>>0;m-=i;i+=m*4294967296;}return (i>>>0)*2.3283064365386963e-10;};j.version='Mash 0.9';return j;}function h(){return (function(i){var j=0,k=0,l=0,m=1;if(i.length===0)i=[new Date()];var n=new g();j=n(' ');k=n(' ');l=n(' ');for(var o=0;o<i.length;o++){j-=n(i[o]);if(j<0)j+=1;k-=n(i[o]);if(k<0)k+=1;l-=n(i[o]);if(l<0)l+=1;}n=null;var p=function(){var q=2091639*j+m*2.3283064365386963e-10;j=k;k=l;l=q-(m=q|0);return l;};p.version='Alea 0.9';p.args=i;return p;}(Array.prototype.slice.call(arguments)));}e.exports=h;},null);
__d("LineClamp.react",["React","cx","getVendorPrefixedName","joinClasses"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=g,l=k.PropTypes,m=i('lineClamp'),n=g.createClass({displayName:"LineClamp",propTypes:{customEllipsis:l.node,disableNative:l.bool,lineHeight:l.number,lines:l.number.isRequired},_renderEllipsis:function(){var o;if(this.props.lineHeight)o={bottom:this.props.lineHeight+'px'};return (g.createElement("div",{style:o,className:"_4ik3",key:"ellipsis"},this.props.customEllipsis?this.props.customEllipsis:'\u2026'));},render:function(){var o=!!m&&!this.props.disableNative,p=j(this.props.className,(("_4ik4")+(o?' '+"_4ik5":''))),q=this.props.children,r={};if(this.props.lineHeight)r={height:this.props.lineHeight*this.props.lines,lineHeight:this.props.lineHeight+'px'};if(o){r[m]=this.props.lines;}else{p=j(p,'clearfix');q=[g.createElement("div",{className:"_4ik6",key:"inner"},q),this._renderEllipsis()];}return (g.createElement("div",{className:p,style:r},q));}});e.exports=n;},null);
__d("BanzaiScribe",["Banzai"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();function h(j){return {log:function(k,l,m){var n=[l];if(m!=null)n.push(m);g.post('scribe:'+k,n,j);}};}var i=h({});i.create=h;e.exports=i;},null);
__d("DataViewPolyfill",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();"use strict";function g(h,i,j){if(i===(void 0)){this.$DataViewPolyfill0=new Uint8Array(h);}else if(j===(void 0)){this.$DataViewPolyfill0=new Uint8Array(h,i);}else this.$DataViewPolyfill0=new Uint8Array(h,i,j);this.byteLength=this.$DataViewPolyfill0.byteLength;}g.prototype.getUint8=function(h){if(h>=this.$DataViewPolyfill0.length)throw new Error('Trying to read beyond bounds of DataViewPolyfill');return this.$DataViewPolyfill0[h];};g.prototype.getUint16=function(h,i){var j=this.getUint8(h),k=this.getUint8(h+1);return i?(k*256)+j:(j*256)+k;};g.prototype.getUint32=function(h,i){var j=this.getUint8(h),k=this.getUint8(h+1),l=this.getUint8(h+2),m=this.getUint8(h+3);return i?(((m*256+l)*256+k)*256)+j:(((j*256+k)*256+l)*256)+m;};g.isSupported=function(){return !!a.Uint8Array;};e.exports=g;},null);
__d("MercuryFileUploader",["ArbiterMixin","CSS","Dialog","DOM","Event","FileForm","FileFormResetOnSubmit","FileInput","FormSubmitOnChange","MercuryAttachment","MercuryAttachmentTemplates","MercuryConstants","PhotosUploadID","SubscriptionsHandler","csx","fbt","getObjectValues","mixin","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){b.__markCompiled&&b.__markCompiled();var z=x(g);for(var aa in z)if(z.hasOwnProperty(aa))ca[aa]=z[aa];var ba=z===null?null:z.prototype;ca.prototype=Object.create(ba);ca.prototype.constructor=ca;ca.__superConstructor__=z;function ca(ea,fa,ga,ha){"use strict";this.$MercuryFileUploader0=ea;this.$MercuryFileUploader1={};this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader7={};this.$MercuryFileUploader8={};this.$MercuryFileUploader9={};this.updateElements(fa,ga,ha);}ca.prototype.updateElements=function(ea,fa,ga){"use strict";this.$MercuryFileUploadera&&this.$MercuryFileUploadera.release();this.$MercuryFileUploadera=new t();this.$MercuryFileUploaderb&&this.$MercuryFileUploaderb.destroy();this.$MercuryFileUploaderb=new l(ea,[o,m]);this.$MercuryFileUploaderb.setAllowCrossOrigin(true);this.$MercuryFileUploaderb.setUploadInParallel(true);var ha=j.find(ea,"._4q60"),ia=j.find(ha,"._4q61");new n(ha,ia,fa);this.$MercuryFileUploadera.addSubscriptions(this.$MercuryFileUploaderb.subscribe('submit',function(){var ja={count:0,file_sizes:[]};if(fa.files){for(var ka=0;ka<fa.files.length;ka++)if(fa.files[ka].size>r.AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var la={};for(var ma=0;ma<fa.files.length;ma++){var na=this.$MercuryFileUploaderc();this.$MercuryFileUploaderd(na,fa.files[ma].name);ja.count++;ja.file_sizes.push(fa.files[ma].size);la[na]=fa.files[ma];}this.$MercuryFileUploaderb.setFiles(la);}else{ga.value=this.$MercuryFileUploaderc();this.$MercuryFileUploaderd(ga.value,fa.value);ja.count=1;}this.inform('submit',ja);}.bind(this)),this.$MercuryFileUploaderb.subscribe('success',this.$MercuryFileUploadere.bind(this)),this.$MercuryFileUploaderb.subscribe('failure',this.$MercuryFileUploaderf.bind(this)),k.listen(ia,'click',y(this.inform,this,'open')));};ca.prototype.showAttachmentSizeErrorDialog=function(){"use strict";this.$MercuryFileUploaderb.abort();this.$MercuryFileUploaderb.clear();new i().setTitle(v._("The file you have selected is too large")).setBody(v._("The file you have selected is too large. The maximum size is 25MB.")).setButtons(i.OK).setSemiModal(true).show();};ca.prototype.addDroppedFiles=function(ea){"use strict";if(!this.$MercuryFileUploaderb||!this.$MercuryFileUploaderb.canUseXHR())return;var fa={},ga={count:0,file_sizes:[]};for(var ha=0;ha<ea.length;ha++){var ia=ea[ha];if(ia.size>r.AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var ja=this.$MercuryFileUploaderc();this.$MercuryFileUploaderd(ja,ia.name);fa[ja]=ia;ga.file_sizes.push(ia.size);ga.count++;}this.$MercuryFileUploaderb.setFiles(fa);this.$MercuryFileUploaderb.forceSendViaXHR();this.inform('submit',ga);};ca.prototype.isUploading=function(){"use strict";return !!Object.keys(this.$MercuryFileUploader7).length;};ca.prototype.addCachedAttachments=function(ea){"use strict";ea.forEach(function(fa){var ga=this.$MercuryFileUploaderc();this.$MercuryFileUploaderd(ga,fa.filename);this.$MercuryFileUploaderg(ga,fa);}.bind(this));};ca.prototype.addCachedImageFiles=function(ea){"use strict";var fa=v._("Photo");ea.forEach(function(ga){var ha=this.$MercuryFileUploaderc();this.$MercuryFileUploaderd(ha,fa);this.$MercuryFileUploaderg(ha,{filename:ga,image_id:ga,filetype:'image/jpeg'});}.bind(this));};ca.prototype.getAttachments=function(){"use strict";return w(this.$MercuryFileUploader1);};ca.prototype.getImageFiles=function(){"use strict";var ea=Object.keys(this.$MercuryFileUploader2).sort(),fa=[];ea.forEach(function(ga){return fa.push(this.$MercuryFileUploader2[ga]);}.bind(this));return fa;};ca.prototype.getAnimatedImageFiles=function(){"use strict";return w(this.$MercuryFileUploader3);};ca.prototype.getVideoFiles=function(){"use strict";return w(this.$MercuryFileUploader4);};ca.prototype.getAudioFiles=function(){"use strict";return w(this.$MercuryFileUploader5);};ca.prototype.getFiles=function(){"use strict";return w(this.$MercuryFileUploader6);};ca.prototype.removeAttachments=function(){"use strict";j.empty(this.$MercuryFileUploader0);this.$MercuryFileUploader1={};this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader8={};this.$MercuryFileUploader7={};this.$MercuryFileUploader9={};h.hide(this.$MercuryFileUploader0);this.inform('dom-updated');};ca.prototype.destroy=function(){"use strict";this.$MercuryFileUploadera&&this.$MercuryFileUploadera.release();this.$MercuryFileUploaderb&&this.$MercuryFileUploaderb.destroy();this.removeAttachments();};ca.prototype.$MercuryFileUploaderd=function(ea,fa){"use strict";var ga=q[':fb:mercury:upload-file-row'].build();this.$MercuryFileUploader8[ea]=ga;this.$MercuryFileUploader7[ea]=true;this.$MercuryFileUploader9[ea]=Date.now();j.appendContent(ga.getNode('iconText'),da(fa));k.listen(ga.getNode('closeFileUpload'),'click',this.$MercuryFileUploaderh.bind(this,ea));j.appendContent(this.$MercuryFileUploader0,ga.getRoot());h.show(this.$MercuryFileUploader0);this.inform('dom-updated');};ca.prototype.$MercuryFileUploaderh=function(ea,event){"use strict";if(this.$MercuryFileUploader7[ea]){this.inform('upload-canceled-during-upload');}else if(this.$MercuryFileUploader1[ea]||this.$MercuryFileUploader2[ea]||this.$MercuryFileUploader3[ea]||this.$MercuryFileUploader4[ea]||this.$MercuryFileUploader5[ea]||this.$MercuryFileUploader6[ea])this.inform('upload-canceled-after-uploaded');delete this.$MercuryFileUploader1[ea];delete this.$MercuryFileUploader2[ea];delete this.$MercuryFileUploader3[ea];delete this.$MercuryFileUploader4[ea];delete this.$MercuryFileUploader5[ea];delete this.$MercuryFileUploader6[ea];delete this.$MercuryFileUploader7[ea];delete this.$MercuryFileUploader9[ea];var fa=this.$MercuryFileUploader8[ea];delete this.$MercuryFileUploader8[ea];if(fa){j.remove(fa.getRoot());this.inform('dom-updated');}this.inform('upload-canceled');return false;};ca.prototype.$MercuryFileUploaderi=function(ea,fa){"use strict";var ga=this.$MercuryFileUploader8[ea],ha=p.getAttachIconClassByMime(fa);h.addClass(ga.getNode('iconText'),ha);h.addClass(ga.getRoot(),'done');};ca.prototype.$MercuryFileUploaderg=function(ea,fa){"use strict";if(this.$MercuryFileUploader7[ea]){delete this.$MercuryFileUploader7[ea];if(fa.image_id){this.$MercuryFileUploader2[ea]=fa.image_id;}else if(fa.gif_id){this.$MercuryFileUploader3[ea]=fa.gif_id;}else if(fa.video_id){this.$MercuryFileUploader4[ea]=fa.video_id;}else if(fa.audio_id){this.$MercuryFileUploader5[ea]=fa.audio_id;}else if(fa.file_id){this.$MercuryFileUploader6[ea]=fa.file_id;}else this.$MercuryFileUploader1[ea]=fa;this.$MercuryFileUploaderi(ea,fa.filetype);this.inform('one-upload-completed',{upload_time_ms:Date.now()-this.$MercuryFileUploader9[ea]});}if(!this.isUploading())this.inform('all-uploads-completed',{count:this.getAttachments().length});};ca.prototype.$MercuryFileUploadere=function(event,ea){"use strict";var fa=ea.response.getPayload();this.$MercuryFileUploaderg(this.$MercuryFileUploaderj(ea),fa.metadata[0]);};ca.prototype.$MercuryFileUploaderf=function(event,ea){"use strict";this.inform('one-upload-failed');this.$MercuryFileUploaderh(this.$MercuryFileUploaderj(ea),event);};ca.prototype.$MercuryFileUploaderc=function(){"use strict";return 'upload_'+s.getNewID();};ca.prototype.$MercuryFileUploaderj=function(ea){"use strict";var fa=ea.response.getPayload();if(ea.upload){return ea.upload.getName();}else return fa.uploadID;};function da(ea){if(ea&&ea.startsWith('C:\\fakepath\\'))return ea.substring(12);return ea;}e.exports=ca;},null);
__d("MercuryShareLinkUploader",["ArbiterMixin","AsyncRequest","CSS","DOM","Event","Form","URLScraper","WebMessengerEvents","mixin","isEmpty"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=o(g);for(var r in q)if(q.hasOwnProperty(r))t[r]=q[r];var s=q===null?null:q.prototype;t.prototype=Object.create(s);t.prototype.constructor=t;t.__superConstructor__=q;function t(u,v,w,x,y){"use strict";this.$MercuryShareLinkUploader0=u;this.$MercuryShareLinkUploader1=v;this.$MercuryShareLinkUploader2=w;this.$MercuryShareLinkUploader3=y;this.$MercuryShareLinkUploader4=false;this.$MercuryShareLinkUploader5=null;this.$MercuryShareLinkUploader6=null;k.listen(x,'click',this.close.bind(this));k.listen(y,'keyup',function(){!y.value.length&&this.$MercuryShareLinkUploader7.enable();}.bind(this));this.$MercuryShareLinkUploader7=new m(y);this.$MercuryShareLinkUploader7.subscribe('match',function(z,aa){this.loadShare(aa&&aa.url);}.bind(this));}t.prototype.getAttachData=function(){"use strict";return this.loadAttachData(this.$MercuryShareLinkUploader4,this.$MercuryShareLinkUploader0,this.$MercuryShareLinkUploader3);};t.prototype.getShareDataFromStage=function(u,v){"use strict";var w=l.serialize(v),x=w.attachment&&w.attachment.params;if(!x)return null;if(x instanceof Object){var y=[];y.push(x[0]);y.push(x[1]);x=y;}return {params:x,type:w.attachment.type};};t.prototype.loadAttachData=function(u,v,w,x){"use strict";if(u){var y=l.serialize(v),z=y.attachment&&y.attachment.params,aa=y.link_metrics?y.link_metrics.no_image:true;if(!z||p(z))return null;var ba=x?x():w.value;if(ba.indexOf(z.url)===-1)return y;if(!z.summary&&!z.favicon&&aa&&z.title&&z.url&&z.url.substr(0,z.title.length)===z.title)return null;return y;}return null;};t.prototype.check=function(){"use strict";this.$MercuryShareLinkUploader7.check();};t.prototype.close=function(){"use strict";this.$MercuryShareLinkUploader8();this.$MercuryShareLinkUploader7.disable();this.inform('closed');};t.prototype.clear=function(){"use strict";this.$MercuryShareLinkUploader8();this.$MercuryShareLinkUploader7.enable();};t.prototype.enable=function(){"use strict";this.$MercuryShareLinkUploader7.enable();};t.prototype.disable=function(){"use strict";this.$MercuryShareLinkUploader7.disable();};t.prototype.loadShare=function(u){"use strict";this.$MercuryShareLinkUploader5=u;this.$MercuryShareLinkUploader6&&this.$MercuryShareLinkUploader6.abort();this.$MercuryShareLinkUploader6=new h().setMethod('POST').setURI('/ajax/share_scrape.php').setData({u:u}).setHandler(this.$MercuryShareLinkUploader9.bind(this).bind(null,u)).setStatusElement(this.$MercuryShareLinkUploader2);this.$MercuryShareLinkUploader6.send();this.inform('link-detected');};t.prototype.$MercuryShareLinkUploader9=function(u,v){"use strict";if(this.$MercuryShareLinkUploader5!==u)return;this.$MercuryShareLinkUploader5=null;this.$MercuryShareLinkUploader6=null;i.show(this.$MercuryShareLinkUploader0);j.empty(this.$MercuryShareLinkUploader1);j.setContent(this.$MercuryShareLinkUploader1,v.payload);this.$MercuryShareLinkUploader4=true;if(!this.getAttachData()){this.close();return;}n.detailDOMChanged();};t.prototype.$MercuryShareLinkUploader8=function(){"use strict";i.hide(this.$MercuryShareLinkUploader0);this.$MercuryShareLinkUploader4=false;this.$MercuryShareLinkUploader5=null;this.$MercuryShareLinkUploader6&&this.$MercuryShareLinkUploader6.abort();this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7.reset();n.detailDOMChanged();};e.exports=t;},null);
__d("ChatActivity",["Event","Arbiter","AvailableList","AvailableListConstants","JSLogger","MercuryConfig","PresenceState","UserActivity","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=l.activity_limit||60000,q=l.idle_limit||1800000,r=l.idle_poll_interval||300000,s=k.create('chat_activity'),t=Date.now(),u=t,v=true;function w(){var aa=Date.now();return !!(v&&(aa-t<p));}var x=o(new h(),{isActive:w});function y(){var aa=t;t=Date.now();if(t-aa>q){s.debug('idle_to_active',aa);m.doSync();}x.inform('activity');}i.subscribe(j.ON_AVAILABILITY_CHANGED,function(){if(!i.isUserIdle())u=Date.now();});g.listen(window,'focus',function(){v=true;y();});g.listen(window,'blur',function(){v=false;});n.subscribe(function(){y();});function z(aa){var ba=aa&&aa.at&&m.verifyNumber(aa.at);if(typeof ba!=='number')ba=null;return ba||0;}setInterval(function(){var aa=Date.now(),ba=z(m.get()),ca=Math.max(t,ba,u);if(aa-ca>q){s.debug('idle',{cookie:ba,local:t,presence:u});x.inform('idle',aa-ca);}},r);m.registerStateStorer(function(aa){var ba=z(aa);if(ba<t)aa.at=t;return aa;});h.subscribe(k.DUMP_EVENT,function(aa,ba){ba.chat_activity={activity_limit:p,idle_limit:q,idle_poll_interval:r,last_active_time:t,last_global_active_time:u};});e.exports=x;},null);
__d("MercuryNotificationRenderer",["MercuryAssert","MercuryParticipants","MercuryViewer","fbt","MercuryMessages","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=b('MercuryMessages').get(),l=b('MercuryThreads').get();function m(n,o){g.isThreadID(n);l.getThreadMeta(n,function(p){k.getThreadMessagesRange(n,0,1,function(q){var r=q.length&&q[q.length-1];if(r&&r.author!=i.getID()){h.get(r.author,function(s){if(p.name){o(j._("{senderName} messaged {groupName}",[j.param("senderName",s.short_name),j.param("groupName",p.name)]));}else o(j._("{name} messaged you",[j.param("name",s.short_name)]));});}else o(j._("New message!"));});});}e.exports={renderDocumentTitle:m};},null);
__d("MercuryTimestampTracker",["MercuryActionType","MercuryPayloadSource","MercurySingletonMixin","MercuryServerRequests","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();function l(m){this._fbid=m;this._serverRequests=j.getForFBID(this._fbid);this._lastTimestamp=0;this._serverRequests.subscribe('update-messages',function(n,o){if(!o.actions||!o.actions.length)return;if(o.payload_source==h.CLIENT_SEND_MESSAGE||o.payload_source==h.UNKNOWN)return;for(var p=0;p<o.actions.length;p++){var q=o.actions[p],r=q.action_type;if(r==g.USER_GENERATED_MESSAGE&&q.thread_id&&q.timestamp>this._lastTimestamp)this._lastTimestamp=q.timestamp;}}.bind(this));}k(l.prototype,{getLastUserMessageTimestamp:function(){return this._lastTimestamp;}});k(l,i);e.exports=l;},null);
__d("ChatTitleBarBlinker",["ChatActivity","DocumentTitle","JSLogger","MercuryNotificationRenderer","PresenceState","MercuryThreadInformer","MercuryTimestampTracker"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=b('MercuryThreadInformer').get(),m=b('MercuryTimestampTracker').get(),n=i.create('chat_title'),o=null,p=0,q=false;function r(){if(o){o.stop();o=null;return true;}return false;}function s(x){var y=x||m.getLastUserMessageTimestamp();if(p<=y){p=y;if(r()||q)k.doSync();}}var t={blink:function(x,y){if(!o&&p<y)j.renderDocumentTitle(x,function(z){if(!o)o=h.blink(z);});},stopBlinking:function(){s();},blinkingElsewhere:function(){q=true;}};function u(x){var y=k.verifyNumber(x.sb2);if(!y||y<=p)return null;return y;}function v(x){var y=x&&u(x);if(y){p=y;n.debug('load',p);r();q=false;}}function w(x){var y=u(x);if(!y){n.debug('store',p);x.sb2=p;q=false;}return x;}k.registerStateStorer(w);k.registerStateLoader(v);l.subscribe('thread-read-changed',function(x,y){var z=m.getLastUserMessageTimestamp(),aa=0;for(var ba in y)if(y[ba].mark_as_read&&y[ba].timestamp>=z&&y[ba].timestamp>aa)aa=y[ba].timestamp;aa&&s(aa);});g.subscribe('activity',function(){s();});(function(){var x=k.getInitial();if(x)p=u(x)||0;})();e.exports=t;},null);
__d("MercuryBrowserAlerts",["ArbiterMixin","ChatActivity","ChatConfig","ChatOptions","ChatTitleBarBlinker","MercuryThreadInfo","MercuryViewer","MessagingTag","Sound","copyProperties","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=b('MercuryThreads').get();o.init(['audio/ogg','audio/mpeg']);function r(t){if(j.getSetting('sound'))o.play([i.get('sound.notif_ogg_url'),i.get('sound.notif_mp3_url')],t,false);}var s={messageReceived:function(t){if(m.isViewer(t.author)||!t.is_unread||(t.folder!=n.INBOX&&t.folder!=n.ARCHIVED))return;var u=t.thread_id,v=h.isActive();if(v){var w=false;s.inform('before-alert',{threadID:u,cancelAlert:function(){w=true;}});}q.getThreadMeta(u,function(x){var y=l.isMuted(x);if(y)return;var z=t.timestamp;if(v){!w&&r(z);}else{k.blink(u,z);r(z);}k.blinkingElsewhere();}.bind(this));}};e.exports=p(s,g);},null);
__d("FBRTCAvailability",["ChannelConstants","PresenceStatus"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i={isCallable:function(j){var k=h.getCapabilities(j),l=g.CAPABILITY_VOIP_INTEROP|g.CAPABILITY_VIDEO;return !!(k&l);}};e.exports=i;},null);
__d("FBRTCStruct",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g=function(i,j,k){var l,m;if(typeof i=='string'||i instanceof String){m=i;l=i;}else for(var n in i)if(i.hasOwnProperty(n))if(n==='index'){k=i[n];}else{m=n;l=i[n];}j[m]=k;j.strNames[k]=l;};function h(i){"use strict";this.strNames=[];for(var j=0;j<i.length;j++)g(i[j],this,j);}e.exports=h;},null);
__d("FBRTCConstants",["FBRTCStruct"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={OFFER:'offer',ANSWER:'answer',ICE_CANDIDATE:'ice_candidate',OK:'ok',PING:'ping',HANGUP:'hang_up',OTHER_DISMISS:'other_dismiss',MSG_ACK:'msg_ack',PRANSWER:'pranswer',ICERESTART_OFFER:'icerestart_offer',ICERESTART_ANSWER:'icerestart_answer',PCRESTART_OFFER:'pcrestart_offer',PCRESTART_ANSWER:'pcrestart_answer',SDP_UPDATE:'sdp_update',OFFER_ACK:'offer_ack',OFFER_NACK:'offer_nack',ANSWER_ACK:'answer_ack',SET_VIDEO:'set_video'},i=new g([{IGNORE_CALL:'IgnoreCall'},{HANGUP_CALL:'HangupCall'},{IN_ANOTHER_CALL:'InAnotherCall'},{ACCEPT_AFTER_HANGUP:'CallEndAcceptAfterHangUp'},{NO_ANSWER_TIMEOUT:'NoAnswerTimeout'},{INCOMING_TIMEOUT:'IncomingTimeout'},{OTHER_INSTANCE_HANDLED:'OtherInstanceHandled'},{SIGNALING_MESSAGE_FAILED:'SignalingMessageFailed'},{CONNECTION_DROPPED:'ConnectionDropped'},{CLIENT_INTERRUPTED:'ClientInterrupted'},{WEBRTC_ERROR:'WebRTCError'},{CLIENT_ERROR:'ClientError'},{NO_PERMISSION:'NoPermission'},{OTHER_NOT_CAPABLE:'OtherNotCapable'},{NO_UI_ERROR:'NoUIShown'},{UNSUPPORTED_VERSION:'VersionUnsupported'},{CALLER_NOT_VISIBLE:'CallerNotVisible'},{CARRIER_BLOCKED:'CarrierBlocked'},{OTHER_CARRIER_BLOCKED:'OtherCarrierBlocked'}]),j={HANG_UP:1,TOGGLE_MUTE_AUDIO:2,TOGGLE_MUTE_VIDEO:3,TOGGLE_FULL_SCREEN:4,TOGGLE_SELF_VIEW:5,SUBMIT_STAR_RATING:6,SUBMIT_FEEDBACK:7,SHOW_SETTINGS:8,START_CALL:9},k={PayloadType:h,CallEndReason:i,UIEventType:j,endCallReasonFromString:function(l){return i.strNames.indexOf(l);},callEndReasonString:function(l){if(l<0||l>i.strNames.length)return 'Unknown';return i.strNames[l];},fullCallEndReasonString:function(l,m){return this.callEndReasonString(l)+'_'+(m?'remote':'local');}};e.exports=k;},null);
__d("FBRTCIceStatsParser",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g=null;h.getInstance=function(){"use strict";if(!g)g=new h();return g;};function h(){"use strict";}h.prototype.extractIceInfo=function(i){"use strict";var j=[],k=i.split("\r\n");for(var l=0;l<k.length;l++){var m=k[l];if(this.$FBRTCIceStatsParser0(m))j.push({gen:this.$FBRTCIceStatsParser1(m),type:this.$FBRTCIceStatsParser2(m)});}return j;};h.prototype.$FBRTCIceStatsParser0=function(i){"use strict";return (i.indexOf('candidate:')>-1);};h.prototype.$FBRTCIceStatsParser1=function(i){"use strict";var j=0,k=i.match(/generation (\d+)/);if(k)j=parseInt(k[1],10);return j;};h.prototype.$FBRTCIceStatsParser2=function(i){"use strict";var j=i.match(/typ (host|relay|srflx|prflx)/);if(j){return j[1];}else return 'unknown';};e.exports=h;},null);
__d("FBRTCLogger",["Log","LogHistory","MarauderLogger","formatDate","pageID"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l='webrtc',m='sent_message',n='received_message',o='send_succeeded',p='send_failed',q='info',r='call_action',s='client_event',t='client_error',u='type',v='msg_id',w='ack_msg_id',x='call_id',y='from',z='to',aa='content',ba='tag',ca='peer_id',da='error_code',ea='trigger',fa='endcallstats',ga=null;ha.getInstance=function(){"use strict";if(!ga)ga=new ha();return ga;};function ha(){"use strict";this.$FBRTCLogger0=h.getInstance(l);}ha.prototype.logToConsole=function(ia){"use strict";var ja='Console';this.$FBRTCLogger1(null,null,ja,ia);this.$FBRTCLogger0.log(ja,ia);};ha.prototype.logReceivedMessage=function(ia,ja,ka){"use strict";var la={};la[y]=ia;la[x]=ja;la[u]=ka.type;la[v]=ka.msg_id;if(ka.sdp)la[aa]=ka.sdp;if(ka.ack_id)la[w]=ka.ack_id;this.$FBRTCLogger2(n,la);this.$FBRTCLogger1(ia,ja,'Received',ka.type+', '+ka.msg_id);};ha.prototype.logSentMessage=function(ia,ja,ka){"use strict";var la={};la[z]=ia;la[x]=ja;la[u]=ka.type;la[v]=ka.msg_id;if(ka.sdp)la[aa]=ka.sdp;if(ka.ack_id)la[w]=ka.ack_id;this.$FBRTCLogger2(m,la);this.$FBRTCLogger1(ia,ja,'Sent',ka.type+', '+ka.msg_id);};ha.prototype.logSentMessageSuccess=function(ia,ja,ka,la){"use strict";var ma={};ma[ca]=ia;ma[x]=ja;ma[u]=ka;ma[v]=la;this.$FBRTCLogger2(o,ma);};ha.prototype.logSentMessageFailure=function(ia,ja,ka,la,ma){"use strict";var na={};na[ca]=ia;na[x]=ja;na[u]=ka;na[v]=la;na[da]=ma;this.$FBRTCLogger2(p,na);this.$FBRTCLogger1(ia,ja,'Send Failed',ka+', '+ma);};ha.prototype.logCallAction=function(ia,ja,ka,la,ma){"use strict";var na={};na[ca]=ia;na[x]=ja;na[r]=ka;na[aa]=la;if(ma)na[ea]=ma;this.$FBRTCLogger2(r,na);this.$FBRTCLogger1(ia,ja,'CallAction',ka+', '+la);};ha.prototype.logEvent=function(ia,ja,event){"use strict";var ka={};ka[ca]=ia;ka[x]=ja;ka[aa]=event;this.$FBRTCLogger2(s,ka);this.$FBRTCLogger1(ia,ja,'Event',event);};ha.prototype.logInfo=function(ia,ja,ka){"use strict";var la={};la[ca]=ia;la[x]=ja;la[aa]=ka;this.$FBRTCLogger2(q,la);this.$FBRTCLogger1(ia,ja,'Info',ka);};ha.prototype.logError=function(ia,ja,ka){"use strict";var la={};la[ca]=ia;la[x]=ja;la[aa]=ka;this.$FBRTCLogger2(t,la);this.$FBRTCLogger1(ia,ja,'Error',ka);};ha.prototype.logErrorWithoutID=function(ia){"use strict";this.logError(null,null,ia);};ha.prototype.logEndCallSummary=function(ia){"use strict";if(!ia)return;var ja={};ja[ca]=ia.peerID;ja[x]=ia.callID;ja[ba]=fa;ja[aa]=ia.toString();var ka=ia.getExtraInfo();for(var la in ka)if(ka.hasOwnProperty(la))ja[la]=ka[la];this.$FBRTCLogger2(q,ja);this.$FBRTCLogger1(ia.peerID,ia.callID,'Call Summary',ja);};ha.prototype.$FBRTCLogger2=function(ia,ja){"use strict";ja.page_id=k;this.$FBRTCLogger0.log(ia,ja);i.log(ia,l,ja);};ha.prototype.$FBRTCLogger1=function(ia,ja,ka,la){"use strict";};ha.CallAction={START_CALL:'start_call',RECEIVED_CALL:'received_call',ANSWER_CALL:'answer_call',END_CALL:'end_call',DENIED_PERMISSION:'denied_permission',SET_MUTE:'set_mute',SET_VIDEO_ON:'set_video_on',SET_SELF_VIEW_ON:'set_self_view_on',SET_FULLSCREEN_ON:'set_fullscreen_on',START_SKYPE:'start_skype',TRY_NEW:'try_new',OPEN_POPUP:'open_popup',POPUP_OPENED:'popup_opened',AUTO_DISABLE_VIDEO:'auto_disable_video',FAILED_GETTING_URI:'failed_getting_uri',OLD_URI:'old_uri',USER_SETTINGS_CHANGED:'user_settings_changed'};ha.Trigger={ADMIN_MESSAGE:'admin_message',CHAT_TAB_ICON:'chat_tab_icon',CHAT_TAB_ICON_TOUR:'chat_tab_icon_tour',SKYPE_DEPRECATION_DIALOG:'skype_deprecation_dialog',REDIAL_BUTTON:'redial_button',RETURN_CALL:'return_call',WEB_MESSENGER:'web_messenger',POPUP_CALL_START_BUTTON:'popup_start_call_button',UNKNOWN:'unknown'};ha.Key={DEVICE_INFO:'device_info',RATING:'rating5',RATING_SHOWN:'rating_shown',SURVEY_CHOICE:'survey_choice',SURVEY_DETAILS:'survey_details',SURVEY_SHOWN:'survey_shown',INITIATED_BY_PAGE_ID:'initiated_by_page_id',PEER_IS_MOBILE:'peer_is_mobile'};e.exports=ha;},null);
__d("FBRTCCallSummary",["FBRTCConstants","FBRTCIceStatsParser","FBRTCLogger","UserAgentData","copyProperties","performanceNow"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=5*60*1000,n={CALL_STARTED:'started',POPUP_OPENED:'opened',SENT_OFFER:'s_o',RECV_OFFER:'r_o',SENT_OFFER_ACK:'s_oack',RECV_OFFER_ACK:'r_oack',SENT_RETRIED_OFFER:'s_o2',RECV_RETRIED_OFFER:'r_o2',SENT_RETRIED_OFFER_ACK:'s_oack2',RECV_RETRIED_OFFER_ACK:'r_oack2',SENT_PRANSWER:'s_pr',RECV_PRANSWER:'r_pr',NETWORK_READY:'network_ready',SENT_ANSWER:'s_a',RECV_ANSWER:'r_a',SENT_ANSWER_ACK:'s_aack',RECV_ANSWER_ACK:'r_aack',SENT_RETRIED_ANSWER:'s_a2',RECV_RETRIED_ANSWER:'r_a2',SENT_RETRIED_ANSWER_ACK:'s_aack2',RECV_RETRIED_ANSWER_ACK:'r_aack2',SENT_OK:'s_ok',RECV_OK:'r_ok',CALL_CONNECTED:'connected',CALL_ENDED:'ended'};o.CURRENT_SUMMARY_VERSION=10;function o(p){"use strict";this.peerID=p.peerID;this.callID=p.callID;this.$FBRTCCallSummary0=p.isCaller;this.$FBRTCCallSummary1=(new Date()).valueOf();this.$FBRTCCallSummary2=null;this.$FBRTCCallSummary3={};this.$FBRTCCallSummary4=null;this.$FBRTCCallSummary5=null;this.$FBRTCCallSummary6=null;this.$FBRTCCallSummary7=null;this.$FBRTCCallSummary8=null;this.$FBRTCCallSummary9=null;this.$FBRTCCallSummarya={};this.$FBRTCCallSummaryb={};this.$FBRTCCallSummaryc={};this.$FBRTCCallSummaryd={};this.$FBRTCCallSummarye={};this.$FBRTCCallSummaryf={};this.$FBRTCCallSummaryg=l();this.$FBRTCCallSummaryh=0;this.$FBRTCCallSummaryi={};this.$FBRTCCallSummaryj=this.$FBRTCCallSummaryg;this.$FBRTCCallSummaryk=0;this.$FBRTCCallSummaryl={};this.addExtraInfo(i.Key.DEVICE_INFO,this.$FBRTCCallSummarym());this.$FBRTCCallSummaryn();this.$FBRTCCallSummaryo=h.getInstance();this.$FBRTCCallSummaryp=i.getInstance();}o.prototype.toJsonString=function(){"use strict";this.$FBRTCCallSummary8=(new Date()).valueOf();return JSON.stringify({version:o.CURRENT_SUMMARY_VERSION,peerID:this.peerID,callID:this.callID,isCaller:this.$FBRTCCallSummary0,startTime:this.$FBRTCCallSummary1,trigger:this.$FBRTCCallSummary2,signalingTime:this.$FBRTCCallSummary3,endCallReason:this.$FBRTCCallSummary4,endCallSubreason:this.$FBRTCCallSummary5,isRemoteEnded:this.$FBRTCCallSummary6,lastUpdatedTime:this.$FBRTCCallSummary7,lastSerializedTime:this.$FBRTCCallSummary8,unsetOnRetrieve:this.$FBRTCCallSummary9,openCount:this.$FBRTCCallSummaryk,extraInfo:this.$FBRTCCallSummaryl,pcStats:this.$FBRTCCallSummarya,captureStats:this.$FBRTCCallSummaryb,gen0IceSentCount:this.$FBRTCCallSummaryc,gen0IceReceivedCount:this.$FBRTCCallSummaryd,iceSentCount:this.$FBRTCCallSummarye,iceReceivedCount:this.$FBRTCCallSummaryf,newSignalingTime:this.$FBRTCCallSummaryi,accumulatedCallTime:this.$FBRTCCallSummaryq()});};o.fromJsonString=function(p){"use strict";var q;try{q=JSON.parse(p);}catch(r){return null;}if(q.version!==o.CURRENT_SUMMARY_VERSION)return null;if(!q.hasOwnProperty('peerID')||!q.hasOwnProperty('callID')||!q.hasOwnProperty('isCaller')||!q.hasOwnProperty('startTime')||!q.hasOwnProperty('trigger')||!q.hasOwnProperty('signalingTime')||!q.hasOwnProperty('endCallReason')||!q.hasOwnProperty('isRemoteEnded')||!q.hasOwnProperty('lastUpdatedTime')||!q.hasOwnProperty('lastSerializedTime'))return null;var s=new o({peerID:q.peerID,callID:q.callID,isCaller:q.isCaller});s.$FBRTCCallSummary1=q.startTime;s.$FBRTCCallSummary2=q.trigger;s.$FBRTCCallSummary3=q.signalingTime;s.$FBRTCCallSummary4=q.endCallReason;s.$FBRTCCallSummary5=q.endCallSubreason;s.$FBRTCCallSummary6=q.isRemoteEnded;s.$FBRTCCallSummary7=q.lastUpdatedTime;s.$FBRTCCallSummary8=q.lastSerializedTime;if(q.unsetOnRetrieve)s.$FBRTCCallSummary9=q.unsetOnRetrieve;if(q.openCount)s.$FBRTCCallSummaryk=q.openCount;if(q.extraInfo)s.$FBRTCCallSummaryl=q.extraInfo;if(q.pcStats)s.$FBRTCCallSummarya=q.pcStats;if(q.captureStats)s.$FBRTCCallSummaryb=q.captureStats;if(q.gen0IceSentCount)s.$FBRTCCallSummaryc=q.gen0IceSentCount;if(q.gen0IceReceivedCount)s.$FBRTCCallSummaryd=q.gen0IceReceivedCount;if(q.iceSentCount)s.$FBRTCCallSummarye=q.iceSentCount;if(q.iceReceivedCount)s.$FBRTCCallSummaryf=q.iceReceivedCount;if(q.newSignalingTime)s.$FBRTCCallSummaryi=q.newSignalingTime;if(q.accumulatedCallTime)s.$FBRTCCallSummaryh=q.accumulatedCallTime;return s;};o.restoreOrInitialize=function(p,q,r,s,t){"use strict";var u=p.retrieveCallSummary(q,r);if(!u){u=new o({peerID:q,callID:r,isCaller:s});if(t){u.onFullMessageReceived({msg:t});u.onOfferAckSent(t);}else u.onCallStarted(i.Trigger.UNKNOWN);i.getInstance().logError(q,r,'Missing call summary from storage');}else if(u.$FBRTCCallSummary9){u.$FBRTCCallSummary4=null;u.$FBRTCCallSummary5=null;u.$FBRTCCallSummary6=null;delete u.$FBRTCCallSummary3[n.CALL_ENDED];delete u.$FBRTCCallSummaryi[n.CALL_ENDED];u.$FBRTCCallSummary9=null;}return u;};o.logSavedSummaries=function(p){"use strict";var q=p.getLoggableSummaries(),r=q.length;if(r<=0)return;var s=i.getInstance(),t=[];for(var u=0;u<r;u++){var v=q[u];s.logEndCallSummary(v);t.push({peerID:v.peerID,callID:v.callID});}p.removeCallSummaries(t);s.logToConsole('Logged pending summaries: '+r);};o.prototype.save=function(p){"use strict";var q=l(),r=q-this.$FBRTCCallSummaryj;if(r>m){this.$FBRTCCallSummaryp.logInfo(this.peerID,this.callID,'Summary too old: '+r);return;}p.storeCallSummary(this.peerID,this.callID,this);this.$FBRTCCallSummaryj=q;};o.prototype.getLastUpdatedTime=function(){"use strict";return this.$FBRTCCallSummary7;};o.prototype.setLastUpdatedTime=function(p){"use strict";this.$FBRTCCallSummary7=p;};o.prototype.getExtraInfo=function(){"use strict";return this.$FBRTCCallSummaryl;};o.prototype.addExtraInfo=function(p,q){"use strict";this.$FBRTCCallSummaryl[p]=q;this.$FBRTCCallSummaryn();};o.prototype.onCallStarted=function(p){"use strict";this.$FBRTCCallSummary2=p;this.$FBRTCCallSummaryr(n.CALL_STARTED);this.$FBRTCCallSummaryn();};o.prototype.onPopupOpened=function(){"use strict";this.$FBRTCCallSummaryr(n.POPUP_OPENED);this.$FBRTCCallSummaryk++;this.$FBRTCCallSummaryn();};o.prototype.setPcStats=function(p){"use strict";this.$FBRTCCallSummarya=p;this.$FBRTCCallSummaryn();};o.prototype.setVideoCaptureStats=function(p,q){"use strict";this.$FBRTCCallSummaryb={w:p,h:q};this.$FBRTCCallSummaryn();};o.prototype.onOfferAckSent=function(p){"use strict";this.onMessageSent({type:g.PayloadType.OFFER_ACK,flag:p.flag});};o.prototype.onMessageSent=function(p){"use strict";var q=p.flag===1;switch(p.type){case g.PayloadType.OFFER:this.$FBRTCCallSummarys(q,n.SENT_OFFER,n.SENT_RETRIED_OFFER);this.$FBRTCCallSummaryt(p,this.$FBRTCCallSummaryc,this.$FBRTCCallSummarye);break;case g.PayloadType.ANSWER:this.$FBRTCCallSummarys(q,n.SENT_ANSWER,n.SENT_RETRIED_ANSWER);this.$FBRTCCallSummaryt(p,this.$FBRTCCallSummaryc,this.$FBRTCCallSummarye);break;case g.PayloadType.OK:this.$FBRTCCallSummaryr(n.SENT_OK);break;case g.PayloadType.PRANSWER:this.$FBRTCCallSummaryr(n.SENT_PRANSWER);break;case g.PayloadType.OFFER_ACK:this.$FBRTCCallSummarys(q,n.SENT_OFFER_ACK,n.SENT_RETRIED_OFFER_ACK);break;case g.PayloadType.ANSWER_ACK:this.$FBRTCCallSummarys(q,n.SENT_ANSWER_ACK,n.SENT_RETRIED_ANSWER_ACK);break;case g.PayloadType.ICE_CANDIDATE:this.$FBRTCCallSummaryt(p,this.$FBRTCCallSummaryc,this.$FBRTCCallSummarye);break;default:}this.$FBRTCCallSummaryn();};o.prototype.$FBRTCCallSummaryt=function(p,q,r){"use strict";var s=null,t=null,u=this.$FBRTCCallSummaryo.extractIceInfo(p.sdp);for(var v=0;v<u.length;v++){s=u[v].gen;t=u[v].type;if(s===0)this.$FBRTCCallSummaryu(q,t);this.$FBRTCCallSummaryu(r,t);}};o.prototype.$FBRTCCallSummaryu=function(p,q){"use strict";if(!p[q]){p[q]=1;}else p[q]=p[q]+1;};o.prototype.$FBRTCCallSummaryv=function(p){"use strict";if(p.isFromMobile())this.addExtraInfo(i.Key.PEER_IS_MOBILE,'1');};o.prototype.onFullMessageReceived=function(p){"use strict";var q=p.msg,r=q.flag===1;switch(q.type){case g.PayloadType.OFFER:this.$FBRTCCallSummaryv(p);this.$FBRTCCallSummarys(r,n.RECV_OFFER,n.RECV_RETRIED_OFFER);this.$FBRTCCallSummaryt(q,this.$FBRTCCallSummaryd,this.$FBRTCCallSummaryf);break;case g.PayloadType.ANSWER:this.$FBRTCCallSummaryv(p);this.$FBRTCCallSummarys(r,n.RECV_ANSWER,n.RECV_RETRIED_ANSWER);this.$FBRTCCallSummaryt(q,this.$FBRTCCallSummaryd,this.$FBRTCCallSummaryf);break;case g.PayloadType.OK:this.$FBRTCCallSummaryr(n.RECV_OK);break;case g.PayloadType.PRANSWER:this.$FBRTCCallSummaryr(n.RECV_PRANSWER);break;case g.PayloadType.OFFER_ACK:this.$FBRTCCallSummarys(r,n.RECV_OFFER_ACK,n.RECV_RETRIED_OFFER_ACK);break;case g.PayloadType.ANSWER_ACK:this.$FBRTCCallSummarys(r,n.RECV_ANSWER_ACK,n.RECV_RETRIED_ANSWER_ACK);break;case g.PayloadType.ICE_CANDIDATE:this.$FBRTCCallSummaryt(q,this.$FBRTCCallSummaryd,this.$FBRTCCallSummaryf);break;default:}this.$FBRTCCallSummaryn();};o.prototype.onMsgAckReceived=function(p,q){"use strict";var r=p.msg.flag===1;if(q){this.$FBRTCCallSummarys(r,n.RECV_OFFER_ACK,n.RECV_RETRIED_OFFER_ACK);}else this.$FBRTCCallSummarys(r,n.RECV_ANSWER_ACK,n.RECV_RETRIED_ANSWER_ACK);};o.prototype.onCallConnected=function(){"use strict";this.$FBRTCCallSummaryr(n.NETWORK_READY);this.$FBRTCCallSummaryr(n.CALL_CONNECTED);this.$FBRTCCallSummaryn();};o.prototype.onCallEnded=function(p,q,r,s){"use strict";this.$FBRTCCallSummary9=r;this.$FBRTCCallSummary4=p;this.$FBRTCCallSummary5=s;this.$FBRTCCallSummary6=q;this.$FBRTCCallSummaryr(n.CALL_ENDED);this.$FBRTCCallSummaryn();};o.prototype.toString=function(){"use strict";var p={};p.core_metrics=this.$FBRTCCallSummaryw();p.time_series=null;return JSON.stringify(p);};o.prototype.$FBRTCCallSummaryw=function(){"use strict";var p={};p.ver=o.CURRENT_SUMMARY_VERSION;p.caller=this.$FBRTCCallSummary0;p.conn=this.$FBRTCCallSummaryx();p.peer_id=this.peerID;p.has_video=true;p.open_count=this.$FBRTCCallSummaryk;p.signaling=this.$FBRTCCallSummaryy();p.sender=this.$FBRTCCallSummaryz();p.receiver=this.$FBRTCCallSummaryA();p.end=this.$FBRTCCallSummaryB();p.video=this.$FBRTCCallSummaryC();return p;};o.prototype.$FBRTCCallSummaryx=function(){"use strict";var p={dtls:1};if(this.$FBRTCCallSummarya.sender&&this.$FBRTCCallSummarya.sender.rtt)p.rtt=this.$FBRTCCallSummarya.sender.rtt;return p;};o.prototype.$FBRTCCallSummaryy=function(){"use strict";var p={};if(this.$FBRTCCallSummary2)p.trigger=this.$FBRTCCallSummary2;p.start_time=this.$FBRTCCallSummary1;p.time_from_start=this.$FBRTCCallSummary3;var q=this.$FBRTCCallSummary3[n.CALL_CONNECTED],r=this.$FBRTCCallSummary3[n.CALL_ENDED];if(q){if(!r)if(this.$FBRTCCallSummary8){r=this.$FBRTCCallSummary8-this.$FBRTCCallSummary1;}else r=this.$FBRTCCallSummaryD();var s=r-q;if(s>0)p.duration=s;}p.new_time_from_start=this.$FBRTCCallSummaryi;q=this.$FBRTCCallSummaryi[n.CALL_CONNECTED];r=this.$FBRTCCallSummaryi[n.CALL_ENDED];if(q){if(!r)if(this.$FBRTCCallSummaryh>0){r=this.$FBRTCCallSummaryh;}else r=this.$FBRTCCallSummaryq();s=r-q;if(s>0)p.new_duration=s;}return p;};o.prototype.$FBRTCCallSummaryz=function(){"use strict";var p={};if(this.$FBRTCCallSummaryc)p.ice_g0=this.$FBRTCCallSummaryc;if(this.$FBRTCCallSummarye)p.ice=this.$FBRTCCallSummarye;if(this.$FBRTCCallSummarya.sender)k(p,this.$FBRTCCallSummarya.sender);return p;};o.prototype.$FBRTCCallSummaryA=function(){"use strict";var p={};if(this.$FBRTCCallSummaryd)p.ice_g0=this.$FBRTCCallSummaryd;if(this.$FBRTCCallSummaryf)p.ice=this.$FBRTCCallSummaryf;return p;};o.prototype.$FBRTCCallSummaryB=function(){"use strict";var p={};if(this.$FBRTCCallSummary4!==null){p.end_call_reason_string=g.callEndReasonString(this.$FBRTCCallSummary4);if(this.$FBRTCCallSummary5!==null)p.end_call_subreason_string=this.$FBRTCCallSummary5;p.remote_ended=this.$FBRTCCallSummary6;}if(this.$FBRTCCallSummarya.end)k(p,this.$FBRTCCallSummarya.end);return p;};o.prototype.$FBRTCCallSummaryC=function(){"use strict";var p={capture:{}};if(this.$FBRTCCallSummarya.video&&this.$FBRTCCallSummarya.video.sender)k(p,this.$FBRTCCallSummarya.video.sender);if(this.$FBRTCCallSummaryb)k(p.capture,this.$FBRTCCallSummaryb);return {sender:p};};o.prototype.$FBRTCCallSummaryD=function(){"use strict";return (new Date()).valueOf()-this.$FBRTCCallSummary1;};o.prototype.$FBRTCCallSummaryq=function(){"use strict";var p=l()-this.$FBRTCCallSummaryg;return Math.floor(this.$FBRTCCallSummaryh+p);};o.prototype.$FBRTCCallSummaryr=function(p){"use strict";if(this.$FBRTCCallSummary3[p])return;this.$FBRTCCallSummary3[p]=this.$FBRTCCallSummaryD();this.$FBRTCCallSummaryi[p]=this.$FBRTCCallSummaryq();};o.prototype.$FBRTCCallSummarys=function(p,q,r){"use strict";if(p){this.$FBRTCCallSummaryr(r);}else this.$FBRTCCallSummaryr(q);};o.prototype.$FBRTCCallSummaryn=function(){"use strict";this.$FBRTCCallSummary7=(new Date()).valueOf();};o.prototype.$FBRTCCallSummarym=function(){"use strict";return {device:j.deviceName,os:j.platformName,os_version:j.platformFullVersion,browser:j.browserName,browser_version:j.browserFullVersion,screen_height:window.screen.availHeight,screen_width:window.screen.availWidth};};e.exports=o;},null);
__d("FBRTCCallSummaryStore",["CacheStorage","FBRTCCallSummary","FBRTCLogger","areEqual"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k='localstorage',l='RTC_CALL_SUMMARY_',m='summary',n=2000,o=3,p=3*60*1000,q=null;r.getInstance=function(){"use strict";if(!q)q=new r();return q;};function r(){"use strict";this.$FBRTCCallSummaryStore0=new g(k,l);this.$FBRTCCallSummaryStore1=i.getInstance();}r.prototype.storeCallSummary=function(s,t,u){"use strict";var v=this;this.$FBRTCCallSummaryStore2(function(w){if(!w[s])w[s]={};var x=w[s][t];if(x){var y=v.$FBRTCCallSummaryStore3(x);if(y&&y.getLastUpdatedTime()>u.getLastUpdatedTime()){v.$FBRTCCallSummaryStore1.logToConsole('Outdated summaries');return null;}}w[s][t]=v.$FBRTCCallSummaryStore4(u);return w;},v.$FBRTCCallSummaryStore1.logError.bind(v.$FBRTCCallSummaryStore1,s,t));};r.prototype.retrieveCallSummary=function(s,t){"use strict";var u=this.$FBRTCCallSummaryStore5(),v=null;if(u[s])v=u[s][t];if(v){return this.$FBRTCCallSummaryStore3(v);}else return null;};r.prototype.removeCallSummary=function(s,t){"use strict";this.removeCallSummaries([{peerID:s,callID:t}]);};r.prototype.removeCallSummaries=function(s){"use strict";var t=this;this.$FBRTCCallSummaryStore2(function(u){var v=s.length;for(var w=0;w<v;w++){var x=s[w].peerID,y=s[w].callID;if(u[x]&&u[x][y]){delete u[x][y];if(t.$FBRTCCallSummaryStore6(u[x]))delete u[x];}}return u;},t.$FBRTCCallSummaryStore1.logError.bind(t.$FBRTCCallSummaryStore1,null,null));};r.prototype.getLoggableSummaries=function(){"use strict";var s=this.$FBRTCCallSummaryStore5(),t=[];for(var u in s)if(s.hasOwnProperty(u))for(var v in s[u])if(s[u].hasOwnProperty(v)){var w=this.$FBRTCCallSummaryStore3(s[u][v],p);if(w)t.push(w);}return t;};r.prototype.$FBRTCCallSummaryStore6=function(s){"use strict";for(var t in s)if(s.hasOwnProperty(t))return false;return true;};r.prototype.$FBRTCCallSummaryStore4=function(s){"use strict";var t={__t:Date.now(),__d:s.toJsonString()};return t;};r.prototype.$FBRTCCallSummaryStore3=function(s,t){"use strict";if(s)if(!t||(Date.now()-s.__t>=t))return h.fromJsonString(s.__d);return null;};r.prototype.$FBRTCCallSummaryStore5=function(){"use strict";var s=this.$FBRTCCallSummaryStore0.get(m)||{};return s;};r.prototype.$FBRTCCallSummaryStore2=function(s,t,u,v){"use strict";if(u===(void 0)||u===null)u=o;var w=this.$FBRTCCallSummaryStore5(),x=this.$FBRTCCallSummaryStore5(),y=s(w);if(y===null)return;var z=this.$FBRTCCallSummaryStore5();if(j(x,z)){this.$FBRTCCallSummaryStore0.set(m,y);this.$FBRTCCallSummaryStore1.logToConsole('Updated summaries');}else if(u>0){t('Retry lock');if(v){var aa=this;setTimeout(function(){aa.$FBRTCCallSummaryStore2(s,t,u-1,true);},n);}else this.$FBRTCCallSummaryStore2(s,t,u-1,true);}else t('Failed to lock');};e.exports=r;},null);
__d("FBRTCUtils",["emptyFunction","randomInt","AsyncRequest"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=6000,k={attachMediaStream:function(l,m){if(window.webkitRTCPeerConnection){l.src=window.webkitURL.createObjectURL(m);}else{l.mozSrcObject=m;l.play();}},reattachMediaStream:function(l,m){if(window.webkitRTCPeerConnection){l.src=m.src;}else{l.mozSrcObject=m.mozSrcObject;l.play();}},generateRandomInt:function(){return h(0,4294967294)+1;},aboutEqual:function(l,m){return (l-m)<.01&&(m-l)<.01;},sendServerRequest:function(l,m,n,o,p,q){m=m||g;n=n||g;o=o||false;p=p||j;q=q||{};var r=new i().setURI(l).setData(q).setAllowCrossPageTransition(true).setHandler(m).setErrorHandler(n).setTimeoutHandler(p,function(){n();});if(o)r.setOption('asynchronous',false);r.send();}};e.exports=k;},null);
__d("XVideoCallInitController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/videocall\/init\/",{peer_id:{type:"Int",required:true},call_id:{type:"Int",required:true},is_caller:{type:"Bool",defaultValue:false}});},null);
__d("XVideoCallController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/videocall\/incall\/",{peer_id:{type:"Int",required:true},call_id:{type:"Int"},is_caller:{type:"Bool",defaultValue:false}});},null);
__d("FBRTCUrlManager",["FBRTCLogger","FBRTCUtils","XVideoCallInitController","XVideoCallController"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=3,l=function(p,q,r){g.getInstance().logCallAction(p,q,g.CallAction.OLD_URI);return j.getURIBuilder().setInt('peer_id',p).setInt('call_id',q).setBool('is_caller',r).getURI();},m=function(p,q,r,s,t,u){if(u===(void 0)||u===null)u=k;var v=i.getURIBuilder().setInt('peer_id',p).setInt('call_id',q).setBool('is_caller',r).getURI();h.sendServerRequest(v,function(w){s(w.payload.uri);},function(w){if(u>0){m(p,q,r,s,t,u-1);}else s(l(p,q,r));});},n=function(p){window.history.replaceState({},'',p);},o={init:function(p){this._peerID=p;},onCallStarted:function(){n(l(this._peerID));},getCallUri:m};e.exports=o;},null);
__d("FBRTCCallUI",["BanzaiLogger","Cookie","UserAgent","FBRTCCallSummary","FBRTCCallSummaryStore","FBRTCConstants","FBRTCLogger","FBRTCUrlManager","pageID"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=null,q={openAsCaller:function(r,s,t){if(!p&&window.rtcCallChildWindow){p=window.rtcCallChildWindow;window.rtcCallChildWindow=null;}if(this._shouldFocusCallWindow(r)){p.focus();return;}if(this._shouldCloseCallWindow())p.close();g.log('VideoCallLoggerConfig',{event:'open_as_caller'});m.getInstance().logCallAction(r,s,m.CallAction.START_CALL,null,t);var u=new j({peerID:r,callID:s,isCaller:true});u.onCallStarted(t);this._open(r,s,true,u,false);},openAsCallee:function(r,s,t,u){g.log('VideoCallLoggerConfig',{event:'open_as_callee'});this._open(r,s,false,t,u);},_shouldFocusCallWindow:function(r){return p&&!p.closed&&p.rtcCallInProgessWith===r;},_shouldCloseCallWindow:function(){return p&&!p.closed&&!p.rtcCallInProgessWith;},_open:function(r,s,t,u,v){h.clear('vcpwn');h.clear('vctid');var w=this._windowPosition(),x=['menubar=no','location=no','scrollbars=no','status=no','personalbar=no',w.height,w.width,w.top,w.left].join(',');if(this._isSparkBrowser())x='';u.addExtraInfo(m.Key.INITIATED_BY_PAGE_ID,o);u.onCallEnded(l.CallEndReason.CLIENT_ERROR,false,true,'PopupPending');u.save(k.getInstance());g.log('VideoCallLoggerConfig',{event:'open_popup'});if(!v){p=window.open('','Video Call',x);this._setUri(p,r,s,t);}else{m.getInstance().logCallAction(r,s,m.CallAction.OPEN_POPUP);p=window.open(v,'Video Call',x);}if(window.focus)p.focus();},_setUri:function(r,s,t,u){n.getCallUri(s,t,u,function(v){m.getInstance().logCallAction(s,t,m.CallAction.OPEN_POPUP);r.location=v;},function(){m.getInstance().logCallAction(s,t,m.CallAction.FAILED_GETTING_URI);});},_windowPosition:function(){var r=933,s=700,t,u,v,w;if(window.innerWidth!==(void 0)){u=window.innerWidth;t=window.innerHeight;}else{u=screen.width;t=screen.height;}if(window.screenLeft!==(void 0)){v=window.screenLeft;w=window.screenTop;}else{v=window.screenX;w=window.screenY;}var x=Math.floor(((u/2)-(r/2))+v),y=Math.floor(((t/2)-(s/2))+w);return {height:'height='+s.toString(),width:'width='+r.toString(),top:'top='+y.toString(),left:'left='+x.toString()};},_isSparkBrowser:function(){return i.isBrowser('Chrome < 34')&&i.isBrowser('Chrome > 33');}};e.exports=q;},null);
__d("XBrowserNotSupportedDialogController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/videocall\/browser_not_supported\/",{user_id:{type:"Int"},warning:{type:"Bool",defaultValue:false},__asyncDialog:{type:"Int"}});},null);
__d("FBRTCSoundController",["RTCConfig","Sound"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=[g.ringtone_mp3_url,g.ringtone_ogg_url],j={playIncomingRingtone:function(k,l,m){var n=['incoming_ringtone',k.toString(),l.toString()].join('_');h.play(i,n,m);},stopIncomingRingtone:function(){h.stop(i);}};e.exports=j;},null);
__d("FBRTCUnsupportedBrowserMessage",["AsyncDialog","AsyncRequest","XBrowserNotSupportedDialogController","FBRTCSoundController"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k={_dialog:null,warnForOutgoingCall:function(l){var m=i.getURIBuilder().setBool('warning',true).getURI();this._presentDialog(m,l);},showForOutgoingCall:function(){var l=i.getURIBuilder().getURI();this._presentDialog(l);},showForIncomingCall:function(l,m){j.playIncomingRingtone(l,m,false);var n=i.getURIBuilder().setInt('user_id',m).getURI();this._presentDialog(n);},dismiss:function(){if(this._dialog)this._dialog.hide();},_presentDialog:function(l,m){if(this._dialog)return;var n=new h(l);g.send(n,function(o){this._dialog=o;o.subscribe('hide',function(){this._dialog=null;if(m)m();}.bind(this));}.bind(this));}};e.exports=k;},null);
__d("FBRTCCore",["Arbiter","ChatVisibility","FBRTCAvailability","FBRTCCallUI","FBRTCStruct","FBRTCUnsupportedBrowserMessage","mixInEventEmitter","PresencePrivacy","VideoCallSupport","fbt","randomInt","invariant"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();var s=false,t={startOutgoingCall:function(u,v){r(!isNaN(parseInt(u,10)));if(s)return;s=true;setTimeout(function(){s=false;},1000);if(o.isWebrtcSupported()){var w=this._generateCallID();j.openAsCaller(u,w,v);}else l.showForOutgoingCall();},isAvailableForWebrtcCalling:function(u){return i.isCallable(u);},callabilityForUser:function(u){if(!h.isOnline()){return t.CallabilityStatus.OFFLINE;}else if(t.isAvailableForWebrtcCalling(u)){return t.CallabilityStatus.AVAILABLE;}else if(!n.allows(u)){return t.CallabilityStatus.BLOCKED;}else return t.CallabilityStatus.UNAVAILABLE;},generateCallButtonTooltip:function(u,v){switch(v){case t.CallabilityStatus.AVAILABLE:return p._("Start a video call with {shortname}",[p.param("shortname",u)]);case t.CallabilityStatus.BLOCKED:return p._("You must turn on chat for {shortname} to make a call.",[p.param("shortname",u)]);case t.CallabilityStatus.UNAVAILABLE:return p._("{shortname} is currently unavailable for video calling",[p.param("shortname",u)]);case t.CallabilityStatus.OFFLINE:return p._("You must be online to make a call.");default:return p._("You must be online to make a call.");}},_generateCallID:function(){return q(0,4294967295);},buddyCallabilityChanged:function(){this.emit('callabilityChanged');}};t.CallabilityStatus=new k(['AVAILABLE','BLOCKED','OFFLINE','UNAVAILABLE']);g.subscribe(['buddylist/availability-changed'],function(u,v){t.buddyCallabilityChanged();});n.subscribe(['privacy-changed','privacy-availability-changed'],function(u,v){t.buddyCallabilityChanged();});m(t,{callabilityChanged:true});e.exports=t;},null);
__d("SamplingPolicyBase",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(){"use strict";throw 'Tried to instantiate SamplingPolicyBase';}g.prototype.getName=function(){"use strict";return this.name;};g.prototype.isSampled=function(){"use strict";if(typeof(this.sampled)=='undefined')this.sampled=this.decideIfSampled();return this.sampled;};e.exports=g;},null);
__d("FbtraceForcedByServerPolicy",["FbtraceForcedByServer","SamplingPolicyBase","copyProperties"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j;function k(){this.name='FbtraceForcedByServerPolicy';}k.get=function(){if(typeof(j)=='undefined')j=new k();return j;};function l(){return g.forced;}i(k.prototype,h.prototype,{decideIfSampled:l});e.exports=k;},null);
__d("Random",["Alea","ServerNonce"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';var h=b('ServerNonce').ServerNonce,i=g(h),j={random:i,uint32:function(){return Math.floor(i()*4294967296);}};e.exports=j;},null);
__d("guardFunction",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();function g(h,i,j){return function(){if(h.apply(j||this,arguments))i.apply(j||this,arguments);};}e.exports=g;},null);
__d("Fbtrace",["Arbiter","BanzaiScribe","ErrorUtils","FbtraceForcedByServer","FbtraceForcedByServerPolicy","Random","SiteData","copyProperties","guardFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',q='AAAAAAAAAAA';for(var r in Error)if(Error.hasOwnProperty(r))t[r]=Error[r];var s=Error===null?null:Error.prototype;t.prototype=Object.create(s);t.prototype.constructor=t;t.__superConstructor__=Error;function t(ia){Error.call(this,ia);}function u(ia){i.reportError(new t(ia));}function v(){var ia=function(){var la=0,ma=0,na='';for(var oa=10;oa>=0;oa--){if(la<6){ma=l.uint32();la=32;}if(oa===0)ma=ma&7;na=p.charAt(ma&63)+na;ma>>=6;la-=6;}return na;},ja,ka;for(ja=3;ja>0;ja--){ka=ia();if(ka!=q)return ka;}u('failed to generate valid Fbtrace id');return q;}function w(){n(this,w);}n(w,{isOn:function(){return false;},replySend:function(ia,ja){},requestSend:function(ia,ja,ka){ca(ia,ja);return {metadata:function(){return (void 0);},replyReceive:function(la){}};}});var x=new w();function y(ia,ja,ka){if(!ia)throw {name:'ArgumentError',message:'no valid service name specified'};if(!ja)throw {name:'ArgumentError',message:'no valid version specified'};var la=h,ma=0,na=v(),oa=v(),pa=ba(na),qa={service:ia,version:ja},ra=function(wa){if(typeof(wa)=='undefined')return 'undefined';if(typeof(wa)!='string')wa=ra(JSON.stringify(wa));return wa;},sa=function(wa){var xa='';for(var ya in wa){if(xa.length>0)xa+='\x02';xa+=ra(ya)+'\x03'+ra(wa[ya]);}return xa;},ta=function(wa,xa,event,ya,za){ma++;return [za,ma,na,wa,xa,ra(event),sa(ya)].join('\x01');},ua=function(wa,xa,event,ya,za){if(!za&&typeof(za)=='undefined')za=Date.now()*1000;var ab=ta(wa,xa,event,ya,za);la.log('fbtrace',ab,pa);},va=function(){return oa;};ua(q,oa,'#rqrecv',n(ka,qa));n(this,y);n(this,{replySend:function(wa,xa){xa=n(xa,qa,{success:wa?'true':'false'});ua(q,oa,'#rpsend',xa);},requestSend:function(wa,xa,ya){ca(wa,xa);var za=va(),ab=v();ya=n(ya,qa,{op:wa,'remote:service':xa});ua(za,ab,'#rqsend',ya);return {metadata:function(){return na+ab;},replyReceive:function(bb){ua(za,ab,'#rprecv',n(bb,qa));},parentNode:this};}});}n(y,{isOn:function(){return true;}});function z(){return x;}function aa(ia,ja,ka){ka=ka||{};ka.init=true;var la=k.get();if(la.isSampled()){return new y(ia,ja,ka);}else return new w();}function ba(ia){var ja=ia.charAt(ia.length-1);return p.indexOf(ja)%32;}function ca(ia,ja){if(!ia)throw {name:'ArgumentError',message:'no valid operation specified'};if(!ja)throw {name:'ArgumentError',message:'no valid remote:service specified'};}function da(ia,ja){var ka=x,la;x=ia;try{la=ja();}finally{x=ka;}return la;}var ea=function(ia,ja){var ka=z(),la=ja.request,ma=false;if(!ka.isOn()&&j.forced&&/\/upload\/(?:composer|photos)\/|\/ajax\/composerx\/attachment\/media\//.test(la.uri.toString())){ka=aa('photo_upload_kludge',String(m.revision||'dev'),{policy:'PhotoUpload'});ma=true;}if(ka.isOn()){var na=ma?{policy:'PhotoUpload'}:{};if(la.userActionId)na.user_action_id=la.userActionId;var oa=ka.requestSend(la.uri.toString(),'www',na);la.fbtraceRemoteNode=oa;la.transport.setRequestHeader('X-Fbtrace-Meta',oa.metadata());}},fa=function(ia,ja){ja.request.fbtraceRemoteNode.replyReceive({is_last:ja.response.is_last,success:true});setTimeout(function(){ja.request.fbtraceRemoteNode.parentNode.replySend(true,{});},0);},ga=function(ia,ja){ja.request.fbtraceRemoteNode.replyReceive({is_last:ja.response.is_last,success:false,error_code:ja.response.error,error_summary:ja.response.errorSummary,error_description:ja.response.errorDescription});setTimeout(function(){ja.request.fbtraceRemoteNode.parentNode.replySend(false,{});},0);},ha=function(ia,ja){return ja.request.fbtraceRemoteNode;};g.subscribe('AsyncRequest/will_send',ea);g.subscribe('AsyncRequest/response',o(ha,fa));g.subscribe('AsyncRequest/error',o(ha,ga));e.exports={defaultNode:z,requestReceive:aa,withDefaultNode:da};},null);
__d("VideoCallCore",["Arbiter","ChannelConstants","FBRTCCore","FBRTCLogger","FBRTCUnsupportedBrowserMessage","VideoCallSupport","FBRTCCallUI","FBRTCIncomingCallController","randomInt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=[],q=null,r=false,s={onRTCMessage:function(w){if(l.isReceiveWebrtcSupported()&&n){p.push(w);t();}},setRTCMessageHandler:function(w){this.onRTCMessage=w;if(w)while(p.length)w(p.shift());},availableForCall:function(w){return v(w);},showOutgoingCallDialog:function(w,x,y){if(r)return;r=true;setTimeout(function(){r=false;},1000);if(l.isWebrtcSupported()){this.makeWebRTCCall(w,y||j.Trigger.CHAT_TAB_ICON);}else k.showForOutgoingCall();},canCallByWebrtc:function(w){if(l.isSendWebrtcSupported())return v(w);return false;},makeWebRTCCall:function(w,x){var y=parseInt(w,10);t();var z=u();q.startingCallTo(y,z);m.openAsCaller(w,z,x);}};function t(){if(!q)q=new n(s);}function u(){return o(0,4294967295);}function v(w){return i.isAvailableForWebrtcCalling(w);}g.subscribe(h.getArbiterType('video'),function(w,x){});g.subscribe(h.getArbiterType('webrtc'),function(w,x){s.onRTCMessage(x.obj);});if(l.isReceiveWebrtcSupported())t();e.exports=s;},null);
__d("ChatAnimatedGifs",["URI"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h={shouldHideBody:function(i){if(!i.has_attachment)return false;for(var j=0;j<i.attachments.length;j++){var k=i.attachments[j];if(k.preview_url){var l=h.getRawUrlFromSafeUrl(k.preview_url);if(i.body==l)return true;}}return false;},getRawUrlFromSafeUrl:function(i){return g(i).getQueryData().url;}};e.exports=h;},null);
__d("MercuryDeliveryState",["MercuryConfig","MercuryIDs","MercuryServerRequests","MercurySingletonMixin","MercuryThreadInformer","PresencePrivacy","UserActivity","debounceAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();'use strict';var o=g.delivery_timeout||120000;function p(q){this.$MercuryDeliveryState0=q;this.$MercuryDeliveryState1=i.getForFBID(this.$MercuryDeliveryState0);this.$MercuryDeliveryState2=k.getForFBID(this.$MercuryDeliveryState0);this.$MercuryDeliveryState3=[];if(!g.ChatWebDRGK)return;this.$MercuryDeliveryState2.subscribe('messages-received',this.$MercuryDeliveryState4.bind(this));m.subscribe(n(this.$MercuryDeliveryState5,300,this));}p.prototype.$MercuryDeliveryState4=function(q,r){for(var s in r){var t=r[s];t.forEach(function(u){if(this.$MercuryDeliveryState7(u))this.$MercuryDeliveryState3.push(u);}.bind(this));}if(m.isActive(o))this.$MercuryDeliveryState5();};p.prototype.$MercuryDeliveryState5=function(){if(this.$MercuryDeliveryState3.length===0)return;var q=this.$MercuryDeliveryState3.filter(this.$MercuryDeliveryState7,this).map(function(r){return r.message_id;});if(q)this.$MercuryDeliveryState1.sendDeliveryReceipts(q);this.$MercuryDeliveryState3=[];};p.prototype.$MercuryDeliveryState7=function(q){var r=q.author?h.getUserIDFromParticipantID(q.author):null;if(r===this.$MercuryDeliveryState0)return false;if(!q.is_unread)return false;if(!l.allows(r))return false;return true;};Object.assign(p,j);e.exports=p;},null);
__d("MercuryStateCheck",["Arbiter","ChannelConstants","MercuryFolders","MessagingTag","URI","MercuryServerRequests"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=b('MercuryServerRequests').get(),m=false,n={initialize:function(){if(m)return;g.subscribe(h.ON_INVALID_HISTORY,o);d(['ChannelConnection'],function(p){p.subscribe(p.CONNECTED,function(q,r){if(!r.init)o();});});m=true;}};function o(){var p;if(k.getRequestURI().getPath().search(/messages/)!==-1){p=i.getSupportedFolders();}else p=[j.INBOX];l.fetchMissedMessages(p);}e.exports=n;},null);
__d("ChatCookieInterface",["ChatConfig","InitialServerTime","LogHistory","PresenceState","PresenceUtil"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i.getInstance('chat_cookie'),m=h.serverTime,n=g.get('tab_max_load_age')||3600000,o=m-n,p={store:function(r,s){if(r.uct2==s.lastChangeTime)return r;var t=q(r,s),u={};if(!t){u.old_tabs=r&&r.t2&&JSON.stringify(r.t2);u.old_promoted=r&&r.lm2;u.old_time=r&&r.uct2;u.old_reason=r&&r.tr;u.old_window=r&&r.tw;var v=[];s.tabs.forEach(function(w){if(!w.fragile){var x={i:w.id,si:w.server_id};if(w.raised)x.r=1;v.push(x);}});r.t2=v;r.lm2=s.promotedTab;r.uct2=s.lastChangeTime;r.tr=s.lastChangeReason;r.tw=k.getSessionID();u.new_tabs=JSON.stringify(r.t2);u.new_promoted=r.lm2;u.new_time=r.uct2;u.new_reason=r.tr;u.new_window=r.tw;l.debug('store',u);}else{u.tabs=r&&r.t2&&JSON.stringify(r.t2);u.promoted=r&&r.lm2;u.time=r&&r.uct2;u.reason=r&&r.tr;u.window=r&&r.tw;u.last_change_time=s.lastChangeTime;u.last_change_reason=s.lastChangeReason;u.min_change_time=o;l.warn('store_bad_state',u);}return r;}};function q(r,s){var t=j.verifyNumber(r.uct2);if(!t||typeof t!=='number'){l.warn('bad_cookie_version',r);return null;}if(t<s.lastChangeTime||t<o)return null;return t;}e.exports=p;},null);
__d("ChatTabModel",["Arbiter","ArbiterMixin","ChatBehavior","ChatDispatcher","ChatConfig","ChatCookieInterface","ChatTabActions","InitialServerTime","LogHistory","JSLogger","MercuryAssert","MercuryLocalIDs","PresenceState","PresenceUtil","areJSONRepresentationsEqual","copyProperties","MercuryServerRequests","MercuryThreads","MercuryTimestampTracker"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){b.__markCompiled&&b.__markCompiled();var w=b('MercuryServerRequests').get(),x=b('MercuryThreads').get(),y=b('MercuryTimestampTracker').get(),z=[],aa=null,ba=null,ca=null,da=n.serverTime,ea=k.get('tab_max_load_age')||3600000,fa=da-ea,ga=0,ha=20,ia=o.getInstance('chat_tab_model'),ja=false;function ka(hb){var ib=s.verifyNumber(hb.uct2);if(!ib||typeof ib!=='number'){ia.warn('bad_cookie_version',hb);return null;}if(ib<ga||ib<fa)return null;return ib;}function la(hb){if(hb){var ib=ka(hb);if(ib&&ib!==ga){var jb={};jb.old_tabs=JSON.stringify(z);jb.old_promoted=aa;jb.old_time=ga;jb.old_reason=ca;jb.window_id=t.getSessionID();jb.cookie_tabs=hb&&hb.t2&&JSON.stringify(hb.t2);jb.cookie_promoted=hb&&hb.lm2;jb.cookie_time=hb&&hb.uct2;jb.cookie_reason=hb&&hb.tr;jb.cookie_window=hb&&hb.tw;ga=ib;ca='load';var kb=ma(hb.t2,hb.lm2||null);jb.load_result=kb;jb.new_tabs=JSON.stringify(z);jb.new_promoted=aa;jb.new_time=ga;jb.new_reason=ca;var event='load';if(!ja)event+='_init';ia.log(event,jb);return kb;}}else ia.warn('load_bad_state',hb);return false;}function ma(hb,ib){if(na(hb,ib)){var jb=z.filter(function(mb){return mb.fragile;}),kb={};aa=null;z=hb.map(function(mb){var nb={id:mb.i,server_id:mb.si};if(nb.id==ib)aa=nb.id;if(mb.r)nb.raised=true;kb[nb.id]=nb;return nb;});z=z.filter(function(mb){return mb!=null;});if(ba)for(var lb in ba)if(!kb[lb]||!kb[lb].raised)delete ba[lb];jb=jb.filter(function(mb){return !kb[mb.id];});z=z.concat(jb);ra();return true;}return false;}function na(hb,ib){if(ib!=aa)return true;var jb=z.filter(function(mb){return !mb.fragile;});if(hb.length!=jb.length)return true;for(var kb=0,lb=hb.length;kb<lb;kb++)if(!u(hb[kb],jb[kb]))return true;return false;}function oa(hb,ib,jb){var kb=la(s.get());if(ib===(void 0)||ib>ga){if(hb()){kb=true;ca=jb||null;qa(ib);}}else ia.error('rejected',{change_time:ib,state_time:ga});kb&&pa();}function pa(){if(ja)fb.inform('chat/tabs-changed',fb.get());}function qa(hb){if(hb===(void 0))hb=Math.max(y.getLastUserMessageTimestamp()||1,ga+1);ga=hb;s.doSync();}function ra(hb){var ib=z.length-ha;if(ib>0)z=z.filter(function(jb){return jb.raised||jb.id==hb||ib--<=0;});if(ib>0)z=z.filter(function(jb){return jb.id==aa||jb.id==hb||ib--<=0;});}function sa(hb){for(var ib=0;ib<z.length;ib++)if(z[ib].id==hb)return ib;return -1;}function ta(hb,ib){var jb=x.getThreadMetaNow(hb);if(!jb)return false;if(jb.is_canonical_user){return va(hb,ib);}else{var kb=ua(hb);if(kb)w.getServerThreadID(hb,function(lb){if(ya(hb,lb)){qa();pa();}});return kb;}}function ua(hb){if(sa(hb)===-1){z.push({id:hb,fragile:true});ia.log('open_fragile_tab',{tabs:JSON.stringify(z),opened:hb,window_id:t.getSessionID()});return true;}return false;}function va(hb,ib){var jb=sa(hb);if(jb!=-1)if(z[jb].fragile){z.splice(jb,1);}else{ib&&(z[jb].signatureID=ib);return true;}for(var kb=0;kb<=z.length;kb++)if(kb==z.length||z[kb].fragile){z.splice(kb,0,{id:hb,signatureID:ib});ra(hb);ia.log('open_tab',{tabs:JSON.stringify(z),opened:hb,window_id:t.getSessionID()});return true;}}function wa(hb,ib,jb){q.isThreadID(hb);var kb=false;if(ba&&ib){ba[hb]=true;kb=true;}oa(function(){if(ta(hb,jb))kb=true;var lb=sa(hb);if(lb!=-1&&!z[lb].raised){z[lb].raised=true;kb=true;ia.log('raise_tab',{tabs:JSON.stringify(z),raised:hb,window_id:t.getSessionID()});}return kb;});}function xa(hb){var ib=sa(hb);if(ib!=-1&&(!z[ib].raised||aa!==hb)){z[ib].raised=true;aa=hb;return true;}return false;}function ya(hb,ib){var jb=sa(hb);if(jb!=-1&&z[jb].fragile){var kb=z[jb];kb.fragile=false;kb.server_id=ib;var lb=[];z.forEach(function(mb){if(mb.id!=hb){if(kb&&mb.fragile){lb.push(kb);kb=null;}lb.push(mb);}});if(kb)lb.push(kb);z=lb;ia.log('make_permanent',{tabs:JSON.stringify(z),tab_id:hb,window_id:t.getSessionID()});return true;}return false;}function za(hb,ib){q.isThreadID(hb);var jb=false;if(ba){delete ba[hb];jb=true;}oa(function(){if(ab(hb))jb=true;return jb;},(void 0),ib);}function ab(hb){var ib=sa(hb);if(hb==aa)aa=null;if(ib!=-1){z.splice(ib,1);ia.log('close_tab',{tabs:JSON.stringify(z),closed:hb,window_id:t.getSessionID()});return true;}return false;}function bb(){if(z.length){ia.log('close_all_tabs',{closed_tabs:JSON.stringify(z),window_id:t.getSessionID()});z=[];aa=null;if(ba)ba={};qa();pa();}}function cb(){var hb=[];for(var ib=0;ib<z.length;ib++)if(z[ib].fragile&&!x.isNewEmptyLocalThread(z[ib].id)){hb.push(z[ib]);z.splice(ib);pa();break;}ia.log('close_fragile_tabs',{tabs:JSON.stringify(z),fragile_closed:hb,window_id:t.getSessionID()});}function db(hb){q.isThreadID(hb);var ib=false;if(ba){delete ba[hb];ib=true;}oa(function(){var jb=sa(hb);if(jb!=-1&&z[jb].raised){delete z[jb].raised;ia.log('lower_tab',{tabs:JSON.stringify(z),lowered:hb,window_id:t.getSessionID()});ib=true;}return ib;});}function eb(){if(ba){oa(function(){var hb=false;z.forEach(function(ib){if(ib.raised!=ba[ib.id]){hb=true;if(ba[ib.id]){ib.raised=true;}else delete ib.raised;}});return hb;});ia.log('persist_local_raise',{tabs:JSON.stringify(z),window_id:t.getSessionID()});}}s.registerStateStorer(function(hb){return l.store(hb,{tabs:z,promotedTab:aa,lastChangeTime:ga,lastChangeReason:ca});});s.registerStateLoader(function(hb){if(la(hb))pa();});function fb(){}v(fb,h,{isTabPromoted:function(hb){if(hb)return hb==aa;return false;},indexOf:function(hb){return sa(hb);},getTab:function(hb){q.isThreadID(hb);var ib=this.indexOf(hb);if(ib>-1){var jb=z[ib];return v({},jb);}return null;},getEmptyTab:function(){var hb;for(var ib=0;ib<z.length;ib++){hb=z[ib].id;if(x.isNewEmptyLocalThread(hb))return hb;}hb=r.generateThreadID();x.createNewLocalThread(hb,[]);return hb;},get:function(){var hb=z.map(function(ib){var jb=v({},ib);delete jb.fragile;if(ba)jb.raised=ba[jb.id];return jb;});return {tabs:hb,promoted:aa};},openFragileTab:function(hb){q.isThreadID(hb);if(ua(hb))pa();},openTab:function(hb){q.isThreadID(hb);oa(ta.bind(null,hb));},raiseAndPromoteTab:function(hb,ib,jb,kb,lb){q.isThreadID(hb);var mb=false;if(ba&&ib){ba[hb]=true;mb=true;}oa(function(){if(ta(hb,jb))mb=true;if(xa(hb)){mb=true;ia.log('raise_and_promote_tab',{tabs:JSON.stringify(z),promoted:hb,window_id:t.getSessionID()});}return mb;},kb,lb);},promoteThreadInPlaceOfThread:function(hb,ib,jb,kb){q.isThreadID(hb);q.isThreadID(ib);oa(function(){var lb=sa(hb),mb=sa(ib);if(kb){aa=hb;}else if(aa===ib)return true;var nb=z[lb];if(jb){q.isThreadID(jb);var ob=sa(jb),pb=z[mb];z[mb]=nb;z.splice(lb,1);z.splice(ob,0,pb);}else{z[lb]=z[mb];z[mb]=nb;}return true;});}});g.subscribe(p.DUMP_EVENT,function(hb,ib){ib.chat_tabs={promoted:aa,tabs:z.map(function(jb){return v({},jb);}),time:ga,max_load_age:ea};});function gb(){var hb=i.ignoresRemoteTabRaise();if(hb&&!ba){ia.log('start_ignore_remote_raise');ba={};pa();}else if(!hb&&ba){ia.log('stop_ignore_remote_raise');ba=null;pa();}}j.register(function(hb){switch(hb.actionType){case m.Types.CLOSE_TAB:za(hb.threadID,hb.reason);break;case m.Types.CLOSE_ALL_TABS:bb();break;case m.Types.CLOSE_FRAGILE_TABS:cb();break;case m.Types.LOWER_TAB:db(hb.threadID);break;case m.Types.PERSIST_LOCAL_STATE:eb();break;case m.Types.PROMOTE_TAB:q.isThreadID(hb.threadID);oa(xa.bind(null,hb.threadID));break;case m.Types.RAISE_TAB:wa(hb.threadID,hb.userAction,hb.signatureID);break;}});i.subscribe(i.ON_CHANGED,gb);gb();la(s.getInitial(),true);if(ga===0)ga=da-600000;ja=true;e.exports=fb;},null);
__d("ChatTabPresence",["AvailableList","ChatTabModel","MercuryIDs"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={};function k(l){var m=i.getUserIDFromThreadID(l);if(m)g.updateForID(m);}h.subscribe('chat/tabs-changed',function(event,l){l.tabs.forEach(function(m){if(m.raised&&!j[m.id])k(m.id);});j={};l.tabs.forEach(function(m){if(m.raised)j[m.id]=true;});});e.exports={};},null);
__d("ChatMentionsNotifications",["fbt","CurrentUser","MercuryParticipants"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={notifyIfMessageToMe:function(k){var l='fbid:'+h.getID(),m=k.body;i.get(l,function(n){var o=new RegExp(n.short_name,"i");if(o.test(m))j._notify(k);});},_notify:function(k){var l=48,m=k.body;if(m.length>l)m=m.substr(0,l-3)+"...";new Notification(g._("You were tagged in a message!"),{body:m,icon:"http://facebook.com//images/icons-large/fb-xl.png"});}};e.exports=j;},null);
__d("ChatAddToThreadButton.react",["Link.react","ReactComponentWithPureRenderMixin","React","TrackingNodes","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=i,n=m.PropTypes,o=i.createClass({displayName:"ChatAddToThreadButton",mixins:[h],propTypes:{isFBAtWork:n.bool,onClick:n.func,shown:n.bool},render:function(){var p=this.props.isFBAtWork?l._("Add more colleagues to chat"):l._("Add more friends to chat"),q=j.getTrackingInfo(j.types.ADD_TO_THREAD);return (i.createElement(g,{"aria-label":p,className:(("addToThread")+(' '+"button")+(!this.props.shown?' '+"hidden_elem":'')),"data-ft":q,"data-hover":"tooltip","data-tooltip-alignv":"top",onClick:this.props.onClick}));}});e.exports=o;},null);
__d("ChatArchiveWarning.react",["Image.react","ReactComponentWithPureRenderMixin","React","cx","ix"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i,m=l.PropTypes,n=i.createClass({displayName:"ChatArchiveWarning",mixins:[h],propTypes:{isFBAtWork:m.bool,shown:m.bool},render:function(){var o=this.props.isFBAtWork?k('images/chat/tab/archive-grey.png'):k('images/chat/tab/archive.png');return (i.createElement(g,{src:o,className:(("titanArchiveWarning")+(' '+"button")+(!this.props.shown?' '+"hidden_elem":'')),"data-hover":"tooltip","data-tooltip-alignh":"center","aria-label":"All employee-to-employee conversations will be archived"}));}});e.exports=n;},null);
__d("ChatCloseButton.react",["Link.react","ReactComponentWithPureRenderMixin","React","TrackingNodes","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=i,m=l.PropTypes,n=i.createClass({displayName:"ChatCloseButton",mixins:[h],propTypes:{onClick:m.func,onKeyUp:m.func,onMouseDown:m.func,active:m.bool},getDefaultProps:function(){return {active:false};},render:function(){var o=j.getTrackingInfo(j.types.CLOSE_BUTTON),p=k._("Press Esc to close"),q=k._("Close tab");return (i.createElement(g,{"aria-label":this.props.active?p:q,className:"close button","data-ft":o,"data-hover":"tooltip","data-tooltip-position":"above",onClick:this.props.onClick,onKeyUp:this.props.onKeyUp,onMouseDown:this.props.onMouseDown}));}});e.exports=n;},null);
__d("VideoCallTourDialog",["ArbiterMixin","LegacyContextualDialog","CSS","MercuryIDs","ChatTabTemplates","VideoCallCore","VideoCallingTour","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();function o(){this._dialog=null;}n(o.prototype,g);n(o.prototype,{render:function(p,q){var r=j.getUserIDFromThreadID(q);if(!r||!l.availableForCall(r))return;var s=k[':fb:mercury:call:tour'].build();this._dialog=new h();this._dialog.init(s.getRoot()).setWidth(250).setAlignH('center').setContext(p).show();i.addClass(this._dialog.getRoot(),'uiContextualDialogWithFooterArrowBottom');i.addClass(p,'video_call_tour');this.inform('chat/dialog-rendered',{dialog:this,thread_id:q});m.inform('videocallingtour/end');},updatePosition:function(){if(this._dialog&&this._dialog.isShown())this._dialog.updatePosition();},hide:function(){if(this._dialog&&this._dialog.isShown()){this._dialog.hide();this._dialog=null;}}});e.exports=o;},null);
__d("ChatContextualDialogController",["Event","ArbiterMixin","ChatTabModel","VideoCallingTour","VideoCallTourDialog","copyProperties","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();var n=60000,o=false,p=function(w,x){this._videoCallTour=new k();this._threadID=w;this._tabMainElement=x;this._openDialog=null;this._subscriptionTokens=[];this._scrollListener=null;this._timeout=null;};function q(w,event,x){if(w._openDialog)w._openDialog.updatePosition();}function r(w){if(w._openDialog)w._openDialog.updatePosition();}function s(w){if(w._openDialog){w._openDialog.hide();w._openDialog=null;}if(w._timeout){clearTimeout(w._timeout);w._timeout=null;}while(w._subscriptionTokens.length)w._subscriptionTokens.pop().unsubscribe();if(w._scrollListener){w._scrollListener.remove();w._scrollListener=null;}}function t(w,event,x){if(x.thread_id===w._threadID){w._openDialog=x.dialog;v(w);w._timeout=m(w.destroy.bind(w,w._threadID),n);w._scrollListener=g.listen(window,'scroll',r.bind(null,w));}}function u(w,x){if(!w._openDialog){w._subscriptionTokens.push(x.subscribe('chat/dialog-rendered',t.bind(null,w)));x.render(w._tabMainElement,w._threadID);}}function v(w){w._subscriptionTokens.push(i.subscribe('chat/tabs-changed',q.bind(null,w)),p.subscribe('dialog/close-all',s.bind(null,w)));}l(p,h);l(p.prototype,{destroy:function(){s(this);},tabFocused:function(){if(o){u(this,this._videoCallTour);return;}},tabNotActive:function(){s(this);},hideVideoCallouts:function(){s(this);}});j.subscribe('videocallingtour/start',function(){o=true;p.inform('dialog/close-all');});j.subscribe('videocallingtour/end',function(){o=false;});e.exports=p;},null);
__d("ChatEmployeeAwayWarning",["MercuryIDs","MercuryParticipants","MercuryViewer"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j={updateEmployeeAwayWarning:function(k,l,m){h.get(i.getID(),function(n){var o=n.employee;if(o)h.getMulti(k.participants,function(p){var q=false,r=g.getUserIDFromThreadID(k.thread_id);if(!r)return;var s='fbid:'+r;for(var t in p)if(s==p[t].id&&p[t].is_employee_away)q=true;if(q){l();}else m();});});}};e.exports=j;},null);
__d("getImageSize",["DataViewPolyfill"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=a.DataView||g;function i(m){return {width:m.getUint16(6,true),height:m.getUint16(8,true)};}function j(m){return {width:m.getUint32(16,false),height:m.getUint32(20,false)};}function k(m){var n=m.byteLength,o=2;while(o<n){var p=m.getUint16(o,false);o+=2;if(p==65472||p==65474){return {width:m.getUint16(o+5,false),height:m.getUint16(o+3,false)};}else o+=m.getUint16(o,false);}return null;}function l(m){var n=new h(m);if(n.getUint8(0)==255&&n.getUint8(1)==216)return k(n);if(n.getUint8(0)==71&&n.getUint8(1)==73&&n.getUint8(2)==70)return i(n);if(n.getUint8(0)==137&&n.getUint8(1)==80&&n.getUint8(2)==78&&n.getUint8(3)==71)return j(n);return null;}e.exports=l;l.gif=i;l.png=j;l.jpeg=k;},null);
__d("ChatAutoSendPhotoUploader",["ArbiterMixin","AsyncUploadRequest","DOM","Event","FileForm","FileFormResetOnSubmit","FileInput","FormSubmitOnChange","JpegResizer","MercuryAttachmentType","PhotosMimeType","PhotosUploadID","SubscriptionsHandler","arrayContains","csx","getImageSize","getObjectValues","invariant","isEmpty","mixin"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){b.__markCompiled&&b.__markCompiled();"use strict";function aa(){return 'upload_'+r.getNewID();}var ba=z(g);for(var ca in ba)if(ba.hasOwnProperty(ca))ea[ca]=ba[ca];var da=ba===null?null:ba.prototype;ea.prototype=Object.create(da);ea.prototype.constructor=ea;ea.__superConstructor__=ba;function ea(fa,ga,ha){this.$ChatAutoSendPhotoUploader0=ha;this.$ChatAutoSendPhotoUploader1=ga;this.$ChatAutoSendPhotoUploader2=new s();this.$ChatAutoSendPhotoUploader3={};this.$ChatAutoSendPhotoUploader4={};this.$ChatAutoSendPhotoUploader5=fa.getAttribute('action');this.$ChatAutoSendPhotoUploader6=new k(fa,[n,l]);this.$ChatAutoSendPhotoUploader6.setAllowCrossOrigin(true);this.$ChatAutoSendPhotoUploader6.setUploadInParallel(true);var ia=i.find(fa,"._4q60"),ja=i.find(ia,"._4q61");this.$ChatAutoSendPhotoUploader7=new m(ia,ja,ga);this.$ChatAutoSendPhotoUploader2.addSubscriptions(this.$ChatAutoSendPhotoUploader6.subscribe('submit',this.$ChatAutoSendPhotoUploader8.bind(this)),this.$ChatAutoSendPhotoUploader6.subscribe('success',this.$ChatAutoSendPhotoUploader9.bind(this)),this.$ChatAutoSendPhotoUploader6.subscribe('failure',this.$ChatAutoSendPhotoUploadera.bind(this)),this.$ChatAutoSendPhotoUploader6.subscribe('progress',this.$ChatAutoSendPhotoUploaderb.bind(this)),j.listen(ja,'click',function(){if(this.$ChatAutoSendPhotoUploaderc)if(o.prepareResource)o.prepareResource();this.inform('open');}.bind(this)));this.$ChatAutoSendPhotoUploaderc=o.isSupported();if(this.$ChatAutoSendPhotoUploaderc)this.$ChatAutoSendPhotoUploader6.setPreprocessHandler(this.$ChatAutoSendPhotoUploaderd.bind(this));}ea.prototype.isUploading=function(){return !y(this.$ChatAutoSendPhotoUploader3);};ea.prototype.destroy=function(){this.$ChatAutoSendPhotoUploader2.release();this.$ChatAutoSendPhotoUploader6.destroy();this.$ChatAutoSendPhotoUploader3={};this.$ChatAutoSendPhotoUploader4={};};ea.prototype.$ChatAutoSendPhotoUploadere=function(fa,ga){var ha=this.$ChatAutoSendPhotoUploaderf(fa);if(ga){ha.preview_width=ga.width;ha.preview_height=ga.height;}return ha;};ea.prototype.$ChatAutoSendPhotoUploaderf=function(fa){var ga={upload_id:fa,on_progress:function(ha){this.$ChatAutoSendPhotoUploader2.addSubscriptions(this.subscribe('progress',ha));}.bind(this),on_resizing_progress:function(ha){this.$ChatAutoSendPhotoUploader2.addSubscriptions(this.subscribe('resize_progress',ha));}.bind(this),on_success:function(ha){this.$ChatAutoSendPhotoUploader2.addSubscriptions(this.subscribe('success',ha));}.bind(this),upload_canceled:this.$ChatAutoSendPhotoUploaderg.bind(this),attach_type:p.PHOTO,preview_uploading:true};return ga;};ea.prototype.$ChatAutoSendPhotoUploaderd=function(fa,ga){var ha=fa.getFile();if(!q(ha.type).isJpeg())return ga(fa);o.getSingleton().resizeBlob(ha,function(ia,ja,ka){if(ja)fa.setFile(ja);ga(fa);},this.$ChatAutoSendPhotoUploaderh.bind(this,fa));};ea.prototype.$ChatAutoSendPhotoUploader8=function(){var fa=aa();this.$ChatAutoSendPhotoUploaderi(fa,this.$ChatAutoSendPhotoUploader1.files);};ea.prototype.$ChatAutoSendPhotoUploaderi=function(fa,ga){var ha={};if(typeof FileReader!=='undefined'&&FileReader.prototype.readAsArrayBuffer&&ga&&ga.length===1){this.$ChatAutoSendPhotoUploader3[fa]=fa;ha[fa]=ga[0];var ia=new FileReader();ia.onload=function(){this.inform('submit',{upload_id:fa,preview_attachments:[this.$ChatAutoSendPhotoUploadere(fa,v(ia.result))]});}.bind(this);ia.onerror=function(){this.inform('submit',{upload_id:fa,preview_attachments:[this.$ChatAutoSendPhotoUploaderf(fa)]});}.bind(this);ia.readAsArrayBuffer(ga[0]);}else{var ja=[];if(!ga){this.$ChatAutoSendPhotoUploader3[fa]=fa;this.$ChatAutoSendPhotoUploader0.value=fa;ja.push(this.$ChatAutoSendPhotoUploaderf(fa));}else for(var ka=0;ka<ga.length;++ka){var la=aa();ha[la]=ga[ka];this.$ChatAutoSendPhotoUploader3[la]=fa;ja.push(this.$ChatAutoSendPhotoUploaderf(la));}this.inform('submit',{upload_id:fa,preview_attachments:ja});}if(Object.keys(ha).length>0)this.$ChatAutoSendPhotoUploader6.setFiles(ha);};ea.prototype.$ChatAutoSendPhotoUploader9=function(event,fa){var ga=this.$ChatAutoSendPhotoUploaderj(fa);if(this.$ChatAutoSendPhotoUploader3[ga]){var ha=this.$ChatAutoSendPhotoUploader3[ga];delete this.$ChatAutoSendPhotoUploader3[ga];var ia=fa.response.getPayload();if(!this.$ChatAutoSendPhotoUploader4[ha])this.$ChatAutoSendPhotoUploader4[ha]=[];this.$ChatAutoSendPhotoUploader4[ha].push({id:ga,image_id:ia.metadata[0].image_id,file_id:ia.metadata[0].file_id,gif_id:ia.metadata[0].gif_id});this.inform('success',{upload_id:ga});if(!this.$ChatAutoSendPhotoUploaderk(ha))this.$ChatAutoSendPhotoUploaderl(ha);this.$ChatAutoSendPhotoUploader7.clear();}};ea.prototype.$ChatAutoSendPhotoUploaderl=function(fa){x(!this.$ChatAutoSendPhotoUploaderk(fa));this.$ChatAutoSendPhotoUploader4[fa].sort(function(ga,ha){return ga.id<ha.id?-1:1;});this.inform('all-uploads-completed',{upload_id:fa,image_ids:this.$ChatAutoSendPhotoUploader4[fa].map(function(ga){return ga.image_id;}),file_ids:this.$ChatAutoSendPhotoUploader4[fa].map(function(ga){return ga.file_id;}),gif_ids:this.$ChatAutoSendPhotoUploader4[fa].map(function(ga){return ga.gif_id;})});delete this.$ChatAutoSendPhotoUploader4[fa];};ea.prototype.$ChatAutoSendPhotoUploaderb=function(event,fa){this.inform('progress',{upload_id:fa.upload.getName(),event:fa.event});};ea.prototype.$ChatAutoSendPhotoUploaderh=function(fa,event){this.inform('resize_progress',{upload_id:fa.getName(),event:event});};ea.prototype.$ChatAutoSendPhotoUploaderk=function(fa){return t(w(this.$ChatAutoSendPhotoUploader3),fa);};ea.prototype.$ChatAutoSendPhotoUploadera=function(event,fa){var ga=this.$ChatAutoSendPhotoUploaderj(fa);this.$ChatAutoSendPhotoUploaderm(ga,'last-upload-failed');this.$ChatAutoSendPhotoUploader7.clear();return false;};ea.prototype.$ChatAutoSendPhotoUploaderg=function(fa){this.$ChatAutoSendPhotoUploaderm(fa,'last-upload-canceled');};ea.prototype.$ChatAutoSendPhotoUploaderm=function(fa,ga){if(!this.$ChatAutoSendPhotoUploader3[fa])return;var ha=this.$ChatAutoSendPhotoUploader3[fa];delete this.$ChatAutoSendPhotoUploader3[fa];if(!this.$ChatAutoSendPhotoUploaderk(ha))if(this.$ChatAutoSendPhotoUploader4[ha]){this.$ChatAutoSendPhotoUploaderl(ha);}else this.inform(ga,{upload_id:ha});};ea.prototype.$ChatAutoSendPhotoUploaderj=function(fa){if(fa.upload){return fa.upload.getName();}else return fa.response.getPayload().uploadID;};ea.prototype.uploadFile=function(fa){var ga=aa(),ha={};ha[ga]=fa;var ia=new h(this.$ChatAutoSendPhotoUploader5).setAllowCrossOrigin(true).setRelativeTo(this.$ChatAutoSendPhotoUploader6.getRoot()).setFiles(ha);this.$ChatAutoSendPhotoUploader2.addSubscriptions(ia.subscribe('success',function(event,ja){this.$ChatAutoSendPhotoUploader9(event,{upload:ja,response:ja.getResponse()});}.bind(this)),ia.subscribe('failure',this.$ChatAutoSendPhotoUploadera.bind(this)));ia.send();this.$ChatAutoSendPhotoUploaderi(ga,[fa]);};e.exports=ea;},null);
__d("ChatPhotoUploader.react",["ChatAutoSendPhotoUploader","Image.react","InlineBlock.react","Link.react","MercuryConfig","React","SubscriptionsHandler","cx","emptyFunction","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();'use strict';var r=l,s=r.PropTypes,t=l.createClass({displayName:"ChatPhotoUploader",propTypes:{actionURI:s.string,imageClassName:s.string,imagesOnly:s.bool,onSubmit:s.func,onAllUploadsComplete:s.func,onLastUploadFail:s.func,onLastUploadCancel:s.func},getDefaultProps:function(){return {actionURI:k.upload_url,imageClassName:"_509w",imagesOnly:true,onSubmit:o,onAllUploadsComplete:o,onLastUploadFail:o,onLastUploadCancel:o};},componentDidMount:function(){this._uploader=new g(l.findDOMNode(this.refs.form),l.findDOMNode(this.refs.input),l.findDOMNode(this.refs.attachID));this._subscriptions=new m();this._subscriptions.addSubscriptions(this._uploader.subscribe('submit',this._handleSubmit),this._uploader.subscribe('all-uploads-completed',this._handleAllUploadsCompleted),this._uploader.subscribe('last-upload-failed',this._handleLastUploadFailed),this._uploader.subscribe('last-upload-canceled',this._handleLastUploadCanceled));},shouldComponentUpdate:function(u,v){return u.actionURI!=this.props.actionURI;},componentWillUnmount:function(){this._subscriptions&&this._subscriptions.release();this._uploader&&this._uploader.destroy();},render:function(){return (l.createElement("form",{action:this.props.actionURI,method:"post",ref:"form"},l.createElement("input",{type:"hidden",name:"attach_id",ref:"attachID"}),l.createElement("input",{type:"hidden",name:"images_only",value:this.props.imagesOnly}),l.createElement(i,{className:"_m _4q60 _3rzn"},l.createElement(j,{className:"_4q61 _509v"},l.createElement(h,{className:this.props.imageClassName,src:q('/images/chat/chat_camera_icon.png'),alt:p._("Camera")})),l.createElement("input",{type:"file",className:"_n",name:"attachment[]",multiple:"true",accept:this.props.imagesOnly?'image/*':'*',ref:"input"}))));},_handleSubmit:function(u,v){this.props.onSubmit(u,v);},_handleAllUploadsCompleted:function(u,v){this.props.onAllUploadsComplete(u,v);},_handleLastUploadFailed:function(u,v){this.props.onLastUploadFail(u,v);},_handleLastUploadCanceled:function(u,v){this.props.onLastUploadCancel(u,v);},isUploading:function(){return this._uploader&&this._uploader.isUploading();},uploadFile:function(u){this._uploader.uploadFile(u);}});e.exports=t;},null);
__d("ChatPrivacyActionController",["ChatVisibility","JSLogger","PresencePrivacy","copyProperties"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=function(l,m){this._userID=l;this._logger=h.create('blackbird');this._getState=function(){if(g.isOnline())return i.allows(this._userID)?k.NORMAL:k.BLOCKED;return k.OFFLINE;};this._togglePrivacy=function(){var n=this._getState();switch(this._getState()){case k.OFFLINE:if(g.isOnline()){this._logger.error('tabs_already_online');break;}this._logger.log('tabs_go_online',{tab_id:this._userID});g.goOnline(function(){if(!i.allows(this._userID)){if(this._getState()!==k.BLOCKED)this._logger.error('privacy_action_controller_blocked_inconsistency');this._togglePrivacy();}}.bind(this));break;case k.BLOCKED:i.allow(this._userID);this._logger.log('tabs_unblock',{tab_id:this._userID});break;case k.NORMAL:i.disallow(this._userID);this._logger.log('tabs_block',{tab_id:this._userID});break;}};setTimeout(function(){var n=function(){m&&m(this._getState());}.bind(this);n();this._subscribeToken=i.subscribe('privacy-changed',n);}.bind(this),0);};k.OFFLINE='offline';k.BLOCKED='blocked';k.NORMAL='normal';j(k.prototype,{togglePrivacy:function(){this._logger.log('gear_menu_toggle_privacy',{tab_id:this._userID});this._togglePrivacy();},destroy:function(){this._subscribeToken&&i.unsubscribe(this._subscribeToken);}});e.exports=k;},null);
__d("ChatShareLinkUploader",["AsyncRequest","CSS","DOM","URLScraper","MercuryShareLinkUploader","MercuryAttachmentTemplates","Event"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();for(var n in k)if(k.hasOwnProperty(n))p[n]=k[n];var o=k===null?null:k.prototype;p.prototype=Object.create(o);p.prototype.constructor=p;p.__superConstructor__=k;function p(q,r,s,t,u){"use strict";this.$ChatShareLinkUploader0=q;this.$ChatShareLinkUploader1=r;this.$ChatShareLinkUploader2=s;this.$ChatShareLinkUploader3=false;this.$ChatShareLinkUploader4=null;this.$ChatShareLinkUploader5=t;this.$ChatShareLinkUploader6=u;this.$ChatShareLinkUploader7=false;m.listen(r,'keyup',function(){!this.getInputValue().length&&this.$ChatShareLinkUploader8.enable();}.bind(this));this.$ChatShareLinkUploader8=new j(r,t);this.$ChatShareLinkUploader8.subscribe('match',function(v,w){this.loadShare(w&&w.url);}.bind(this));this.$ChatShareLinkUploader9=1337;this.$ChatShareLinkUploadera=null;}p.prototype.getInputValue=function(){"use strict";return this.$ChatShareLinkUploader5?this.$ChatShareLinkUploader5():this.$ChatShareLinkUploader1.value;};p.prototype.getAttachData=function(){"use strict";return this.loadAttachData(this.$ChatShareLinkUploader3,this.$ChatShareLinkUploader0,this.$ChatShareLinkUploader1,this.$ChatShareLinkUploader5);};p.prototype.getShareData=function(){"use strict";if(!this.$ChatShareLinkUploader3)return null;return this.getShareDataFromStage(this.$ChatShareLinkUploader3,this.$ChatShareLinkUploader0);};p.prototype.close=function(){"use strict";this.$ChatShareLinkUploaderb();this.$ChatShareLinkUploader8.disable();this.inform('closed');};p.prototype.clear=function(){"use strict";this.$ChatShareLinkUploaderb();this.$ChatShareLinkUploader8.enable();};p.prototype.$ChatShareLinkUploaderb=function(){"use strict";var q=this.$ChatShareLinkUploadera;delete this.$ChatShareLinkUploadera;if(q){i.remove(q);this.inform('dom-updated');}this.$ChatShareLinkUploaderc();this.$ChatShareLinkUploader3=false;this.$ChatShareLinkUploader7=false;this.$ChatShareLinkUploader4&&this.$ChatShareLinkUploader4.abort();this.$ChatShareLinkUploader4=null;this.$ChatShareLinkUploader8&&this.$ChatShareLinkUploader8.reset();};p.prototype.loadShareFromParams=function(q,r){"use strict";this.$ChatShareLinkUploader7=true;this.$ChatShareLinkUploaderd(new g().setMethod('POST').setURI('/ajax/share_params.php').setData({chat:true,share_type:q,share_params:r}));};p.prototype.loadShare=function(q,r){"use strict";this.$ChatShareLinkUploaderd(new g().setMethod('POST').setURI('/ajax/share_scrape.php').setData({chat:true,extra_params:JSON.stringify(r),u:q}),q);};p.prototype.loadedFromFeed=function(){"use strict";return this.$ChatShareLinkUploader7;};p.prototype.$ChatShareLinkUploaderc=function(){"use strict";return (++this.$ChatShareLinkUploader9);};p.prototype.$ChatShareLinkUploadere=function(){"use strict";return this.$ChatShareLinkUploader9;};p.prototype.$ChatShareLinkUploaderd=function(q,r){"use strict";this.$ChatShareLinkUploader4&&this.$ChatShareLinkUploader4.abort();var s=l[':fb:mercury:share-link-row'].build();if(this.$ChatShareLinkUploadera)i.remove(this.$ChatShareLinkUploadera);this.$ChatShareLinkUploadera=s.getRoot();m.listen(s.getNode('closeFileUpload'),'click',function(event){this.close();event.kill();}.bind(this));i.appendContent(this.$ChatShareLinkUploader0,this.$ChatShareLinkUploadera);h.show(this.$ChatShareLinkUploader0);this.inform('dom-updated');var t=this.$ChatShareLinkUploaderc();this.$ChatShareLinkUploader4=q.setHandler(function(u){return this.$ChatShareLinkUploaderf(t,u,r);}.bind(this));this.$ChatShareLinkUploader4.send();this.inform('link-detected');};p.prototype.$ChatShareLinkUploaderf=function(q,r,s){"use strict";if(this.$ChatShareLinkUploadere()!==q)return;this.$ChatShareLinkUploader4=null;i.appendContent(this.$ChatShareLinkUploadera,r.payload);this.$ChatShareLinkUploader2();this.$ChatShareLinkUploader3=true;if(!this.getAttachData()){this.close();if(s&&this.getInputValue().indexOf(s)===-1)this.$ChatShareLinkUploader6(s);return;}h.addClass(this.$ChatShareLinkUploadera,'done');};e.exports=p;},null);
__d("StickerContextualDialog.react",["ReactAbstractContextualDialog","ReactLayer","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=47,k=h.createClass(g.createSpec({displayName:'StickerXUIContextualDialog',theme:{wrapperClassName:"_53ii",arrowDimensions:{offset:j,length:16}}}));k.WIDTH={NORMAL:312,WIDE:400};e.exports=k;},null);
__d("MessagesEmoticons.react",["Grid.react","React","cx","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=g.GridItem,m=h,n=m.PropTypes,o=8,p={smile:k._("smile"),frown:k._("frown"),tongue:k._("tongue"),grin:k._("grin"),gasp:k._("gasp"),wink:k._("wink"),pacman:k._("pacman"),grumpy:k._("grumpy"),unsure:k._("unsure"),cry:k._("cry"),kiki:k._("kiki"),glasses:k._("glasses"),sunglasses:k._("sunglasses"),heart:k._("heart"),devil:k._("devil"),angel:k._("angel"),squint:k._("squint"),confused:k._("confused"),upset:k._("upset"),colonthree:k._("colon three"),like:k._("Like")},q=h.createClass({displayName:"MessagesEmoticons",propTypes:{onEmoticonSelect:n.func},getDefaultProps:function(){return {onEmoticonSelect:j};},getEmoticons:function(){return Object.keys(p).map(function(r){return (h.createElement(l,{key:r},h.createElement("div",{className:"panelCell"},h.createElement("a",{"aria-label":p[r],className:'emoticon emoticon_'+r,onClick:function(){return this.props.onEmoticonSelect(r);}.bind(this)}))));}.bind(this));},render:function(){return (h.createElement("div",{className:"emoticonsTable"},h.createElement(g,{cols:o,alignv:"middle",alignh:"center",spacing:"pam"},this.getEmoticons())));}});e.exports=q;},null);
__d("StickerActions",["BanzaiLogger","StickerConstants","StickersDispatcher"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j={addPack:function(k){i.handleUpdateFromViewActions({actions:[{actionType:h.ActionTypes.ADD_PACK,packID:k}]});},removePack:function(k){i.handleUpdateFromViewActions({actions:[{actionType:h.ActionTypes.REMOVE_PACK,packID:k}]});},selectPack:function(k,l){if(!l)g.log('StickersLoggerConfig',{event:'select_pack',packid:k});i.handleUpdateFromViewActions({actions:[{actionType:h.ActionTypes.SELECT_PACK,packID:k}]});},resetNumNewPacks:function(){i.handleUpdateFromViewActions({actions:[{actionType:h.ActionTypes.RESET_NUM_NEW_PACKS}]});}};e.exports=j;},null);
__d("XStickerPackImagesController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/{pack_id}\/images\/",{pack_id:{type:"Int",required:true},sticker_size:{type:"Int",defaultValue:50}});},null);
__d("XStickersAddPackController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/addpack\/",{pack_id:{type:"Int"},size:{type:"String"},redirect_uri:{type:"String"},is_promoted:{type:"Bool",defaultValue:false}});},null);
__d("XStickersRemovePackController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/removepack\/",{pack_id:{type:"Int"},size:{type:"String"},redirect_uri:{type:"String"}});},null);
__d("XStickerStateInitialDataController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/state\/",{});},null);
__d("XStickerStatePackDataController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/state\/pack\/",{pack_id:{type:"Int",required:true}});},null);
__d("XStickerStateStoreDataController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/state\/store\/",{});},null);
__d("XStickerSearchPromotePackController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/search\/promotePack\/",{sticker_id:{type:"Int",required:true}});},null);
__d("XStickerSearchNUXSeenController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/searchNUX\/seen\/",{});},null);
__d("XStickerTagDataController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/tag\/data\/",{});},null);
__d("XStickerQueryImagesController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/query\/images\/",{query:{type:"String",required:true}});},null);
__d("StickerServerRequests",["AsyncRequest","Promise","XStickerPackImagesController","XStickersAddPackController","XStickersRemovePackController","XStickerStateInitialDataController","XStickerStatePackDataController","XStickerStateStoreDataController","XStickerSearchPromotePackController","XStickerSearchNUXSeenController","XStickerTagDataController","XStickerQueryImagesController"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();'use strict';var s={addPack:function(u,v,w){var x=j.getURIBuilder().setInt('pack_id',u).setBool('is_promoted',v).getURI();new g(x).setHandler(function(y){return w(y.payload);}).send();},removePack:function(u,v){var w=k.getURIBuilder().setInt('pack_id',u).getURI();new g(w).setHandler(function(x){return v(x.payload);}).send();},getStickersForPack:function(u,v){var w=i.getURIBuilder().setInt('pack_id',u).setInt('sticker_size',v).getURI();return new h(function(x,y){return new g().setURI(w).setMethod("POST").setHandler(function(z){return x(z.payload);}).send();});},getStickersForQuery:function(u,v){new g().setURI(r.getURIBuilder().setString('query',u).getURI()).setMethod("POST").setHandler(function(w){return v(w);}).send();},fetchTrayData:function(u){return t(l.getURIBuilder().getURI(),u,true);},fetchStoreData:function(u){return t(n.getURIBuilder().getURI(),u);},fetchPackData:function(u,v){return t(m.getURIBuilder().setInt('pack_id',u).getURI(),v);},fetchTagData:function(u){return t(q.getURIBuilder().getURI(),u,true);},markSeenSearchNUX:function(){new g(p.getURIBuilder().getURI().toString()).send();},promotePackSentFromSearch:function(u,v){var w=o.getURIBuilder().setInt('sticker_id',u).getURI();t(w,v,true);}};function t(u,v,w){return new h(function(x,y){return new g(u).setHandler(function(z){return x(z.getPayload());}).setAllowCrossPageTransition(w).send();}).then(v);}e.exports=s;},null);
__d("StickerImages",["StickerServerRequests"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();'use strict';var h={},i={},j={},k={getStickerTagsData:function(){return j;},requestStickersForPack:function(l,m,n){if(!l)return;if(!i[l]){i[l]=g.getStickersForPack(l,m);i[l].then(function(o){o.forEach(function(p){return this.cacheSticker(p);}.bind(this));}.bind(this));}i[l].then(function(o){return n(o);});},cacheSticker:function(l){h[l.id]=l;},getSticker:function(l){return h[l];}};e.exports=k;},null);
__d("StickerState",["ImmutableObject","StickerConfig","PresenceState","StickerConstants","StickerImages","StickersDispatcher","StickerServerRequests","mixInEventEmitter"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();'use strict';var o={},p,q,r,s=null,t=0,u={},v=[],w=[],x=[],y=null,z=i.get();if(z)y=z.tray_pack_id;var aa=h.ShowStickerReplyNUX,ba=h.ShowStickerSearchNUX,ca={onTrayDataReady:function(fa){if(!q)q=m.fetchTrayData(function(ga){v=ga.packs.map(function(ha){return da(ha);});r=ga.mru;t=ga.num_new_packs;x=ga.tags;});q.then(fa);},onStoreDataReady:function(fa){if(!p)p=m.fetchStoreData(function(ga){w=ga.packs.map(function(ha){return da(ha);});});p.then(fa);},onPackDataReady:function(fa,ga){if(!o[fa])o[fa]=m.fetchPackData(fa,function(ha){da(ha);});o[fa].then(ga);},getPacksInTray:function(){var fa=[],ga;for(var ha=0;ha<v.length;ha++)if(v[ha].id==j.EMOTICON_PACK_ID){ga=v[ha];}else if(v[ha].isMessengerCapable)fa.push(v[ha]);ga&&fa.push(ga);return fa;},getPacksInCommentsTray:function(){var fa=[],ga=[],ha;for(var ia=0;ia<v.length;ia++)if(v[ia].id==j.EMOTICON_PACK_ID){ha=v[ia];}else if(v[ia].isCommentsCapable){fa.push(v[ia]);}else ga.push(v[ia]);var ja=fa.concat(ga);if(ha)ja.push(ha);return ja;},getPacksInComposerTray:function(){var fa=[],ga;for(var ha=0;ha<v.length;ha++)if(v[ha].id==j.EMOTICON_PACK_ID){ga=v[ha];}else if(v[ha].isComposerCapable)fa.push(v[ha]);ga&&fa.push(ga);return fa;},getPackIDsInTray:function(){return v.map(function(fa){return fa.id;});},getPacksInStore:function(){return w.filter(function(fa){return fa.isMessengerCapable;});},getComposerPacksInStore:function(){return w.filter(function(fa){return fa.isComposerCapable;});},getPack:function(fa){return u[fa];},getNumNewPacks:function(){return t;},getFeaturedTags:function(){return x;},resetNumNewPacks:function(){if(t){t=0;this.emit(this.NUM_NEW_PACKS_CHANGED,0);}},addMRUPack:function(){if(r){this._addPackToTray(r);r=null;}},addPack:function(fa){var ga=false;if(u[fa])ga=u[fa].isPromoted;m.addPack(fa,ga,function(ha){this._addPackToTray(ha);}.bind(this));},removePack:function(fa){m.removePack(fa,function(ga){v=v.filter(function(ha){return ha.id!==ga;});u[ga]=g.set(u[ga],{isInTray:false});w=w.map(function(ha){return u[ha.id];});this.emit(this.PACKS_CHANGED,ga);}.bind(this));},setTrayPackID:function(fa){y=fa;i.doSync();this.emit(ca.PACK_SELECTED,fa);},getTrayPackID:function(){return y;},shouldShowStickerReplyNUX:function(){return aa;},clearShowStickerReplyNUX:function(){aa=false;},shouldShowStickerSearchNUX:function(){return ba;},clearShowStickerSearchNUX:function(){m.markSeenSearchNUX();ba=false;},_addPackToTray:function(fa,ga){da(fa);u[fa.id]=g.set(u[fa.id],{isPurchased:!ga,isInTray:true});var ha=v.filter(function(ja){return ja.id===fa.id;}).length>0;if(!ha){var ia;if(!ga){ia=v.filter(function(ja){return ja.isMRU||ja.isSearch;}).length;}else ia=v.filter(function(ja){return ja.id!==j.EMOTICON_PACK_ID;}).length;v.splice(ia,0,u[fa.id]);}w=w.map(function(ja){return u[ja.id];});this.emit(this.PACKS_CHANGED,fa.id);},_addRecentlyUsedSticker:function(fa){for(var ga=0;ga<s.length;++ga)if(s[ga].id===fa.id){s.splice(ga,1);break;}s.unshift(fa);},getMRUStickerPack:function(fa){if(!s)s=fa;return s;},updateRecentlyUsed:function(fa){if(!s){this.addMRUPack();return;}this._addRecentlyUsedSticker(k.getSticker(fa));},promotePackSentFromSearch:function(fa){m.promotePackSentFromSearch(fa,function(ga){return ga&&this._addPackToTray(ga,true);}.bind(this));}};l.register(function(fa){if(fa.actions&&fa.actions.length){var ga=j.ActionTypes;fa.actions.forEach(function(ha){switch(ha.actionType){case ga.ADD_PACK:ca.addPack(ha.packID);break;case ga.REMOVE_PACK:ca.removePack(ha.packID);break;case ga.SELECT_PACK:ca.setTrayPackID(ha.packID);break;case ga.RESET_NUM_NEW_PACKS:ca.resetNumNewPacks();break;}});}});ca.PACKS_CHANGED='StickerState/packsChanged';ca.PACK_SELECTED='StickerState/packSelected';ca.NUM_NEW_PACKS_CHANGED='StickerState/numNewPacksChanged';i.registerStateStorer(function(fa){fa.tray_pack_id=y;});function da(fa){var ga=fa.id;if(!u[ga]){return (u[ga]=new g(fa));}else return (u[ga]=g.set(u[ga],fa));}var ea={};ea[ca.PACK_SELECTED]=true;ea[ca.PACKS_CHANGED]=true;ea[ca.NUM_NEW_PACKS_CHANGED]=true;n(ca,ea);e.exports=ca;},null);
__d("DialogFitHeight",["AbstractDialogFitHeight"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();for(var h in g)if(g.hasOwnProperty(h))j[h]=g[h];var i=g===null?null:g.prototype;j.prototype=Object.create(i);j.prototype.constructor=j;j.__superConstructor__=g;function j(){"use strict";if(g!==null)g.apply(this,arguments);}j.prototype.getHeightProperty=function(){"use strict";return 'height';};e.exports=j;},null);
__d("StickerStoreController",["Bootloader","DialogFitHeight","DOM","LayerAutoFocus","LayerFadeOnHide","LayerHideOnEscape","React","XUIDialog.react","XUIDialogBody.react","XUISpinner.react","cx","requestAnimationFrame"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();'use strict';var s=m,t=s.PropTypes,u=688,v=null,w=m.createClass({displayName:"StoreLayer",propTypes:{isComposer:t.bool,packID:t.string,shown:t.bool},getDefaultProps:function(){return {isComposer:false,packID:null,shown:false};},getInitialState:function(){return {renderStore:function(){return (m.createElement("div",{className:"_5r5e"},m.createElement(p,{background:"light",size:"large"})));}};},componentDidMount:function(){g.loadModules(["StickerStore.react"],function(z){this.setState({renderStore:function(){return (m.createElement(z,{currentPackID:this.props.packID,isComposer:this.props.isComposer,onPackSelect:this._packSelected,shown:this.props.shown}));}.bind(this)});}.bind(this));},_packSelected:function(z){this.setProps({packID:z});},_onToggle:function(z){r(this.setProps.bind(this,{shown:z},null));},render:function(){return (m.createElement(n,{behaviors:{DialogFitHeight:h,LayerAutoFocus:j,LayerFadeOnHide:k,LayerHideOnEscape:l},onToggle:this._onToggle,shown:this.props.shown,width:u},m.createElement(o,{className:"_5rq- autofocus"},this.state.renderStore())));}});function x(z,aa){var ba=i.create('div');i.appendContent(document.body,ba);v=m.render(m.createElement(w,{isComposer:aa,packID:z,shown:true}),ba);}var y={showStore:function(z,aa){if(!v){x(z,!!aa);}else v.setProps({shown:true,packID:z,isComposer:!!aa});}};e.exports=y;},null);
__d("StickersFlyoutPackSelector.react",["Animation","ImmutableObject","Locale","React","Image.react","StickerActions","StickerConfig","StickerConstants","StickerInterfaces","StickerState","StickerStoreController","XUIBadge.react","cx","emptyFunction","fbt","ix","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){b.__markCompiled&&b.__markCompiled();'use strict';var x=j,y=x.PropTypes,z=4,aa=200,ba=u._("Sticker Store"),ca=j.createClass({displayName:"StickersFlyoutPackSelector",propTypes:{stickerInterface:y.oneOf(w(o)),numNewPacks:y.number,packs:y.arrayOf(y.instanceOf(h)).isRequired,onPackClick:y.func,selectedPackID:y.string,resetTagSelectorFunc:y.func},getInitialState:function(){return {animating:false,page:0};},getDefaultProps:function(){return {stickerInterface:o.MESSAGES,numNewPacks:0};},shouldComponentUpdate:function(ea,fa){return !fa.animating;},onFlyoutShown:function(){if(this.props.packs.length>0){var ea=this._calculatePageForPack(this.props.selectedPackID);if(this.state.page!==ea)this._setPage(ea,0);}},_calculatePageForPack:function(ea){for(var fa=0;fa<this.props.packs.length;fa++)if(this.props.packs[fa].id==ea)return fa<=z?0:Math.floor((fa-1)/z);return 0;},_setPage:function(ea,fa){if(this.state.animating)return;this.setState({animating:true,page:ea},function(){var ga=j.findDOMNode(this.refs.positioner),ha=this._calculatePosition(ea);new g(ga).to(ha.reference,ha.offset+'px').ondone(function(){return this.setState({animating:false});}.bind(this)).duration(fa).go();});},_calculatePosition:function(ea){var fa=j.findDOMNode(this.refs.positioner),ga=fa.childNodes[ea].offsetLeft;if(i.isRTL()){var ha=fa.offsetWidth,ia=fa.childNodes[ea].offsetWidth;return {reference:'right',offset:ga+ia-ha};}return {reference:'left',offset:-ga};},_numPages:function(){return Math.max(1,Math.ceil((this.props.packs.length-1)/z));},_canGoPrev:function(){return this.state.page>0;},_canGoNext:function(){return this.state.page+1<this._numPages();},_goPrev:function(){this._canGoPrev()&&this._setPage(this.state.page-1,aa);},_goNext:function(){this._canGoNext()&&this._setPage(this.state.page+1,aa);},_openStore:function(){l.resetNumNewPacks();var ea=this.props.stickerInterface==o.COMPOSER;q.showStore(null,ea);},render:function(){return (j.createElement("div",{className:"_5r85"},this._renderStoreButton(),this._renderPrevArrow(),this._renderNextArrow(),j.createElement("div",{className:"_5r88"},j.createElement("div",{className:"_5r89",ref:"positioner"},this._renderPages()))));},_selectPack:function(ea){var fa=p.getPack(ea);if(fa&&fa.isPromoted)l.addPack(ea);if(ea===n.SEARCH_PACK_ID)this.props.resetTagSelectorFunc();if(this.props.onPackClick){this.props.onPackClick(ea);}else l.selectPack(ea);},_renderPages:function(){var ea=this.props.packs.map(function(ia,ja){return j.createElement(da,{key:ia.id,onClick:function(){return this._selectPack(ia.id);}.bind(this),pack:ia,selected:this.props.selectedPackID===ia.id,index:ja,isComments:this.props.stickerInterface==o.COMMENTS});}.bind(this)),fa=[];for(var ga=0;ga<ea.length;ga+=z){var ha=ga;ga===0&&ga++;fa.push(j.createElement("div",{className:"_5r81",key:ga},ea.slice(ha,ga+z)));}return fa;},_renderStoreButton:function(){return (j.createElement("a",{"aria-label":ba,className:"_5r86 rfloat","data-hover":"tooltip",onClick:this._openStore},j.createElement(k,{className:"_5r87",src:v('/images/messaging/stickers/selector/sticker_store.png')}),this._renderJewel()));},_renderJewel:function(){var ea=this.props.numNewPacks;if(!ea)return null;return (j.createElement(r,{className:"rfloat _3fhs",count:ea,maxcount:9,type:"special"}));},_renderPrevArrow:function(){if(!this._canGoPrev())return null;var ea=i.isRTL()?v('/images/messaging/stickers/selector/right.png'):v('/images/messaging/stickers/selector/left.png');return (j.createElement("a",{className:(("_37wu")+(' '+"lfloat")),onClick:this._goPrev},j.createElement(k,{className:"_5r84",src:ea})));},_renderNextArrow:function(){if(!this._canGoNext())return null;var ea=i.isRTL()?v('/images/messaging/stickers/selector/left.png'):v('/images/messaging/stickers/selector/right.png');return (j.createElement("a",{className:(("_37wv")+(' '+"rfloat")),onClick:this._goNext},j.createElement(k,{className:"_5r84",src:ea})));}}),da=j.createClass({displayName:"PackIcon",propTypes:{index:y.number,isComments:y.bool,onClick:y.func,pack:y.instanceOf(h).isRequired,selected:y.bool},getDefaultProps:function(){return {isComments:false,onClick:t};},_getPackIcon:function(ea){if(ea.id==n.SEARCH_PACK_ID)return v('/images/messaging/stickers/icons/search.png');if(ea.id==n.MRU_STICKER_PACK)return v('/images/messaging/stickers/icons/recent.png');if(ea.id==n.EMOTICON_PACK_ID)return v('/images/messaging/stickers/icons/emoji.png');return ea.icon;},render:function(){var ea=this.props.pack,fa=m.WebStickerSearch&&!m.StickerSearchInRecent?this.props.index===1||this.props.index===2:this.props.index===1,ga=(("_5r8a")+(this.props.selected?' '+"_5r8b":'')+(ea.id==n.MRU_STICKER_PACK?' '+"_5qcj":'')+(ea.id==n.SEARCH_PACK_ID?' '+"_5qck":'')+(fa?' '+"_eb3":'')),ha=this.props.isComments&&!ea.isCommentsCapable,ia=u._("This pack is only available in photos"),ja=u._("This pack is only available in messages"),ka=ha?t:function(){return this.props.onClick(ea.id);}.bind(this),la=this._getPackIcon(ea);if(la===null)return null;var ma=ja;if(!ea.isMessengerCapable&&ea.isComposerCapable)ma=ia;return (j.createElement("a",{"aria-label":ha?ma:ea.name,className:ga,"data-id":ea.id,"data-hover":"tooltip",ref:"search_icon",onClick:ka,tabIndex:"0"},j.createElement(k,{className:((ha?"_2ji6":'')+(' '+"_5r8c")+(m.WebStickerSearch?' '+"_1viy":'')),src:la})));}});e.exports=ca;},null);
__d("StickerUtils",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={getScaledDimensions:function(h,i,j){var k,l,m;if(i>h){m=j/i;k=h*m;l=i*m;}else{m=j/h;k=h*m;l=i*m;}return {height:Math.round(k),width:Math.round(l)};},capitalizeWords:function(h){var i=h.split(" ");for(var j=0;j<i.length;j++){var k=i[j].charAt(0).toUpperCase();i[j]=k+i[j].substr(1);}return i.join(" ");}};e.exports=g;},null);
__d("StickersFlyoutStickerSelector.react",["BanzaiLogger","Grid.react","Image.react","ScrollableArea.react","React","Sticker.react","StickerConstants","StickerConfig","StickerImages","StickerInterfaces","StickerSearch","StickerState","StickerUtils","XUISpinner.react","cx","debounce","emptyFunction","fbt","getObjectValues","ix","throttle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){b.__markCompiled&&b.__markCompiled();'use strict';var ba=h.GridItem,ca=k,da=ca.PropTypes,ea=320,fa=278,ga=m.MRU_STICKER_PACK,ha=44,ia=112,ja=v(function(la,ma){if(!la)return;g.log('StickersLoggerConfig',{event:'search_sticker',searchtoken:la,numsearchresults:ma.length});},1000),ka=k.createClass({displayName:"StickersFlyoutStickerSelector",propTypes:{height:da.number,stickerInterface:da.oneOf(y(p)),onQueryResultsFound:da.func,onScroll:da.func,packID:da.string,singleWordTags:da.array,typeaheadTags:da.array,userInput:da.string},getDefaultProps:function(){return {stickerInterface:p.MESSAGES,onScroll:w};},getInitialState:function(){return {loading:false,stickers:[]};},componentDidMount:function(){if(this.props.packID){this.requestStickersForPack(this.props.packID);return;}if(this.props.userInput)this.requestStickersForQuery(this.props.userInput);},componentWillReceiveProps:function(la){if(la.packID&&la.packID!==this.props.packID){this.requestStickersForPack(la.packID);}else if(la.userInput!==this.props.userInput)this.requestStickersForQuery(la.userInput);},requestStickersForQuery:function(la){this.setState({loading:true});q.requestStickersForQuery(la,function(ma){ma.map(function(na){return o.cacheSticker(na);});if(!this.props.tagChosen)ja(la,ma);if(this.props.stickerInterface==p.COMPOSER)ma=ma.filter(function(na){return na.isComposerCapable;});if(this.props.stickerInterface==p.COMMENTS)ma=ma.filter(function(na){return na.isCommentsCapable;});if(this.props.stickerInterface==p.MESSAGES)ma=ma.filter(function(na){return na.isMessengerCapable;});if(this.isMounted()){this.setState({loading:false,stickers:ma});if(n.EnterToSendSticker)this.props.onQueryResultsFound&&this.props.onQueryResultsFound(ma);}}.bind(this));},requestStickersForPack:function(la){this.setState({loading:true});o.requestStickersForPack(la,m.TRAY_SIZE,function(ma){if(la==ga){ma=r.getMRUStickerPack(ma);if(this.props.stickerInterface==p.COMPOSER)ma=ma.filter(function(na){return na.isComposerCapable;});if(this.props.stickerInterface==p.COMMENTS)ma=ma.filter(function(na){return na.isCommentsCapable;});if(this.props.stickerInterface==p.MESSAGES)ma=ma.filter(function(na){return na.isMessengerCapable;});}this.setState({loading:false,stickers:ma});}.bind(this));},renderStickers:function(){return this.state.stickers.map(function(la){var ma=s.getScaledDimensions(la.height,la.width,m.TRAY_SIZE);return (k.createElement(ba,{key:la.id},k.createElement("div",{className:"_5r8h","data-id":la.id},k.createElement(l,{animationTrigger:"hover",className:"_5r8i",frameCount:la.frameCount,frameRate:la.frameRate||83,framesPerCol:la.framesPerCol,framesPerRow:la.framesPerRow,sourceHeight:ma.height,sourceURI:la.sourceURI,sourceWidth:ma.width,spriteURI:la.spriteURI,paddedSpriteURI:la.paddedSpriteURI,stickerID:la.id,style:{cursor:'pointer'}}))));});},_onScroll:function(){var la=this.refs.stickerScrollable;if(la){var ma=la.getArea().getScrollTop();this.props.onScroll(ma);}},render:function(){if(this.state.loading){return (k.createElement("div",{className:"_e0r"},k.createElement(t,{size:"large"})));}else if(this.state.stickers.length===0){var la=(ea-ha*2-ia)/2+"px";return (k.createElement("div",{className:"_5jdt",style:{marginTop:la}},k.createElement(i,{src:z("/images/messaging/stickers/icons/sad_face.png")}),k.createElement("p",null,x._("No Stickers to Show"))));}return (k.createElement(j,{ref:"stickerScrollable",height:this.props.height||ea,onScroll:aa(this._onScroll,200),width:fa,fade:true},k.createElement("div",{className:"_5r8k"},k.createElement(h,{cols:4,fixed:true},this.renderStickers()))));}});e.exports=ka;},null);
__d("StickersFlyoutTagSelector.react",["BanzaiLogger","Grid.react","ScrollableArea.react","Parent","React","Image.react","StickerConfig","StickerConstants","StickersFlyoutStickerSelector.react","StickerInterfaces","StickerSearch","StickerState","StickerUtils","Toggler","XUIButton.react","XUICloseButton.react","XUITextInput.react","cx","emptyFunction","fbt","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){b.__markCompiled&&b.__markCompiled();'use strict';var ba=h.GridItem,ca=k,da=ca.PropTypes,ea=320,fa=278,ga=44,ha=k.createClass({displayName:"StickersFlyoutTagSelector",propTypes:{trigger:da.string,stickerInterface:da.oneOf(aa(p)),resetTrigger:da.func,onSelectSticker:da.func},getInitialState:function(){return {input:'',isScrolling:false,tagChosen:false,matchedStickers:[]};},getDefaultProps:function(){return {trigger:null,stickerInterface:p.MESSAGES,resetTrigger:y,onSelectSticker:y};},componentDidMount:function(){var ia=j.byClass(k.findDOMNode(this),'uiToggle');if(ia)this._togglerSub=t.listen('show',ia,function(){this.isMounted()&&this.focusInput();}.bind(this));this.focusInput();this.selectTrigger(this.props.trigger);},componentWillUnmount:function(){this._togglerSub&&this._togglerSub.unsubscribe();},componentWillReceiveProps:function(ia){this.selectTrigger(ia.trigger);},focusInput:function(){this.refs.inputField.focusInput&&this.refs.inputField.focusInput();},_setMatchedStickers:function(ia){this.setState({matchedStickers:ia?ia:[]});},_onEnter:function(ia){ia.preventDefault();ia.stopPropagation();if(!m.EnterToSendSticker)return;var ja=this.state.matchedStickers;if(ja&&ja.length===1){this.props.onSelectSticker(ja[0].id,ia);this.setState({matchedStickers:[]});}},_inputChanged:function(ia){this.setState({input:ia.target.value,tagChosen:false,isScrolling:false});},_normalizeInput:function(ia){return ia.trim().replace(/\s+/,' ').toLowerCase();},_handleResetButtonClick:function(ia){ia.preventDefault();this.reset();},reset:function(){this.setState(this.getInitialState());},renderContentArea:function(){if(this.state.tagChosen||this._normalizeInput(this.state.input).length>1){return this.renderStickers();}else return m.StickerSearchInRecent?this.renderRecentStickers():this.renderTags();},render:function(){return (k.createElement("div",{className:(("_217a")+(this.state.isScrolling?' '+"_1hg1":''))},k.createElement("div",{className:"_5jdr"},k.createElement("span",{className:"_5jds"}),k.createElement(w,{onEnter:this._onEnter,onChange:this._inputChanged,ref:"inputField",placeholder:z._("Search Stickers"),value:this.state.input}),k.createElement(v,{size:"small",onClick:this._handleResetButtonClick,className:((this.state.input.length===0?"hidden_elem":''))})),this.renderContentArea()));},selectTag:function(ia){g.log('StickersLoggerConfig',{event:'select_tag',tagid:ia.id});this.setState({tagChosen:true,input:s.capitalizeWords(ia.name)});this.focusInput();},selectTrigger:function(ia){if(ia!==null){var ja=q.getTagByName(ia);this.setState({tagChosen:true,input:s.capitalizeWords(ja.name)});this.props.resetTrigger();}},_onScroll:function(ia){this.setState({isScrolling:!!ia});},renderStickers:function(){var ia=this._normalizeInput(this.state.input);return (k.createElement(o,{ref:"selector",height:ea-ga,userInput:ia,onScroll:this._onScroll,stickerInterface:this.props.stickerInterface,tagChosen:this.state.tagChosen,onQueryResultsFound:this._setMatchedStickers}));},renderRecentStickers:function(){if(this._normalizeInput(this.state.input).length===1)return k.createElement("div",null);return (k.createElement(o,{ref:"selector",height:ea-ga,packID:n.MRU_STICKER_PACK,onScroll:this._onScroll,stickerInterface:this.props.stickerInterface}));},renderTags:function(){var ia=r.getFeaturedTags().filter(function(ja){return ja.sourceURI!==null;}).sort(function(ja,ka){return ja.order-ka.order;}).map(function(ja,ka){return k.createElement(ba,{key:ka},k.createElement("div",{className:(("_t5c")+(ka<2?' '+"_1b27":'')+(ka%2===0?' '+"_t5d":'')+(ka%2!==0?' '+"_t5e":''))},k.createElement(u,{image:k.createElement(l,{src:ja.sourceURI}),label:ja.name,onClick:this.selectTag.bind(this,ja),className:"_5jdu",style:{background:'#'+ja.color_code},disabled:this._normalizeInput(this.state.input).length===1})));}.bind(this));return (k.createElement(i,{height:ea-ga,width:fa-16,shadow:true,fade:true,className:"_5jei"},k.createElement(h,{spacing:"pas",cols:2,fixed:true,ref:"grid"},ia)));}});e.exports=ha;},null);
__d("StickersFlyout.react",["BanzaiLogger","Event","Keys","MessagesEmoticons.react","Parent","ReactComponentWithPureRenderMixin","React","StickersFlyoutPackSelector.react","StickersFlyoutStickerSelector.react","StickerActions","StickerConstants","StickerConfig","StickersFlyoutTagSelector.react","StickerInterfaces","StickerState","SubscriptionsHandler","Toggler","XUISpinner.react","arrayContains","cx","getObjectValues"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){b.__markCompiled&&b.__markCompiled();'use strict';var ba=m,ca=ba.PropTypes,da=q.SEARCH_PACK_ID,ea=m.createClass({displayName:"StickersFlyout",mixins:[l],propTypes:{stickerInterface:ca.oneOf(aa(t)),onStickerSelect:ca.func.isRequired,onEmoticonSelect:ca.func,onShown:ca.func,onHidden:ca.func,onEscKeyDown:ca.func,onPackSelect:ca.func,packID:ca.string,shown:ca.bool,trigger:ca.string},getDefaultProps:function(){return {stickerInterface:t.MESSAGES,packID:u.getTrayPackID(),shown:false,trigger:null};},getInitialState:function(){return {dataReady:false,numNewPacks:0};},componentDidMount:function(){if(r.LoadStickerEarly&&!this.state.dataReady)this.loadTrayData();this._toggle=k.byClass(m.findDOMNode(this),'uiToggle');this._subscriptions=new v();if(this._toggle){this._subscriptions.addSubscriptions(w.listen('show',this._toggle,this._onShownWrapper),w.listen('hide',this._toggle,this._onHidden));}else if(!r.LoadStickerEarly&&this.props.shown&&!this.state.dataReady)this.loadTrayData();this._subscriptions.addSubscriptions(h.listen(m.findDOMNode(this),'keydown',this._onKeyDown),u.addListener(u.PACKS_CHANGED,this.packsUpdated),u.addListener(u.NUM_NEW_PACKS_CHANGED,function(fa){this.setState({numNewPacks:fa});}.bind(this)));},_onShownWrapper:function(){if(this.props.onShown){this.props.onShown(this._onShown);}else this._onShown();},_onShown:function(){g.log('StickersLoggerConfig',{event:'open_tray'});if(!r.LoadStickerEarly&&!this.state.dataReady)this.loadTrayData();if(this.props.packID===da)this.refs.tagSelector&&this.refs.tagSelector.focusInput();this.refs.packSelector.onFlyoutShown();},_onHidden:function(){this.resetTagSelector();this.props.onHidden&&this.props.onHidden();},componentWillUnmount:function(){this._subscriptions.release();},componentWillReceiveProps:function(fa){if(!this.state.dataReady&&fa.shown)this.loadTrayData();},componentDidUpdate:function(fa){if(!fa.shown&&this.props.shown){this._onShown();}else if(fa.shown&&!this.props.shown)this._onHidden();},_onKeyDown:function(event){if(event.keyCode===i.ESC&&this.props.onEscKeyDown){this.props.onEscKeyDown();event.kill();}},resetTagSelector:function(){this.refs.tagSelector&&this.refs.tagSelector.reset();},loadTrayData:function(){u.onTrayDataReady(function(){var fa=u.getNumNewPacks();this.setState({dataReady:true,numNewPacks:fa});var ga=u.getPacksInTray()[0].id,ha=this.props.packID;if(!ha||!y(u.getPackIDsInTray(),ha)){p.selectPack(ga,true);this.props.onPackSelect&&this.props.onPackSelect(ga);}}.bind(this));},loadPack:function(){if(!this.state.dataReady)return (m.createElement("div",{className:"_e0r"},m.createElement(x,{size:"large"})));if(this.props.packID===q.EMOTICON_PACK_ID)return (m.createElement("div",{className:"_5r8l","data-id":this.props.packID},m.createElement(j,{onEmoticonSelect:this.props.onEmoticonSelect})));if(this.props.packID===da&&r.WebStickerSearch)return (m.createElement("div",{className:"_5r8l"},m.createElement(s,{ref:"tagSelector",className:"fbStickersFlyoutTagSelector",trigger:this.props.trigger,resetTrigger:function(){return this.setProps({trigger:null});}.bind(this),stickerInterface:this.props.stickerInterface,onSelectSticker:this.onSelectSticker})));return (m.createElement("div",{className:"_5r8l","data-id":this.props.packID},m.createElement(o,{ref:"selector",packID:this.props.packID,stickerInterface:this.props.stickerInterface})));},packsUpdated:function(){var fa=u.getPackIDsInTray();if(!y(fa,this.props.packID)){p.selectPack(fa[0]);return;}this.forceUpdate(null);},onSelectSticker:function(fa,event){if(fa){u.updateRecentlyUsed(fa);this.props.onStickerSelect(fa,event);if(r.PromotePackFromSearch&&this.props.packID===q.SEARCH_PACK_ID)u.promotePackSentFromSearch(fa);u.clearShowStickerReplyNUX();}},selectedSticker:function(event){var fa=k.byClass(event.target,"_5r8h");if(fa){var ga=fa.getAttribute('data-id');this.onSelectSticker(ga,event);}},render:function(){var fa;if(this.props.stickerInterface==t.COMPOSER){fa=u.getPacksInComposerTray();}else if(this.props.stickerInterface==t.COMMENTS){fa=u.getPacksInCommentsTray();}else if(this.props.stickerInterface==t.MESSAGES)fa=u.getPacksInTray();return (m.createElement("div",{className:"_5r8f"},m.createElement("div",{className:"_5r8e"},m.createElement(n,{ref:"packSelector",numNewPacks:this.state.numNewPacks,onPackClick:this.props.onPackSelect,selectedPackID:this.props.packID,packs:fa,stickerInterface:this.props.stickerInterface,resetTagSelectorFunc:this.resetTagSelector})),m.createElement("div",{className:"_5r8m",onClick:this.selectedSticker},this.loadPack())));}});e.exports=ea;},null);
__d("ChatStickerButton.react",["BanzaiODS","React","ReactLayeredComponentMixin","StickerContextualDialog.react","StickersFlyout.react","StickerState","cx","emptyFunction","fbt","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();'use strict';var q=h,r=q.PropTypes,s=278,t=h.createClass({displayName:"ChatStickerButton",propTypes:{className:r.string,flyoutClassName:r.string,flyoutWidth:r.number,wrapperClass:r.func,onStickerSelect:r.func,onEmoticonSelect:r.func,onFlyoutShown:r.func,onFlyoutHidden:r.func},getInitialState:function(){return {shown:false,packID:l.getTrayPackID()};},mixins:[i],getDefaultProps:function(){return {flyoutWidth:s,onStickerSelect:n,onEmoticonSelect:n};},componentDidMount:function(){g.bumpEntityKey('chat.web','sticker_button.mounted');this._subscription=l.addListener(l.PACK_SELECTED,function(u){return this.setState({packID:u});}.bind(this));},shouldComponentUpdate:function(u,v){return (v.packID!=this.state.packID||v.shown!=this.state.shown);},componentWillUnmount:function(){this._subscription&&this._subscription.remove();},render:function(){return (h.createElement("a",{onClick:this.showFlyout,onMouseDown:this._prepareForClick,title:o._("Choose a sticker or emoticon"),ref:"link"},h.createElement("span",{className:p(this.props.className,((this.state.shown?"open":'')))})));},renderLayers:function(){var u=this.props.wrapperClass||j;return {contextualDialog:h.createElement(u,{alignment:this.props.flyoutAlignment,className:"_5e-r",contextRef:"link",onBlur:this._hideFlyout,position:"above",shown:this.state.shown,width:this.props.flyoutWidth},h.createElement("div",null,h.createElement(k,{className:this.props.flyoutClassName,onShown:function(v){return this.props.onFlyoutShown&&this.props.onFlyoutShown(v);}.bind(this),onHidden:function(){return this.props.onFlyoutHidden&&this.props.onFlyoutHidden();}.bind(this),onEscKeyDown:this._hideFlyout,onStickerSelect:this._handleStickerSelected,onEmoticonSelect:this._handleEmoticonSelected,packID:this.state.packID,shown:this.state.shown})))};},_prepareForClick:function(){this._clickGuard=this.state.shown;},showFlyout:function(){!this._clickGuard&&this.setState({shown:true});},_hideFlyout:function(){this.setState({shown:false});},_handleStickerSelected:function(u){this.props.onStickerSelect(u);},_handleEmoticonSelected:function(u){this._hideFlyout();this.props.onEmoticonSelect(u);}});e.exports=t;},null);
__d("StickersFlyoutTriggerSelector.react",["React","Sticker.react","StickerConstants","StickerUtils","XUIContextualDialog.react","XUICloseButton.react","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=g,o=n.PropTypes,p=84,q=g.createClass({displayName:"StickersFlyoutTriggerSelector",getDefaultProps:function(){return {stickers:[]};},propTypes:{context:o.object.isRequired,stickers:o.array,onStickerSelect:o.func.isRequired},shouldComponentUpdate:function(r){if(this.props.stickers.length!==r.stickers.length)return true;for(var s=0;s<Math.min(this.props.stickers.length,5);s++)if(this.props.stickers[s].id!==r.stickers[s].id)return true;return false;},_renderStickers:function(){if(!this.props.stickers||this.props.stickers.length===0)return null;var r=Math.floor(Math.random()*Math.min(this.props.stickers.length,5)),s=this.props.stickers[r],t=j.getScaledDimensions(s.height,s.width,i.TRAY_SIZE);return (g.createElement("div",null,g.createElement(l,{size:"small",className:"_2ohj",onClick:this.props.onDismissTrigger}),g.createElement("div",{className:"_5r8h _onc","data-id":s.id,onClick:function(){return this.props.onStickerSelect(s.id);}.bind(this)},g.createElement(h,{animationTrigger:"hover",className:"_5r8i",frameCount:s.frameCount,frameRate:s.frameRate||83,framesPerCol:s.framesPerCol,framesPerRow:s.framesPerRow,sourceHeight:t.height,sourceURI:s.sourceURI,sourceWidth:t.width,spriteURI:s.spriteURI,paddedSpriteURI:s.paddedSpriteURI,stickerID:s.id,style:{cursor:'pointer',height:'64px'}}))));},render:function(){return (g.createElement(k,{alignment:"left",autoFocus:false,context:this.props.context,onBlur:this._resetFlyout,offsetY:11,position:"above",shown:this.props.stickers&&this.props.stickers.length>0,width:p},this._renderStickers()));}});e.exports=q;},null);
__d("StickerTrigger",["EmoticonsList","Map","StickerConfig","StickerSearch","StickerServerRequests"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=new h(),m={findTriggerForInput:function(n,o){if(n===null){o([],null);return;}j.prepareTagsData().then(function(){return this.findTagForInput(n,function(p,q){return o(p,q);});}.bind(this));},findTagForInput:function(n,o){var p=this.findTriggeredWord(n);if(p){if(l.has(p)){o(l.get(p),p);}else k.getStickersForQuery(p,function(q){var r=q.getPayload();l.set(p,r);o(r,p);});}else o([],null);},_getRegex:function(){if(i.TriggerConfidence==='emoji_only'){return g.noncapturingRegexp;}else if(i.TriggerConfidence==='high')return (/^(?:\w+\s?){1,4}$/);return null;},findTriggeredWord:function(n){var o=j.getTagsIndex();if(!o)return null;n=n.toLowerCase();var p=n.match(this._getRegex()),q=null;for(var r=0;p!==null&&r<p.length;r++)if(o[p[r]])q=p[r];return q;}};e.exports=m;},null);
__d("StickerTriggerIndicator.react",["React","cx"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();'use strict';var i=g,j=i.PropTypes,k=g.createClass({displayName:"StickerTriggerIndicator",getDefaultProps:function(){return {stickers:[]};},propTypes:{stickers:j.array},shouldComponentUpdate:function(l){var m=this.props.stickers.length>0,n=l.stickers.length>0;return m!==n;},render:function(){var l=this.props.stickers&&this.props.stickers.length>0;return g.createElement("span",{className:((l?"emoticonIndicator":''))});}});e.exports=k;},null);
__d("ChatStickerTriggerController",["BanzaiLogger","React","StickerConfig","StickersFlyoutTriggerSelector.react","StickerTrigger","StickerTriggerIndicator.react"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';function m(n,o,p,q,r){this.$ChatStickerTriggerController0=null;this.$ChatStickerTriggerController1=null;this.$ChatStickerTriggerController2=null;this.$ChatStickerTriggerController3=r;this.$ChatStickerTriggerController4=q;this.$ChatStickerTriggerController5=null;if(i.TriggerInterface==='one_tap'){this.$ChatStickerTriggerController1=h.render(h.createElement(j,{context:p,onStickerSelect:this.$ChatStickerTriggerController6.bind(this),onDismissTrigger:this.$ChatStickerTriggerController7.bind(this)}),n);this.$ChatStickerTriggerController2=n;}else if(i.TriggerInterface==='hyperlink'){this.$ChatStickerTriggerController1=h.render(h.createElement(l,null),o);this.$ChatStickerTriggerController2=o;}}m.prototype.setInput=function(n){this.$ChatStickerTriggerController8=n;};m.prototype.activateAfterparty=function(){this.$ChatStickerTriggerController9=true;clearTimeout(this.$ChatStickerTriggerControllera);this.$ChatStickerTriggerControllera=setTimeout(this.$ChatStickerTriggerControllerb.bind(this),5000);};m.prototype.updateInput=function(n){if(this.$ChatStickerTriggerController9)this.$ChatStickerTriggerControllerb();this.$ChatStickerTriggerControllerc(n);};m.prototype.onFlyoutShown=function(n){if(this.$ChatStickerTriggerController0&&!this.$ChatStickerTriggerControllerd){this.$ChatStickerTriggerControllerd=true;this.$ChatStickerTriggerController3(this.$ChatStickerTriggerController0,n);this.$ChatStickerTriggerController1.isMounted()&&this.$ChatStickerTriggerController1.setProps({stickers:[]});}else n();};m.prototype.getTriggeredWord=function(){return this.$ChatStickerTriggerController0;};m.prototype.$ChatStickerTriggerController6=function(n){this.$ChatStickerTriggerController4(n);this.$ChatStickerTriggerController7();};m.prototype.$ChatStickerTriggerController7=function(){this.$ChatStickerTriggerControllerd=true;this.$ChatStickerTriggerController1.isMounted()&&this.$ChatStickerTriggerController1.setProps({stickers:[]});};m.prototype.$ChatStickerTriggerControllere=function(n,o){if(this.$ChatStickerTriggerController5===null||this.$ChatStickerTriggerController5&&this.$ChatStickerTriggerController5.toLowerCase().indexOf(o)===-1){this.$ChatStickerTriggerController8.isMounted()&&this.$ChatStickerTriggerController8.setProps({triggeredWord:null});this.$ChatStickerTriggerController1.isMounted()&&this.$ChatStickerTriggerController1.setProps({stickers:[]});return;}if(o)g.log('StickersLoggerConfig',{event:'sticker_trigger_activated',numsearchresults:n.length,triggeredword:o,triggerused:false});this.$ChatStickerTriggerController0=o;this.$ChatStickerTriggerController8.isMounted()&&this.$ChatStickerTriggerController8.setProps({triggeredWord:o});if(!this.$ChatStickerTriggerControllerd)this.$ChatStickerTriggerController1.isMounted()&&this.$ChatStickerTriggerController1.setProps({stickers:n});};m.prototype.$ChatStickerTriggerControllerb=function(){clearTimeout(this.$ChatStickerTriggerControllera);this.$ChatStickerTriggerController9=false;this.$ChatStickerTriggerControllerd=false;this.$ChatStickerTriggerController0=null;this.$ChatStickerTriggerControllerc(null);};m.prototype.$ChatStickerTriggerControllerc=function(n){if(this.$ChatStickerTriggerController5!==n){this.$ChatStickerTriggerController5=n;k.findTriggerForInput(this.$ChatStickerTriggerController5,this.$ChatStickerTriggerControllere.bind(this));}};m.prototype.destroy=function(){h.unmountComponentAtNode(this.$ChatStickerTriggerController2);clearTimeout(this.$ChatStickerTriggerControllera);};e.exports=m;},null);
__d("ChatFileUploaderMixin",["SubscriptionsHandler","React"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i=h,j=i.PropTypes,k={propTypes:{attachmentsShelf:j.object,onFileUploaderMounted:j.func,onUploadFinished:j.func,onUpdateAttachmentsShelf:j.func,onSubmit:j.func},setUpSubscriptionsHandler:function(l){this._uploader=l;this._subscriptions=new g();this._subscriptions.addSubscriptions(this._uploader.subscribe(['all-uploads-completed','upload-canceled'],this._handleUploadFinished),this._uploader.subscribe('dom-updated',this._handleUpdateAttachmentsShelf),this._uploader.subscribe('submit',this._handleSubmit));this.props.onFileUploaderMounted(this._uploader);},componentWillUnmount:function(){this._subscriptions&&this._subscriptions.release();if(!this.props.uploaderIsFromHigherLevel)this._uploader&&this._uploader.destroy();},isUploading:function(){return this._uploader.isUploading();},getAttachments:function(){return this._uploader.getAttachments();},getImageFiles:function(){return this._uploader.getImageFiles();},getVideoFiles:function(){return this._uploader.getVideoFiles();},getAudioFiles:function(){return this._uploader.getAudioFiles();},getFiles:function(){return this._uploader.getFiles();},removeAttachments:function(){return this._uploader.removeAttachments();},_handleUploadFinished:function(){if(this.props.onUploadFinished)this.props.onUploadFinished();},_handleUpdateAttachmentsShelf:function(){if(this.props.onUpdateAttachmentsShelf)this.props.onUpdateAttachmentsShelf();},_handleSubmit:function(){if(this.props.onSubmit)this.props.onSubmit();}};e.exports=k;},null);
__d("ChatFileUploader.react",["ChatFileUploaderMixin","InlineBlock.react","MercuryConfig","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=j.createClass({displayName:"ChatFileUploader",mixins:[g],getDefaultProps:function(){return {uploaderIsFromHigherLevel:true};},shouldComponentUpdate:function(){return false;},componentDidMount:function(){var n=this.props.initFileUploaderFn(j.findDOMNode(this.refs.form),j.findDOMNode(this.refs.input),j.findDOMNode(this.refs.attachID));this.setUpSubscriptionsHandler(n);},render:function(){return (j.createElement("form",{ref:"form",action:i.upload_url,method:"post"},j.createElement("input",{type:"hidden",ref:"attachID",name:"attach_id"}),j.createElement(h,{className:"_m _4q60 itemLabel"},j.createElement("input",{type:"file",className:"_n",name:"attachment[]",multiple:"true",ref:"input"}),j.createElement("span",{className:"_4q61 itemAnchor"},l._("Add Files...")))));}});e.exports=m;},null);
__d("MercuryThreadMuter",["AsyncDialog","AsyncRequest","DOM","MercuryThreadInfo"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k={showMuteChangeDialog:function(l,m){g.send(new h('/ajax/mercury/mute_thread_dialog.php').setRelativeTo(m),function(n){n.subscribe('confirm',function(){this.hide();var o;i.scry(this.getRoot(),'input[type="radio"]').forEach(function(p){if(p.checked)o=p.value;});o=k.convertRawMuteSetting(o);d(['MercuryThreadActions'],function(p){p.get().updateMuteSetting(l,o);});}.bind(n));});},convertRawMuteSetting:function(l){switch(l){case 'always':return -1;case '30minutes':return 1800;case '1hour':return 3600;case '8hours':return 8*3600;case '24hours':return 24*3600;case '8am':var m,n=new Date(),o=new Date();o.setHours(8);o.setMinutes(0);o.setSeconds(0);if(o>n){m=o-n;}else m=o-n+(24*3600*1000);return m/1000;default:return 0;}}};e.exports=k;},null);
__d("ChatTabMenu.react",["ChatFileUploader.react","ChatPrivacyActionController","MercuryConfig","MercuryIDs","MercuryFileUploader","MercuryThreadMuter","ReactComponentWithPureRenderMixin","React","PopoverMenu.react","ReactMenu","MenuSeparator.react","Toggler","TrackingNodes","WebMessengerThreadPermalinks","cx","fbt","goURI","MercuryThreadActions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){b.__markCompiled&&b.__markCompiled();'use strict';var x=b('MercuryThreadActions').get(),y=p.Item,z=n,aa=z.PropTypes,ba=n.createClass({displayName:"ChatTabMenu",mixins:[m],propTypes:{onFileUploaderMounted:aa.func,updatePrivacyLinkFunc:aa.func,nameConversationFunc:aa.func,leaveConversationFunc:aa.func,showParticipantsFunc:aa.func,clearHistoryFunc:aa.func,reportSpamFunc:aa.func,createGroupFunc:aa.func,switchToWorkFunc:aa.func,isMultichat:aa.bool,isEmptyChat:aa.bool,hasSwitchToWork:aa.bool,showAddFriend:aa.func,threadID:aa.string,attachmentsShelf:aa.object,onUploadFinished:aa.func,onUpdateAttachmentsShelf:aa.func,onSubmit:aa.func,enableDesktopNotif:aa.func},getInitialState:function(){return {url:null};},getDefaultProps:function(){return {show:true};},componentDidMount:function(){t.getThreadURI(this.props.threadID,function(ca){this.isMounted()&&this.setState({url:ca});}.bind(this));if(!this.props.isMultiChat)this._privacyActionController=new h(j.getUserIDFromThreadID(this.props.threadID),this.props.updatePrivacyLinkFunc);},_initFileUploader:function(ca,da,ea){if(this._fileUploader){this._fileUploader.updateElements(ca,da,ea);}else this._fileUploader=new k(this.props.attachmentsShelf,ca,da,ea);return this._fileUploader;},componentWillUnmount:function(){this._privacyActionController&&this._privacyActionController.destroy();this._fileUploader&&this._fileUploader.destroy();},_unmuteThread:function(){x.unmute(this.props.threadID);r.hide();},_togglePrivacyFunc:function(){this._privacyActionController.togglePrivacy();},getURL:function(){return this.state.url;},_renderFileUploader:function(){return (n.createElement(y,{className:"_37_x"},n.createElement(g,{onFileUploaderMounted:this.props.onFileUploaderMounted,attachmentsShelf:this.props.attachmentsShelf,initFileUploaderFn:this._initFileUploader,onUploadFinished:this.props.onUploadFinished,onUpdateAttachmentsShelf:this.props.onUpdateAttachmentsShelf,onSubmit:this.props.onSubmit})));},_renderOpenFullConversation:function(){if(this.state.url)return (n.createElement(y,{onclick:function(){return w(this.state.url);}.bind(this)},v._("See Full Conversation")));return null;},_renderAddFriend:function(){if(!this.props.showAddFriend)return null;return (n.createElement(y,{onclick:this.props.showAddFriend},v._("Add Friends to chat...")));},_renderTogglePrivacy:function(){if(!this.props.isMultichat)return (n.createElement(y,{onclick:this._togglePrivacyFunc},this.props.privacyText));return null;},_renderMuteConversation:function(){if(!this.props.isMuted){var ca=l.showMuteChangeDialog.bind(null,this.props.threadID,null);return (n.createElement(y,{onclick:ca},v._("Mute Conversation...")));}else return (n.createElement(y,{onclick:this._unmuteThread},v._("Unmute Conversation")));},_renderClearConversation:function(){if(!this.props.isMultichat)return (n.createElement(y,{onclick:this.props.clearHistoryFunc},v._("Clear window")));return null;},_renderReportSpam:function(){if(!this.props.isMultichat)return (n.createElement(y,{onclick:this.props.reportSpamFunc},v._("Report as Spam or Abuse...")));return null;},_renderCreateGroup:function(){if(this.props.isMultichat)return (n.createElement(y,{onclick:this.props.createGroupFunc},v._("Create Group")));return null;},_renderSwitchToWork:function(){if(this.props.hasSwitchToWork)return (n.createElement(y,{onclick:this.props.switchToWorkFunc},v._("Move to Work Account")));},_renderConversationName:function(){if(this.props.isMultichat&&this.state.url)return (n.createElement(y,{onclick:this.props.nameConversationFunc},v._("Edit Conversation Name")));return null;},_renderLeaveConversation:function(){if(this.props.isMultichat)return (n.createElement(y,{onclick:this.props.leaveConversationFunc},v._("Leave conversation...")));return null;},_renderEnableDesktopNotifications:function(){if(i.DesktopNotificationsGK&&"Notification" in window&&Notification.permission!=="granted")return (n.createElement(y,{onclick:this.props.enableDesktopNotif},v._("Enable Desktop Notifications")));return null;},_renderPeopleList:function(){if(this.props.isMultichat&&this.state.url)return (n.createElement(y,{onclick:this.props.showParticipantsFunc},v._("Edit Participants...")));return null;},render:function(){var ca=this._renderReportSpam(),da=this._renderCreateGroup(),ea=n.createElement(p,{className:(("chatReact")+(!this.props.show?' '+"hidden_elem":''))},this._renderOpenFullConversation(),this._renderFileUploader(),this._renderAddFriend(),this._renderTogglePrivacy(),this._renderConversationName(),this._renderPeopleList(),n.createElement(q,null),this._renderSwitchToWork(),this._renderMuteConversation(),this._renderClearConversation(),this._renderLeaveConversation(),ca?(n.createElement(q,null)):null,ca,da?(n.createElement(q,null)):null,da,this._renderEnableDesktopNotifications()),fa=v._("Options"),ga=s.getTrackingInfo(s.types.DROPDOWN_BUTTON);return (n.createElement(o,{menu:ea},n.createElement("a",{"data-ft":ga,"data-hover":"tooltip","aria-label":fa,"data-tooltip-alignh":"center",className:(("button")+(this.props.isEmptyChat?' '+"hidden_elem":''))})));}});e.exports=ba;},null);
__d("ChatDateBreak.react",["React","Timestamp.react","cx","formatDate","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=g,m=l.PropTypes,n=g.createClass({displayName:"ChatDateBreak",propTypes:{date:m.instanceOf(Date).isRequired},shouldComponentUpdate:function(o){return this.props.date.getTime()!==o.date.getTime();},render:function(){var o=this.props.date,p=j(o,{today:'g:ia',withinWeek:'l g:ia',thisYear:'F jS, g:ia',older:'F j, Y g:i a'}),q=Math.round(o.getTime()/1000);return (g.createElement("div",g.__spread({},this.props,{className:k(this.props.className,"_5w-5")}),g.createElement("div",{className:"_5w-6"},g.createElement(h,{time:q,verbose:p,text:p}))));}});e.exports=n;},null);
__d("ChatAuthorPhotoBlock.react",["MercuryParticipants","React","cx","formatDate","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=h,m=l.PropTypes,n=86400000,o=h.createClass({displayName:"ChatAuthorPhotoBlock",propTypes:{authorID:m.string.isRequired,hideName:m.bool,hidePhoto:m.bool,timestamp:m.number},getInitialState:function(){return {author:{id:null,name:'',href:'#',image_src:''}};},componentDidMount:function(){this.updateAuthor(this.props.authorID);},componentWillReceiveProps:function(p){if(p.authorID!=this.state.author.id)this.updateAuthor(p.authorID);},render:function(){return (h.createElement("div",h.__spread({},this.props,{className:k(this.props.className,"_5yt9")}),this.renderAuthorName(),this.renderAuthorPhoto(),this.props.children));},renderAuthorName:function(){if(!this.props.hideName)return (h.createElement("div",{className:"_5ys-",ref:"name"},this.state.author.name));},renderAuthorPhoto:function(){if(!this.props.hidePhoto){var p=null;if(this.props.timestamp){var q=(Date.now()-this.props.timestamp>n)?'M jS, g:ia':'g:ia';p=j(new Date(this.props.timestamp),q);}return (h.createElement("a",{"aria-label":p,className:"_5ys_","data-hover":"tooltip","data-tooltip-position":"left",href:this.state.author.href,ref:"link"},h.createElement("img",{src:this.state.author.image_src,ref:"image"})));}},updateAuthor:function(p){g.get(p,function(q){this.isMounted()&&this.setState({author:q});}.bind(this));}});e.exports=o;},null);
__d("MessageBubbleMixin",["DOMDimensions","MercuryConfig","React"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=2,k={getInitialState:function(){return {bubbleWidth:null};},componentDidMount:function(){this._restyleBubble(this.props);},componentDidUpdate:function(l){if(l.maxWidth!==this.props.maxWidth||l.body!==this.props.body)this._restyleBubble(l);},_restyleBubble:function(l){if(this.props.attachments)return;var m=i.findDOMNode(this.refs.bubble);if(l.maxWidth!==this.props.maxWidth||g.getElementDimensions(m).width>this.props.maxWidth){var n=this.props.maxWidth;this.setState({bubbleWidth:n},this._shrinkBubble);return;}this._shrinkBubble();},_shrinkBubble:function(){var l=i.findDOMNode(this.refs.bubble),m=g.getElementDimensions(l).width,n=0,o=i.findDOMNode(this.refs.content);if(o){n=g.getElementDimensions(o).width;if(h.MercuryStoryAttachmentsGK||h.WWWMessengerComerceGK)n+=g.measureElementBox(i.findDOMNode(this.refs.contentWrapper),'width',true,false,false);}var p=n+j;if(n>0&&p<this.props.maxWidth&&m-p-this.getBoxWidth()>0)this.setState({bubbleWidth:p});}};e.exports=k;},null);
__d("ChatBubble.react",["DOMDimensions","MercuryConfig","MercuryMessageBody.react","MessageBubbleMixin","React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();'use strict';var n=k,o=n.PropTypes,p=null,q=h.MercuryStoryAttachmentsGK||h.WWWMessengerComerceGK,r=k.createClass({displayName:"ChatBubble",mixins:[j],propTypes:{attachments:o.node,body:o.string,maxWidth:o.number.isRequired},_renderContent:function(){if(!this.props.body)return null;return (k.createElement("div",{className:((q?"_d97":'')),ref:"contentWrapper"},k.createElement("span",{className:"_5yl5",ref:"content"},k.createElement(i,{body:this.props.body,ranges:this.props.ranges}))));},render:function(){return (k.createElement("div",k.__spread({},this.props,{className:m((("_5w1r")+(!q?' '+"_d98":'')),this.props.className),ref:"bubble",style:{maxWidth:this.props.maxWidth,width:this.state.bubbleWidth}}),this._renderContent(),this.props.attachments));},contentWraps:function(){var s=k.findDOMNode(this.refs.content),t=s.getClientRects(),u=g.getElementDimensions(s).height;return (t&&t.length>1&&t[0].height<u);},getBoxWidth:function(){if(!p)p=g.measureElementBox(k.findDOMNode(this.refs.bubble),'width',true,true,false);return p;}});e.exports=r;},null);
__d("P2PMercuryAttachment.react",["CurrentUser","Image.react","Link.react","P2PAcceptMoneyDialog.react","P2PActions","P2PCreditCardStore","P2PLinkConstants","P2PGKValues","P2PQEValues","P2PTransferParam","P2PTransferStatus","P2PTransferStore","P2PVerificationFlowHelper","React","ReactLayeredComponentMixin","XUIButton.react","cx","formatDate","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){b.__markCompiled&&b.__markCompiled();'use strict';var aa=t,ba=aa.PropTypes,ca={metadata:ba.object.isRequired,theme:ba.string},da=t.createClass({displayName:"P2PMercuryAttachment",mixins:[u],propTypes:ca,getInitialState:function(){var ea=this.props.metadata,fa=r.getTransferByID(ea[p.TRANSFER_ID]);if(fa){ea=fa;}else k.transferAdded(ea);return {acceptMoneyDialogShown:false,creditCardAsyncRequestState:l.getAsyncRequestState(),creditCards:l.getAll(),transfer:ea,viewerIsSender:g.getID()===ea.sender.id};},componentDidMount:function(){this.creditCardStoreSub=l.addListener('change',this.onCreditCardStoreChange);this.transferStoreSub=r.addListener('change',this.onTransferStoreChange);},componentWillUnmount:function(){if(this.creditCardStoreSub){this.creditCardStoreSub.remove();this.creditCardStoreSub=null;}if(this.transferStoreSub){this.transferStoreSub.remove();this.transferStoreSub=null;}},onCreditCardStoreChange:function(){this.setState({creditCardAsyncRequestState:l.getAsyncRequestState(),creditCards:l.getAll()});},onTransferStoreChange:function(){var ea=r.getTransferByID(this.state.transfer[p.TRANSFER_ID]);if(ea&&ea[p.STATUS]!==this.state.transfer[p.STATUS])this.setState({transfer:ea});},getStatus:function(){var ea=y._("Pending"),fa=y._("Completed"),ga=y._("Cancelled"),ha=y._("Sent"),ia=this.state.viewerIsSender;switch(this.state.transfer[p.STATUS]){case q.PENDING_RECIPIENT_PROCESSING:case q.INTERMEDIATE_PROCESSING:return ia?ha:fa;case q.PENDING_RECIPIENT_NUX:case q.PENDING_RECIPIENT_VERIFICATION:case q.PENDING_RECIPIENT_MANUAL_REVIEW:case q.PENDING_RECIPIENT_VERIFICATION_PROCESSING:case q.PENDING_PUSH_FAIL:case q.PENDING_SENDER_INITED:return ia?ha:ea;case q.PENDING_SENDER_MANUAL_REVIEW:case q.PENDING_SENDER_VERIFICATION:case q.PENDING_SENDER_VERIFICATION_PROCESSING:return ea;case q.CANCELED_SENDER_RISK:case q.CANCELED_DECLINED:case q.CANCELED_RECIPIENT_RISK:case q.CANCELED_SYSTEM_FAIL:case q.CANCELED_EXPIRED:case q.CANCELED_SAME_CARD:return ga;case q.COMPLETED:return fa;}},isGrayStatus:function(){switch(this.state.transfer[p.STATUS]){case q.PENDING_RECIPIENT_VERIFICATION:case q.PENDING_RECIPIENT_VERIFICATION_PROCESSING:case q.PENDING_RECIPIENT_MANUAL_REVIEW:case q.PENDING_RECIPIENT_NUX:case q.PENDING_PUSH_FAIL:if(this.state.viewerIsSender)return false;return true;case q.PENDING_SENDER_MANUAL_REVIEW:case q.PENDING_SENDER_VERIFICATION:case q.PENDING_SENDER_VERIFICATION_PROCESSING:case q.CANCELED_SENDER_RISK:case q.CANCELED_DECLINED:case q.CANCELED_RECIPIENT_RISK:case q.CANCELED_SYSTEM_FAIL:case q.CANCELED_EXPIRED:case q.CANCELED_SAME_CARD:return true;case q.COMPLETED:case q.INTERMEDIATE_PROCESSING:case q.PENDING_SENDER_INITED:case q.PENDING_RECIPIENT_PROCESSING:return false;}},isRecipientActionableStatus:function(){var ea=this.state.transfer[p.STATUS];return (!this.state.viewerIsSender&&(ea===q.PENDING_RECIPIENT_NUX||ea===q.PENDING_RECIPIENT_VERIFICATION||ea===q.PENDING_PUSH_FAIL));},shouldRenderBubbleV2:function(){return n.WebBubbleV2;},shouldRenderBannerFooter:function(){return (l.isCreditCardsFetchComplete()&&this.isRecipientActionableStatus()&&this.shouldRenderBubbleV2()&&this.props.theme!=='messenger');},handleConfirmInfoButtonClicked:function(){s.startVerificationFlow(this.state.transfer[p.TRANSFER_ID],false);},handleAddCardButtonClicked:function(){this.setState({acceptMoneyDialogShown:true});},handleAcceptMoneyDialogClose:function(){this.setState({acceptMoneyDialogShown:false});},renderInlineBanner:function(){var ea=this.state.transfer[p.STATUS];if(ea===q.PENDING_RECIPIENT_NUX){return this.renderPendingRecipientNUX();}else if(ea===q.PENDING_RECIPIENT_VERIFICATION){return this.renderPendingRecipientVerification();}else if(ea===q.PENDING_PUSH_FAIL)return this.renderPendingPushFail();return null;},renderPendingRecipientNUX:function(){var ea=this.state.transfer,fa=o.ReceiverInThreadNUXBodyText||y._("Just add a debit card to accept it.");return (t.createElement("div",{className:"_3asb"},t.createElement("div",{className:"_3asc"},y._("{sender_name} sent you money!",[y.param("sender_name",ea.sender.name)])),t.createElement("div",{className:"_3asd"},fa),t.createElement(v,{use:"confirm",size:"medium",label:y._("Add Card"),onClick:this.handleAddCardButtonClicked})));},renderPendingRecipientVerification:function(){return (t.createElement("div",{className:"_3asb"},t.createElement("div",{className:"_3asc"},y._("Please Confirm your Info")),t.createElement("div",{className:"_3asd"},y._("To accept the money {sender_name} sent you, please confirm your information.",[y.param("sender_name",this.state.transfer.sender.name)])),t.createElement(v,{use:"confirm",size:"medium",label:y._("Confirm Info"),onClick:this.handleConfirmInfoButtonClicked})));},renderPendingPushFail:function(){return (t.createElement("div",{className:"_3asb"},t.createElement("div",{className:"_3asc"},y._("Update Your Card")),t.createElement("div",{className:"_3asd"},y._("It looks like your card has expired or is invalid. Please update it to get {currency}{amount} from {sender_name}.",[y.param("currency",this.state.transfer.currency),y.param("amount",this.state.transfer.amount),y.param("sender_name",this.state.transfer.sender.name)])),t.createElement(v,{use:"confirm",size:"medium",label:y._("Update Card"),href:m.settingsWWWURI,target:"_blank"})));},getStatusHeaderText:function(){if(this.isMessengerDotComView()){return (y._("Status"));}else return (y._("STATUS"));},getActionHeaderText:function(){var ea=this.state.transfer[p.STATUS],fa=this.isMessengerDotComView(),ga=this.state.viewerIsSender,ha=fa?y._("Sent on"):y._("SENT ON"),ia=fa?y._("Received on"):y._("RECEIVED ON"),ja=fa?y._("Cancelled on"):y._("CANCELLED ON");switch(ea){case q.PENDING_SENDER_MANUAL_REVIEW:case q.PENDING_RECIPIENT_MANUAL_REVIEW:case q.PENDING_RECIPIENT_PROCESSING:case q.INTERMEDIATE_PROCESSING:case q.COMPLETED:return ga?ha:ia;case q.PENDING_RECIPIENT_NUX:case q.PENDING_RECIPIENT_VERIFICATION:case q.PENDING_RECIPIENT_VERIFICATION_PROCESSING:case q.PENDING_PUSH_FAIL:case q.PENDING_SENDER_INITED:return ga?ha:null;case q.PENDING_SENDER_VERIFICATION:case q.PENDING_SENDER_VERIFICATION_PROCESSING:return null;case q.CANCELED_SENDER_RISK:case q.CANCELED_DECLINED:case q.CANCELED_RECIPIENT_RISK:case q.CANCELED_SYSTEM_FAIL:case q.CANCELED_EXPIRED:case q.CANCELED_SAME_CARD:return ja;}},isMessengerDotComView:function(){return this.props.theme==='messenger';},isMessagesView:function(){return this.props.theme==='messages';},getImage:function(){if(this.isMessengerDotComView()){if(this.isGrayStatus()){return z('/images/p2p/message-icon-dark-gray.png');}else return z('/images/p2p/message-icon-blue.png');}else if(this.isGrayStatus()){return z('/images/p2p/message-icon-gray.png');}else return z('/images/p2p/message-icon-black.png');},getTransferStatusDate:function(){var ea,fa=this.state.transfer[p.STATUS];switch(fa){case q.PENDING_RECIPIENT_PROCESSING:case q.INTERMEDIATE_PROCESSING:case q.COMPLETED:ea=this.state.transfer.completedTime;break;case q.CANCELED_SENDER_RISK:case q.CANCELED_DECLINED:case q.CANCELED_RECIPIENT_RISK:case q.CANCELED_SYSTEM_FAIL:case q.CANCELED_EXPIRED:case q.CANCELED_SAME_CARD:ea=this.state.transfer.updatedTime;break;}if(!ea)ea=this.state.transfer.creationTime;return x(ea,'M jS, g:ia');},renderStatusFooter:function(){var ea=this.getActionHeaderText(),fa;if(ea)fa=t.createElement("div",{className:"_4ybr"},t.createElement("div",{className:"_1nkr"},t.createElement("div",{className:"_4ybp"},ea),t.createElement("div",{className:"_4ybq"},this.getTransferStatusDate())));return (t.createElement("div",{className:"_4ybn"},t.createElement("div",{className:"_4ybo"},t.createElement("div",{className:"_1nkq"},t.createElement("div",{className:"_4ybp"},this.getStatusHeaderText()),t.createElement("div",{className:"_4ybq"},this.getStatus()))),fa));},renderLayers:function(){var ea={};if(this.state.acceptMoneyDialogShown)ea.acceptDialog=t.createElement(j,{asyncRequestState:this.state.creditCardAsyncRequestState,creditCards:this.state.creditCards,onClose:this.handleAcceptMoneyDialogClose,transfer:this.state.transfer});return ea;},render:function(){var ea,fa,ga="_4ybm";if(this.shouldRenderBannerFooter()){ea=t.createElement("div",{className:ga},this.renderInlineBanner());}else fa=t.createElement("div",{className:ga},this.renderStatusFooter());return (t.createElement("div",{className:(("_30of")+(this.state.viewerIsSender?' '+"_4ybf":'')+(this.isMessagesView()?' '+"_4ybg":'')+(this.isMessengerDotComView()?' '+"_4ybh":''))},t.createElement("div",{className:"_3ase"},t.createElement(i,{className:"_3asf",href:m.settingsWWWURI,target:"_blank"},t.createElement("div",{className:"_4ybi"},t.createElement("div",{className:"_4ybj"},t.createElement("div",{className:"_4ybk"},t.createElement(h,{height:16,src:this.getImage(),width:16})),t.createElement("div",{className:(("_4ybl")+(this.isGrayStatus()?' '+"_3asg":''))},this.state.transfer.amount))),fa),ea)));}});e.exports=da;},null);
__d("MercuryShareImage.react",["ChatImageWithArrow.react","React","cx"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=h.createClass({displayName:"MercuryShareImage",render:function(){return (h.createElement(g,{arrowDirection:"BOTH",arrowClassName:"_2lg_",height:this.props.height,source:this.props.source,width:this.props.width}));}});e.exports=j;},null);
__d("MercuryFallbackShareAttachment.react",["Image.react","ImageBlock.react","LineClamp.react","Link.react","MercuryShareAttachmentRenderLocations","MercuryShareAttachmentReactShape","MercuryShareImage.react","MessengerAttachmentImageBlock.react","React","cx","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();'use strict';var r=o,s=r.PropTypes,t=2,u=2,v=72,w=o.createClass({displayName:"MercuryFallbackShareAttachment",propTypes:{attachment:l(),location:s.oneOf(k.getValues()),rootClassName:s.string},renderLink:function(x){if(k.isPreview(location))return x;return (o.createElement(j,{className:"_5rw4",href:this.props.attachment.uri,target:"_blank"},x));},render:function(){var x=this.props.attachment,y=this.props.location,z=q(((k.CHAT===y?"_49or":'')+(k.CHAT_PREVIEW===y?' '+"_324d":'')+(k.CHAT!==y?' '+"_tih":'')+(!(x&&x.media.image)?' '+"_49ou":'')),this.props.rootClassName),aa=(o.createElement("div",{className:"__6j"},o.createElement(i,{className:"__6k",lines:u},x.title),o.createElement(i,{className:"__6l",lines:t},x.description),o.createElement("div",{className:"__6m"},x.source)));if(x.media&&x.media.image){if(k.CHAT===y||k.CHAT_PREVIEW===y){return this.renderLink(o.createElement(h,{className:z,spacing:"medium"},o.createElement(m,{height:v,source:x.media.image,width:v}),aa));}else if(k.MESSENGER===y)return this.renderLink(o.createElement(n,{className:z,attachment:x},aa,this.props.children));return this.renderLink(o.createElement(h,{className:q(this.props.className,z)},o.createElement(g,{className:"__6n",src:x.media.image,width:v}),aa,this.props.children));}return this.renderLink(o.createElement("div",{className:q(this.props.className,z)},aa,this.props.children));}});e.exports=w;},null);
__d("P2PMercuryShareAttachment.react",["MercuryShareAttachmentReactShape","MercuryShareAttachmentRenderLocations","P2PMercuryAttachment.react","React","cx"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();'use strict';var l=j,m=l.PropTypes,n=j.createClass({displayName:"P2PMercuryShareAttachment",propTypes:{attachment:g(),location:m.oneOf(h.getValues())},render:function(){var o={metadata:this.props.attachment.target};if(this.props.location===h.MESSENGER){o.theme='messenger';}else if(this.props.location===h.WEB_INBOX)o.theme='messages';return (j.createElement("div",{className:"_3fyk"},j.createElement(i,j.__spread({},o))));}});e.exports=n;},null);
__d("MercuryShareAttachment.react",["Map","MercuryConfig","MercuryShareAttachmentReactShape","MercuryShareAttachmentRenderLocations","React","StoryAttachmentStyle","MercuryFallbackShareAttachment.react","P2PMercuryShareAttachment.react","MNCommerceReceiptMercuryShareAttachment.react","MNCommerceCancelReturnMercuryShareAttachment.react","MNCommerceShippingMercuryShareAttachment.react"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=k,n=m.PropTypes,o=new g();o.set(l.FALLBACK,b('MercuryFallbackShareAttachment.react'));o.set(l.ORION,b('P2PMercuryShareAttachment.react'));if(h.WWWMessengerComerceGK){o.set(l.RETAIL_RECEIPT,b('MNCommerceReceiptMercuryShareAttachment.react'));o.set(l.RETAIL_CANCELLATION,b('MNCommerceCancelReturnMercuryShareAttachment.react'));o.set(l.RETAIL_SHIPMENT,b('MNCommerceShippingMercuryShareAttachment.react'));o.set(l.RETAIL_SHIPMENT_TRACKING_EVENT,b('MNCommerceShippingMercuryShareAttachment.react'));}var p=k.createClass({displayName:"MercuryShareAttachment",propTypes:{attachment:i(),location:n.oneOf(j.getValues()),rootClassName:n.string},render:function(){var q=this.props.attachment;if(!q.style_list)return null;var r=null;for(var s=0;s<q.style_list.length;s++){r=o.get(q.style_list[s]);if(r)break;}if(!r)return null;return (k.createElement(r,k.__spread({},this.props)));}});e.exports=p;},null);
__d("XStickerAssetController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/asset\/",{sticker_id:{type:"Int",required:true},image_type:{type:"Enum",defaultValue:"BestEffortImage",enumType:1}});},null);
__d("XLinkshimLogController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/si\/ajax\/l\/render_linkshim_log\/",{u:{type:"String",required:true},h:{type:"String",required:true},render_verification:{type:"Bool",defaultValue:false},enc:{type:"String"},d:{type:"String"}});},null);
__d("LinkshimHandler",["Event","LinkshimAsyncLink","LinkshimHandlerConfig","URI","XLinkshimLogController","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m={setUpLinkshimHandling:function(s){try{var u=j(s.getAttribute('href')),v=n(u);if(v&&o(u)){g.listen(s,'mouseover',l(h.swap,null,s,v));var w=q(u);g.listen(s,'click',function(){if(i.supports_meta_referrer){h.referrer_log(s,w,p(u).toString());}else h.swap(s,u);});}}catch(t){}}};function n(s){return s.getQueryData().u?new j(s.getQueryData().u):null;}function o(s){return s.getQueryData().hasOwnProperty('s');}function p(s){var t=s.getQueryData().hasOwnProperty('enc')?s.getQueryData().enc:'';return (k.getURIBuilder()).setString('u',s.getQueryData().u).setString('h',s.getQueryData().h).setBool('render_verification',s.getQueryData().hasOwnProperty('render_verification')).setString('enc',t).getURI();}function q(s){var t;if(r()){t=j(s).addQueryData({render_verification:true});}else t=n(s);return t;}function r(){var s=i.render_verification_rate||0;return Math.floor(Math.random()*s+1)===s;}e.exports=m;},null);
__d("MercuryAttachmentRenderer",["MercuryAttachmentTemplates","MercuryAttachmentAudioClip.react","Bootloader","ChatAnimatedGifs","SyncRequest.react","P2PMercuryAttachment.react","CSS","MercuryConstants","DOM","Event","MercuryAttachment","MercuryAttachmentPhoto.react","MercuryAttachmentPhotoGrid.react","MercuryAttachmentType","MercuryAttachmentVideo.react","MercuryConfig","MercuryIDs","MercuryMessageInfo","MercuryParticipants","MercuryShareAttachment.react","MercuryShareAttachmentRenderLocations","MercuryViewer","ProgressBar","React","Sticker.react","StickerAssetType","StickerConstants","StickerImages","StickerUtils","Style","URI","UserAgent_DEPRECATED","cx","fbt","invariant","updatePhotoProgressBar","XStickerAssetController","MercuryMessages","MercuryAttachmentAudioClipTranscript.react"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa){b.__markCompiled&&b.__markCompiled();'use strict';var ra=b('MercuryMessages').get(),sa=la.ie()<=8;function ta(wa,xa){var ya=g[xa].build().setNodeContent('filename',wa.name),za=ya.getNode('link');za.setAttribute('href',wa.url);wa.rel&&za.setAttribute('rel',wa.rel);m.addClass(ya.getRoot(),q.getAttachIconClass(wa.icon_type));return ya;}function ua(wa,xa){var ya=g[xa].build().setNodeContent('filename',wa.name);m.addClass(ya.getRoot(),q.getAttachIconClass(wa.icon_type));return ya;}var va={renderAttachment:function(wa,xa,ya,za,ab,bb){var cb=100,db=wa?160:400,eb=null,fb=null,gb=n.MercurySupportedShareType;if(this.isErrorAttachment(xa))eb=va.renderError(xa);if(this.isShareAttachment(xa)&&xa.share){fb=o.create('div',{className:((ya.body?"_r38":''))});var hb=wa?aa.CHAT:aa.WEB_INBOX;da.render(da.createElement(z,{attachment:xa.share,location:hb,maxWidth:za}),fb);}if(!fb&&this.isShareAttachment(xa)&&xa.share_xhp&&(xa.share_data_type===gb.FB_BROWSE_QUERY||!wa))fb=va.renderShareXHP(xa,ya.id);if(this.isStickerAttachment(xa))fb=va.renderSticker(xa,ya,wa,bb);if(!fb&&this.isShareAttachment(xa)){var ib=xa.share_data_type;switch(ib){case gb.FB_PHOTO:fb=va.renderPreview(xa,ya,za,ab);break;case gb.FB_VIDEO:fb=va.renderVideoThumb(xa);break;case gb.FB_MUSIC_ALBUM:case gb.FB_SONG:case gb.FB_PLAYLIST:case gb.FB_MUSICIAN:case gb.FB_RADIO_STATION:fb=va.renderMusic(xa);break;case gb.EXTERNAL:case gb.FB_TEMPLATE:case gb.FB_SOCIAL_REPORT_PHOTO:case gb.FB_MESSAGE_LOCATION:fb=va.renderExternalLink(xa);break;case gb.FB_COUPON:case gb.FB_EVENT:case gb.FB_SHOERACK_INVITATION:fb=va.renderChatXHP(xa);break;case gb.FB_SOCIAL_RESOLUTION:case gb.FB_STATUS:fb=va.renderSocialResolution(xa);break;case gb.FB_SYNC_REQUEST:fb=va.renderSyncRequest(xa);break;case gb.FB_OPEN_GRAPH:fb=va.renderOpenGraph(xa);break;case gb.FB_ORION:fb=va.renderP2PMercuryAttachment(xa,wa);break;default:if(xa.name)fb=va.renderShareLink(xa,ya&&ya.id,wa);break;}}if(!fb&&xa.preview_loading)fb=va.renderPreview(xa,ya,za,ab);if(!fb&&this.isVideoAttachment(xa)){fb=o.create('div');da.render(va.renderVideo(xa,wa,ya),fb);}if(!fb&&xa.preview_url)fb=va.renderPreview(xa,ya,za,ab);if(!fb&&this.isFileAttachment(xa))if(xa.metadata&&q.isVoiceMessage(xa.metadata.type)){fb=o.create('div');var jb=va.renderAudioClip(xa,ya.message_id,cb,db);da.render(jb,fb);}else fb=wa?va.renderFileLink(xa):va.renderExtendedFileLink(xa);if((v.MercuryStoryAttachmentsGK||v.WWWMessengerComerceGK)&&!(this.isShareAttachment(xa)&&xa.share)&&fb)m.addClass(fb,"_1t06");return {error:eb,content:fb,bubblePreferred:this.isBubblePreferred(xa)};},isBubblePreferred:function(wa){return !this.isStickerAttachment(wa)&&!this.isSyncRequestAttachment(wa);},renderError:function(wa){var xa=g[':fb:mercury:attachment:error'].build();o.appendContent(xa.getNode('error'),wa.error_msg);return xa.getRoot();},renderSocialResolution:function(wa){var xa=g[':fb:mercury:attachment:social-resolution'].build();xa.setNodeContent('post',wa.share_xhp);return xa.getRoot();},renderChatXHP:function(wa){var xa=g[':fb:mercury:attachment:social-resolution'].build();xa.setNodeContent('post',wa.chat_xhp);return xa.getRoot();},renderOpenGraph:function(wa){var xa=wa.share_xhp.cloneNode(true);if(la.firefox())ja.set(xa,'minWidth','180px');return xa;},renderExternalLink:function(wa){var xa=g[':fb:mercury:attachment:external-link'].build().setNodeContent('name',wa.name);wa.base_url&&xa.setNodeContent('shortLink',wa.base_url);var ya=xa.getNode('preview'),za=xa.getNode('image-link');za.setAttribute('href',wa.url);wa.rel&&za.setAttribute('rel',wa.rel);if(wa.preview_url){var ab=xa.getNode('preview-image'),bb=wa.preview_url,cb=ka(j.getRawUrlFromSafeUrl(bb));if(wa.animated_gif_uri){bb=ka(wa.animated_gif_uri);m.addClass(ya,"_dri");if(wa.name&&wa.name.__html==cb.toString())xa.setNodeContent('name','');}ab.setAttribute('src',bb);m.addClass(ya,wa.preview_class);m.show(ab);}else{m.addClass(xa.getRoot(),'noMedia');m.hide(ya);}xa.getNode('name').setAttribute('href',wa.url);d(['LinkshimHandler'],function(db){db.setUpLinkshimHandling(xa.getNode('name'));db.setUpLinkshimHandling(xa.getNode('image-link'));});if(wa.rel)xa.getNode('name').setAttribute('rel',wa.rel);return xa.getRoot();},renderFileLink:function(wa){var xa=null;if(wa.url===''){xa=':fb:mercury:attachment:file-name';return ua(wa,xa).getRoot();}else{xa=':fb:mercury:attachment:file-link';return ta(wa,xa).getRoot();}},renderAudioClip:function(wa,xa,ya,za){var ab=wa.metadata.duration/1000,bb=200;if(ya&&za)if(ab<5){bb=ya;}else bb=(1-Math.pow(10,(ab-5)/-30))*(za-ya)+ya;var cb=null;if(v.WebMessengerTranscriptRenderGK){var db=b('MercuryAttachmentAudioClipTranscript.react');cb=da.createElement(db,{message_id:xa,attachment:wa});}return (da.createElement("div",null,da.createElement(h,{src:wa.url,duration:wa.metadata.duration/1000,showHelp:false,width:bb}),cb));},renderVideo:function(wa,xa,ya){var za=xa?wa.metadata.chat_size:wa.metadata.inbox_size,ab=xa?wa.metadata.chat_preview:wa.metadata.inbox_preview,bb=wa.metadata.dimensions;if(!za){ab=wa.thumbnail_url;za=bb={height:wa.preview_height,width:wa.preview_width};}return (da.createElement(u,{duration:wa.metadata.duration,isInbound:x.isInbound(ya),isChat:xa,name:wa.name,pageID:wa.metadata.pageid,thumbSize:za,thumbnail:ab,videoSize:bb,videoID:wa.metadata.fbid,videoURI:wa.url}));},renderExtendedFileLink:function(wa){var xa=null;if(wa.url===''){xa=':fb:mercury:attachment:file-name';return ua(wa,xa).getRoot();}xa=':fb:mercury:attachment:extended-file-link';var ya=ta(wa,xa);if(wa.open_url){var za=ya.getNode('openLinkContainer');m.show(za);var ab=ya.getNode('openFile');ab.setAttribute('href',wa.open_url);}var bb=ya.getNode('downloadFile');bb.setAttribute('href',wa.url);wa.rel&&bb.setAttribute('rel',wa.rel);return ya.getRoot();},renderMusic:function(wa){var xa=g[':fb:mercury:attachment:music'].build().setNodeContent('filename',wa.name),ya=xa.getNode('link');ya.setAttribute('href',wa.url);ya.setAttribute('target','_blank');wa.rel&&ya.setAttribute('rel',wa.rel);var za=xa.getNode('image-link');za.setAttribute('href',wa.url);wa.rel&&za.setAttribute('rel',wa.rel);var ab=xa.getNode('preview-image');ab.setAttribute('src',wa.preview_url);m.show(ab);m.addClass(xa.getNode('icon_link'),'MercuryMusicIcon');return xa.getRoot();},renderSyncRequest:function(wa){var xa=k(wa.metadata),ya=o.create('div');da.render(xa,ya);return ya;},renderP2PMercuryAttachment:function(wa,xa){var ya={metadata:wa.metadata};if(!xa)ya.theme='messages';var za=da.createElement(l,da.__spread({},ya)),ab=o.create('div');da.render(za,ab);return ab;},resizeContain:function(wa,xa){var ya=wa.width/wa.height,za=xa.width/xa.height;if(za<ya){return {width:Math.min(wa.height*za,xa.width),height:Math.min(wa.height,xa.height)};}else return {width:Math.min(wa.width,xa.width),height:Math.min(wa.width/za,xa.height)};},renderPreview:function(wa,xa,ya,za){var ab=g[':fb:mercury:attachment:preview'].build(),bb=ab.getNode('image-link');if(wa){wa.url&&bb.setAttribute('href',wa.url);wa.rel&&bb.setAttribute('rel',wa.rel);if(wa.rel==='async'&&wa.hires_url){bb.setAttribute('href',wa.hires_url);bb.setAttribute('ajaxify',wa.url);}var cb;if(wa.preview_uploading){var db=ab.getNode('cancel-button-container');m.show(db);var eb=ab.getNode('cancel-button'),fb=p.listen(eb,'click',function(){wa.upload_canceled(wa.upload_id);m.hide(ab.getRoot());fb.remove();});wa.on_success(function(event,mb){if(mb.upload_id==wa.upload_id){m.hide(db);fb.remove();}});var gb=ab.getNode('progress-bar'),hb=new ca(gb),ib=ab.getNode('progress-bar-container');oa(wa.upload_id);wa.on_progress(function(event,mb){if(mb.upload_id==wa.upload_id){m.removeClass(ib,"_395w");m.show(ib);pa(hb,mb.event);}});if(wa.on_resizing_progress)wa.on_resizing_progress(function(event,mb){if(mb.upload_id==wa.upload_id){m.addClass(ib,"_395w");m.show(ib);hb.setPosition(100*mb.event.written/mb.event.total);}});m.addClass(bb,"_57jm");if(ya>=176){cb='/images/photos/dots_large.png';}else if(ya>=86){cb='/images/photos/dots_medium.png';}else cb='/images/photos/dots_small.png';ja.set(bb,'width',ya+'px');ja.set(bb,'max-width',ya+'px');if(wa.preview_width&&wa.preview_height)ja.set(bb,'padding-bottom',((wa.preview_height/wa.preview_width)*100)+'%');}else if(wa.preview_loading){m.addClass(bb,"_5xdv");if(za==='contain'&&wa.preview_width&&wa.preview_height){ja.set(bb,'width',wa.preview_width+'px');ja.set(bb,'height',wa.preview_height+'px');}if(za==='cover'&&!sa)m.addClass(bb,"_55pj");}else if(wa.metadata&&wa.metadata.fbid){cb=ka('/ajax/mercury/attachments/photo.php').addQueryData({fbid:wa.metadata.fbid,request_user_id:wa.metadata.pageid,mode:za,width:ya,height:ya}).toString();var jb=bb.getAttribute('ajaxify');bb.removeAttribute('ajaxify');bb.removeAttribute('rel');p.listen(bb,'click',function(event){event.prevent();i.loadModules(["MessagesViewer"],function(mb){mb.bootstrapWithConfig({src:cb,endpoint:jb,fbid:wa.metadata.fbid,dimensions:wa.metadata.dimensions,disablePaging:xa&&xa.attachments.length==1},bb);});});}else cb=ka(wa.preview_url).toString();var kb=ab.getNode('preview-image');if(cb){if(za==='contain'&&wa.preview_width&&wa.preview_height){var lb=va.resizeContain({width:ya,height:ya},{width:wa.preview_width,height:wa.preview_height});kb.setAttribute('width',lb.width);kb.setAttribute('height',lb.height);}if(wa.preview_uploading||(za==='cover'&&!sa)){m.addClass(bb,"_55pj");ja.set(bb,'backgroundImage','url('+cb+')');}else{kb.onload=function(){kb.removeAttribute('width');kb.removeAttribute('height');};kb.setAttribute('src',cb);}}if(xa)this.renderReportRespondLink(ab.getRoot(),wa,xa.message_id);}return ab.getRoot();},renderShareLink:function(wa,xa,ya){var za=g[':fb:mercury:attachment:share-link'].build().setNodeContent('name',wa.name),ab=za.getNode('link');ab.setAttribute('href',wa.url);wa.rel&&ab.setAttribute('rel',wa.rel);return za.getRoot();},renderVideoThumb:function(wa){var xa=g[':fb:mercury:attachment:video-thumb'].build(),ya=xa.getNode('thumb');ya.setAttribute('href',wa.url);ya.setAttribute('rel',wa.rel);var za=o.find(xa.getRoot(),'img');za.src=wa.preview_url;return xa.getRoot();},renderShareXHP:function(wa,xa){var ya=o.create('div');if(wa){o.appendContent(ya,wa.share_xhp);this.renderReportRespondLink(ya,wa,xa);}return ya;},renderSticker:function(wa,xa,ya,za){var ab=ya?'chatScrolled/':'messengerScrolled/';ab+=xa.thread_id;var bb=o.create('div');m.addClass(bb,'stickerContainer');if(!wa.metadata){var cb=ha.getSticker(xa.sticker_id),db=Object.assign({},cb),eb=ia.getScaledDimensions(cb.height,cb.width,ga.THREAD_SIZE),fb=eb.height,gb=eb.width;db.height=fb;db.width=gb;db.stickerID=xa.sticker_id;db.spriteURI='';db.spriteURI2x='';db.paddedSpriteURI='';db.paddedSpriteURI2x='';wa.metadata=db;}var hb=null;if(wa.metadata.stickerID)hb=wa.metadata.stickerID.toString();var ib=null;if(wa.metadata.packID)ib=wa.metadata.packID.toString();var jb=qa.getURIBuilder().setInt('sticker_id',hb),kb=null,lb=null;if(window.devicePixelRatio&&window.devicePixelRatio>1){lb=wa.metadata.paddedSpriteURI2x;kb=wa.metadata.spriteURI2x;}else{lb=wa.metadata.paddedSpriteURI;kb=wa.metadata.spriteURI;}var mb=da.createElement(ea,{animationTrigger:"hover",className:"mvs",frameCount:wa.metadata.frameCount||1,frameRate:wa.metadata.frameRate||83,framesPerCol:wa.metadata.framesPerCol||1,framesPerRow:wa.metadata.framesPerRow||1,onStickerClick:za,packID:ib,paddedSpriteURI:lb,sourceHeight:wa.metadata.height,sourceURI:jb.setEnum('image_type',fa.IMAGE).getURI().toString(),sourceWidth:wa.metadata.width,spriteURI:kb,stickerID:hb,subscribedThreadID:ab});da.render(mb,bb);return bb;},renderReportRespondLink:function(wa,xa,ya){if(!xa.is_social_report_attachment)return null;switch(xa.share_data_type){case n.MercurySupportedShareType.FB_PHOTO:break;case n.MercurySupportedShareType.FB_SOCIAL_REPORT_PHOTO:return null;default:return null;}var za=null;if(ya)za=ra.getMessagesFromIDs([ya])[0];if(!za)return null;if(za.author===ba.getID())return null;var ab=null;y.get(za.author,function(bb){ab=o.create('a',{rel:'dialog-post',className:"_z6l",id:'respond-link',ajaxify:ka('/ajax/report/social_resolution/post/').setQueryData({attachment_fbid:xa.attach_id,post_fbid:xa.shared_object_id,sender_id:w.getUserIDFromParticipantID(bb.id)}).toString()});o.setContent(ab,na._("Respond to {name}'s request",[na.param("name",bb.name)]));o.appendContent(wa,ab);});},renderPhotoAttachments:function(wa,xa,ya,za,ab){var bb=wa.length;if(!bb)return null;var cb=o.create('div',{className:(("_55pk")+(v.MercuryImageBubblesGK&&!!xa.body?' '+"_9id":''))});if(bb===1){if(v.MercuryImageBubblesGK&&!xa.body&&ab){var db=wa[0],eb=va.resizeContain({width:ya,height:ya},{width:db.preview_width,height:db.preview_height});da.render(da.createElement(r,{image:db,width:eb.width,height:eb.height,message:xa}),cb);}else{var fb=va.renderPreview(wa[0],xa,ya,'contain');o.appendContent(cb,fb);}return cb;}if(v.MercuryImageBubblesGK&&!xa.body&&ab){da.render(da.createElement(s,{images:wa,size:ya,message:xa}),cb);return cb;}var gb=(bb==2||bb==4)?2:3,hb=(ya-(gb-1)*za)/gb,ib=Math.ceil(bb/gb),jb=ib*hb+(ib-1)*za,kb=o.create('div',{className:"_55pm",style:'padding-bottom: '+(jb/ya*100)+'%;'});o.appendContent(cb,kb);for(var lb=0;lb<bb;++lb){var mb=va.renderPreview(wa[lb],xa,hb,'cover'),nb=lb%gb,ob=Math.floor(lb/gb);m.addClass(mb,"_55pn");ja.apply(mb,{width:(hb/ya*100)+'%',left:((nb*(hb+za))/ya*100)+'%',top:((ob*(hb+za))/jb*100)+'%'});o.appendContent(kb,mb);}return cb;},isPhotoAttachment:function(wa){return wa.attach_type==t.PHOTO||wa.attach_type==t.ANIMATED_IMAGE||(wa.attach_type==t.FILE&&wa.preview_url);},isVideoAttachment:function(wa){return wa.attach_type==t.VIDEO;},isShareAttachment:function(wa){return wa.attach_type==t.SHARE;},isFileAttachment:function(wa){return wa.attach_type==t.FILE;},isErrorAttachment:function(wa){return wa.attach_type==t.ERROR;},isStickerAttachment:function(wa){return wa.attach_type==t.STICKER;},isSyncRequestAttachment:function(wa){var xa=n.MercurySupportedShareType;return this.isShareAttachment(wa)&&wa.share_data_type==xa.FB_SYNC_REQUEST;},sortAttachmentsStablyByType:function(wa){var xa=[va.isPhotoAttachment,va.isShareAttachment,va.isFileAttachment,va.isErrorAttachment];xa.push(function(za){return true;});var ya=xa.map(function(za){return [];});wa.forEach(function(za){for(var ab=0;ab<xa.length;ab++)if(xa[ab](za)){ya[ab].push(za);break;}});return Array.prototype.concat.apply([],ya);}};e.exports=va;},null);
__d("MercuryAttachments.react",["MercuryAttachmentRenderer","DOM","Event","ImmutableObject","React","SubscriptionsHandler","cx","emptyFunction","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();'use strict';var p=k,q=p.PropTypes,r=176,s=4,t=k.createClass({displayName:"MercuryAttachments",propTypes:{attachments:q.array.isRequired,customPhotoWidth:q.number,maxWidth:q.number,message:q.instanceOf(j).isRequired,isChat:q.bool,onImageLoad:q.func,onStickerClick:q.func},getDefaultProps:function(){return {isChat:false,onImageLoad:n,onStickerClick:n};},componentDidMount:function(){this._subscriptionsHandler=new l();this.renderAttachments();},componentDidUpdate:function(){this.renderAttachments();},componentWillUnmount:function(){this._subscriptionsHandler.release();},render:function(){var u=this.props.attachments.filter(g.isPhotoAttachment).length>0;return (k.createElement("div",k.__spread({},this.props,{className:o(this.props.className,(("_5h9y")+(u?' '+"_zl6":'')))})));},renderAttachments:function(){var u=k.findDOMNode(this);h.empty(u);var v=this.props.message,w=g.sortAttachmentsStablyByType(this.props.attachments),x=this.props.customPhotoWidth||r,y=g.renderPhotoAttachments(w.filter(g.isPhotoAttachment),v,x,s,this.props.isChat);y&&h.appendContent(u,y);for(var z=0;z<w.length;z++){var aa=w[z];if(g.isPhotoAttachment(aa))continue;var ba=g.renderAttachment(this.props.isChat,aa,v,this.props.maxWidth,null,this.props.onStickerClick);ba.error&&h.appendContent(u,ba.error);ba.content&&h.appendContent(u,ba.content);}h.scry(u,'img').forEach(function(ca){this._subscriptionsHandler.addSubscriptions(i.listen(ca,'load',function(){this.props.onImageLoad(ca);}.bind(this)));}.bind(this));}});e.exports=t;},null);
__d("ChatMessage.react",["Bootloader","BootloadedComponent.react","ChatAnimatedGifs","ChatAuthorPhotoBlock.react","ChatBubble.react","ChatConfig","CSS","ImmutableObject","MercuryAttachment","MercuryAttachments.react","MercuryAttachmentRenderer","MercuryConfig","MercuryErrorInfo","MercuryIDs","MercuryMessageError.react","MercuryMessageInfo","React","cx","fbt","formatDate","isRTL","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba){b.__markCompiled&&b.__markCompiled();'use strict';var ca=w,da=ca.PropTypes,ea=w.createClass({displayName:"ChatMessage",propTypes:{message:da.instanceOf(n).isRequired,maxBubbleWidth:da.number.isRequired,onImageLoad:da.func,onStickerClick:da.func},componentDidMount:function(){m.conditionClass(w.findDOMNode(this),"_2cnu",this.isOneLine());},isOneLine:function(){var fa=this.props.message;return (v.isInbound(fa)&&!this.refs.attachmentsInside&&this.refs.bubble&&!this.refs.bubble.contentWraps());},shouldComponentUpdate:function(fa,ga){return fa.message!==this.props.message;},render:function(){var fa=this.props.message,ga=v.isInbound(fa),ha=t.isMultichat(fa.thread_id),ia=aa(fa.body),ja=l.get('chat_fading_bubbles')&&!ga&&v.isSending(fa),ka=s.hasErrorStatus(fa),la=(("_5wd4")+(ga?' '+"_1nc7":'')+(!ga?' '+"_1nc6":'')+(ga&&ha?' '+"_5ysy":'')+(ja?' '+"_4oe5":'')+(ka?' '+"_1zcs":'')+(ia?' '+"direction_rtl":'')+(!ia?' '+"direction_ltr":'')),ma=new Date(fa.timestamp);return (w.createElement(j,w.__spread({},this.props,{authorID:fa.author,className:ba(this.props.className,la),hideName:!ga||!ha,hidePhoto:!ga,timestamp:fa.timestamp,title:ga?null:z(ma,'g:ia')}),this._renderInner(),this._renderUndertext()));},_renderInner:function(){if(this.props.message.is_filtered_content)return (w.createElement("div",{className:"_5wd9",ref:"inner"},this._renderFilteredContent()));return (w.createElement("div",{className:"_5wd9",ref:"inner"},this._renderBubble(),this._renderAttachments('outside')));},_renderUndertext:function(){if(this.props.message.is_filtered_content)return null;return (w.createElement("div",{className:"_3ry4",ref:"undertext"},w.createElement(u,{className:"_5wda clearfix",message:this.props.message,ref:"status"}),this._renderSpoofWarning()));},_renderSpoofWarning:function(){return (this.props.message.is_spoof_warning?w.createElement(h,{bootloadPlaceholder:w.createElement("span",null),bootloadComponent:function(fa){g.loadModules(["MercurySpoofWarning.react"],fa);},authorID:this.props.message.author,className:"_5wdb"}):null);},_renderFilteredContent:function(){return w.createElement("div",{className:"_5wdc uiBoxYellow clearfix"},y._("This message is no longer available because it was identified as abusive or marked as spam."));},_renderAttachments:function(fa){var ga=this.props.message,ha=fa=='inside'?'attachmentsInside':'attachmentsOutside',ia=o.get(ga).filter(function(ja){var ka=q.isBubblePreferred(ja)&&!(r.MercuryImageBubblesGK&&(q.isPhotoAttachment(ja)||q.isVideoAttachment(ja))&&!ga.body);return (ka&&fa==='inside')||(!ka&&fa==='outside');});if(ia.length>0)return w.createElement(p,{className:"_5wdd clearfix",isChat:true,message:ga,attachments:ia,ref:ha,onImageLoad:this.props.onImageLoad,onStickerClick:this.props.onStickerClick,maxWidth:this.props.maxBubbleWidth});},_renderBubble:function(){var fa=this.props.message,ga=fa.body,ha=this._renderAttachments('inside'),ia=v.isInbound(fa);if(i.shouldHideBody(fa))ga='';if(ga||ha)return (w.createElement("div",{className:"_5wde"},w.createElement(k,{attachments:ha,body:ga,className:(("_5wdf")+(o.hasBubbleTail(fa,ia)?' '+"_3okg":'')),maxWidth:this.props.maxBubbleWidth,ranges:fa.ranges,ref:"bubble"})));}});e.exports=ea;},null);
__d("ChatVideoCallLink.react",["Arbiter","ChatVisibility","MercuryViewer","PresencePrivacy","React","SubscriptionsHandler","VideoCallCore","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=k,q=p.PropTypes,r=k.createClass({displayName:"ChatVideoCallLink",propTypes:{message:q.object.isRequired,onClick:q.func.isRequired},componentDidMount:function(){this._subscriptions=new l();this._subscriptions.addSubscriptions(g.subscribe(['buddylist/availability-changed'],this.availabilityChanged),j.subscribe(['privacy-changed','privacy-availability-changed'],this.availabilityChanged));},componentWillUnmount:function(){this._subscriptions.release();},render:function(){return (k.createElement("a",{className:(("callBackLink")+(this.shouldHideLink()?' '+"hidden_elem":'')),"data-gt":JSON.stringify({videochat:'clicked_callback_link'}),href:"#",onClick:this.linkClicked},this.renderLinkText()));},renderLinkText:function(){if(this.props.message.log_message_data.event_name=='install_canceled'){return (o._("Retry setup and call back."));}else if(!this.props.message.log_message_data.event_name&&this.props.message.log_message_data.callee==i.getID()&&!this.props.message.log_message_data.answered)return (o._("Call back."));},shouldHideLink:function(){return !h.isOnline()||!m.availableForCall(this.props.message.log_message_data.to);},linkClicked:function(){var s;if(this.props.message.log_message_data.event_name=='install_canceled'){s='callback_cancelinstall_link';}else if(!this.props.message.log_message_data.event_name&&this.props.message.log_message_data.callee==i.getID()&&!this.props.message.log_message_data.answered)s='callback_link';this.props.onClick(this.props.message.log_message_data.to,this.props.message.thread_id,s);},availabilityChanged:function(){this.forceUpdate();}});e.exports=r;},null);
__d("MercuryCallLogMessage.react",["FBRTCCore","FBRTCLogger","React","SimpleXUIDialog","Tooltip.react","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();var n=i.createClass({displayName:"MercuryCallLogMessage",render:function(){if(this.props.isAnswered){return (this._renderAnsweredCallLogMessage(this.props.peerFBID,this.props.peerName,this.props.isOutgoingCall));}else return (this._renderMissedCallLogMessage(this.props.peerFBID,this.props.peerName,this.props.isOutgoingCall));},_renderAnsweredCallLogMessage:function(o,p,q){var r=m._("call {firstname}",[m.param("firstname",p)]),s;if(q){s=m._("You called {firstname}.",[m.param("firstname",p)]);}else s=m._("{firstname} called you.",[m.param("firstname",p)]);return this._generateCallLink(s,r,o,p);},_renderMissedCallLogMessage:function(o,p,q){var r,s;if(q){r=m._("{firstname} missed a call from you.",[m.param("firstname",p)]);s=m._("call {firstname} again",[m.param("firstname",p)]);}else{r=m._("You missed a call from {firstname}.",[m.param("firstname",p)]);s=m._("call {firstname} back",[m.param("firstname",p)]);}return this._generateCallLink(r,s,o,p);},_generateCallLink:function(o,p,q,r){return (i.createElement("a",{className:"_1xpw",onClick:this._handleClick.bind(this,q,r)},i.createElement(k,{alignH:"center",position:"above",tooltip:p},o)));},_handleClick:function(o,p){if(g.isAvailableForWebrtcCalling(o)){g.startOutgoingCall(o,h.Trigger.ADMIN_MESSAGE);}else j.show(m._("{firstname} can't be called because they are temporarily offline.",[m.param("firstname",p)]),m._("Can't connect Call"));}});e.exports=n;},null);
__d("P2PMercuryLogMessage.react",["Link.react","P2PLinkConstants","P2PPaymentLogMessageSubtype","React","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=j,n=m.PropTypes,o=j.createClass({displayName:"P2PMercuryLogMessage",propTypes:{formattedAmount:n.string,receiverParticipant:n.object,senderParticipant:n.object,subtype:n.oneOf(Object.keys(i).map(function(p){return i[p];})),viewerIsSender:n.bool},getDefaultProps:function(){return {formattedAmount:'',senderParticipant:null,receiverParticipant:null,subtype:null,viewerIsSender:false};},render:function(){var p=null,q=this.props.formattedAmount,r=this.props.subtype,s=this.props.viewerIsSender,t=j.createElement(g,{className:"_kiq",href:h.settingsWWWURI,target:"_blank"},l._("See details."));switch(r){case i.CANCELED_EXPIRED:case i.CANCELED_SAME_CARD:case i.CANCELED_SENDER_RISK:case i.CANCELED_RECIPIENT_RISK:case i.CANCELED_CUSTOMER_SERVICE:if(s){p=(l._("Your payment of {amount} was cancelled. {details}",[l.param("amount",q),l.param("details",t)]));}else p=(l._("{firstname}'s payment of {amount} was cancelled. {details}",[l.param("firstname",this.props.senderParticipant.short_name),l.param("amount",q),l.param("details",t)]));break;case i.CANCELED_DECLINED:if(s){p=(l._("{firstname} didn't accept your payment of {amount}. {details}",[l.param("firstname",this.props.receiverParticipant.short_name),l.param("amount",q),l.param("details",t)]));}else p=(l._("You didn't accept {firstname}'s {amount} payment. {details}",[l.param("firstname",this.props.senderParticipant.short_name),l.param("amount",q),l.param("details",t)]));break;}return j.createElement("div",null,p);}});e.exports=o;},null);
__d("MercuryLogMessageRenderer",["MercuryAttachmentRenderer","MercuryCallLogMessage.react","CSS","DOM","HovercardLink","MercuryConfig","MercuryIDs","MercuryViewer","MercuryLogMessageType","P2PMercuryLogMessage.react","MercuryParticipants","React","Image.react","TextWithEntities.react","TooltipLink.react","cx","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){b.__markCompiled&&b.__markCompiled();var y={renderText:function(ua,va){switch(ua.log_message_type){case o.SUBSCRIBE:aa(ua,va);break;case o.UNSUBSCRIBE:fa(ua,va);break;case o.VIDEO_CALL:if(l.InteractiveCallLogGK){ka(ua,va);}else ga(ua,va);break;case o.PHONE_CALL:if(l.InteractiveCallLogGK){ka(ua,va);}else ja(ua,va);break;case o.THREAD_NAME:la(ua,va);break;case o.THREAD_IMAGE:ma(ua,va);break;case o.WALLPAPER:na(ua,va);break;case o.SERVER_ERROR:oa(ua,va);break;case o.ORION:pa(ua,va);break;case o.PAGE_REPLY:ia(ua,va);break;}},renderIcon:function(ua){return (r.createElement(s,{className:z(ua),src:x('images/spacer.gif')}));},renderLegacy:function(ua,va,wa,xa){z(xa).split(' ').forEach(function(ya){return ya&&i.addClass(ua,ya);});this.renderText(xa,function(ya){r.render(r.createElement("span",null,ya),va);});this.renderAttachmentLegacy(wa,xa);},renderAttachmentLegacy:function(ua,va){if(va.log_message_type==o.THREAD_IMAGE){var wa=va.log_message_data.image;if(wa){var xa=g.renderPreview(wa.preview_url?wa:null);j.setContent(ua,xa);i.addClass(xa,"_z6a");i.show(ua);}}}};e.exports=y;function z(ua){var va=ua.log_message_type,wa=ua.log_message_data;return (("_5wzu")+(va==o.SUBSCRIBE?' '+"_5wzj":'')+(va==o.UNSUBSCRIBE?' '+"_5wzk":'')+(va==o.THREAD_NAME?' '+"_5wzl":'')+(va==o.THREAD_IMAGE?' '+"_5wzm":'')+(va==o.VIDEO_CALL&&(wa.answered||ta(ua))?' '+"_5wzn":'')+(va==o.VIDEO_CALL&&!(wa.answered||ta(ua))?' '+"_5wzo":'')+(va==o.PHONE_CALL&&wa.answered?' '+"_5wzp":'')+(va==o.PHONE_CALL&&!wa.answered?' '+"_5wzq":'')+(va==o.SERVER_ERROR?' '+"_5wzr":''));}function aa(ua,va){var wa=sa(ua.log_message_data.added_participants);switch(wa.length){case 1:ba(ua,va,wa);break;case 2:ca(ua,va,wa);break;case 3:da(ua,va,wa);break;default:ea(ua,va,wa);break;}}function ba(ua,va,wa){var xa=[ua.author,wa[0]];q.getMulti(xa,function(ya){if(ua.author==n.getID()){va(w._("You added {subscriber1}.",[w.param("subscriber1",ra(ya[wa[0]]))]));}else if(wa[0]==n.getID()){va(w._("{actor} added you.",[w.param("actor",ra(ya[ua.author]))]));}else va(w._("{actor} added {subscriber1}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber1",ra(ya[wa[0]]))]));});}function ca(ua,va,wa){var xa=[ua.author].concat(wa);q.getMulti(xa,function(ya){if(ua.author==n.getID()){va(w._("You added {subscriber1} and {subscriber2}.",[w.param("subscriber1",ra(ya[wa[0]])),w.param("subscriber2",ra(ya[wa[1]]))]));}else if(wa[0]==n.getID()){va(w._("{actor} added you and {subscriber2}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber2",ra(ya[wa[1]]))]));}else va(w._("{actor} added {subscriber1} and {subscriber2}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber1",ra(ya[wa[0]])),w.param("subscriber2",ra(ya[wa[1]]))]));});}function da(ua,va,wa){var xa=[ua.author].concat(wa);q.getMulti(xa,function(ya){if(ua.author==n.getID()){va(w._("You added {subscriber1}, {subscriber2} and {subscriber3}.",[w.param("subscriber1",ra(ya[wa[0]])),w.param("subscriber2",ra(ya[wa[1]])),w.param("subscriber3",ra(ya[wa[2]]))]));}else if(wa[0]==n.getID()){va(w._("{actor} added you, {subscriber2} and {subscriber3}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber2",ra(ya[wa[1]])),w.param("subscriber3",ra(ya[wa[2]]))]));}else va(w._("{actor} added {subscriber1}, {subscriber2} and {subscriber3}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber1",ra(ya[wa[0]])),w.param("subscriber2",ra(ya[wa[1]])),w.param("subscriber3",ra(ya[wa[2]]))]));});}function ea(ua,va,wa){var xa=[ua.author].concat(wa);q.getMulti(xa,function(ya){function za(bb){var cb=r.createElement("div",null,bb.map(function(db){return r.createElement("div",null,db.name);}));return (r.createElement(u,{alignH:"center",position:"above",tooltip:cb},w._({"*":"{num} more"},[w.param("num",bb.length,[0])])));}var ab=wa.map(function(bb){return ya[bb];});if(ua.author==n.getID()){va(w._("You added {subscriber1}, {subscriber2} and {more_people}.",[w.param("subscriber1",ra(ab[0])),w.param("subscriber2",ra(ab[1])),w.param("more_people",za(ab.slice(2)))]));}else if(wa[0]==n.getID()){va(w._("{actor} added you, {subscriber2} and {more_people}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber2",ra(ab[1])),w.param("more_people",za(ab.slice(2)))]));}else va(w._("{actor} added {subscriber1}, {subscriber2} and {more_people}.",[w.param("actor",ra(ya[ua.author])),w.param("subscriber1",ra(ab[0])),w.param("subscriber2",ra(ab[1])),w.param("more_people",za(ab.slice(2)))]));});}function fa(ua,va){var wa=[ua.author],xa=ua.log_message_data.removed_participants,ya;if(xa.length===1){ya=xa[0];wa.push(ya);}q.getMulti(wa,function(za){var ab=za[ua.author],bb=za[ya];if(ua.author==n.getID()){if(!ya||ya==ua.author){va(w._("You left the conversation."));}else va(w._("You removed {name} from the conversation.",[w.param("name",ra(bb))]));}else if(!ya||ya==ua.author){va(w._("{actor} left the conversation.",[w.param("actor",ra(ab))]));}else if(ya==n.getID()){va(w._("{actor} removed you from the conversation.",[w.param("actor",ra(ab))]));}else va(w._("{actor} removed {name} from the conversation.",[w.param("actor",ra(ab)),w.param("name",ra(bb))]));});}function ga(ua,va){if(ta(ua)){ha(ua,va);return;}var wa=ua.log_message_data.caller,xa=ua.log_message_data.callee,ya=[wa,xa];q.getMulti(ya,function(za){var ab=qa(za[xa]);if(wa==n.getID()){if(ua.log_message_data.answered){va(w._("You called {firstname}.",[w.param("firstname",ab)]));}else va(w._("{firstname} missed a call from you.",[w.param("firstname",ab)]));}else{var bb=qa(za[wa]);if(ua.log_message_data.answered){va(w._("{firstname} called you.",[w.param("firstname",bb)]));}else va(w._("You missed a call from {firstname}.",[w.param("firstname",bb)]));}});}function ha(ua,va){q.get(ua.log_message_data.callee,function(wa){var xa=qa(wa);switch(ua.log_message_data.event_name){case 'installing':va(w._("{firstname} is setting up video calling...",[w.param("firstname",xa)]));break;case 'installed':va(w._("{firstname} finished setting up video calling.",[w.param("firstname",xa)]));break;case 'install_canceled':va(w._("You cancelled the video calling installation."));break;}});}function ia(ua,va){va(ua.log_message_body);}function ja(ua,va){var wa=ua.log_message_data.caller,xa=ua.log_message_data.callee,ya=[wa,xa];q.getMulti(ya,function(za){if(wa==n.getID()){var ab=qa(za[xa]);if(ua.log_message_data.answered){va(w._("You called {firstname}.",[w.param("firstname",ab)]));}else va(w._("{firstname} missed a call from you.",[w.param("firstname",ab)]));}else{var bb=qa(za[wa]);if(ua.log_message_data.answered){va(w._("{firstname} called you.",[w.param("firstname",bb)]));}else va(w._("You missed a call from {firstname}.",[w.param("firstname",bb)]));}});}function ka(ua,va){var wa=ua.log_message_data.caller,xa=ua.log_message_data.callee,ya=ua.log_message_data.answered,za=wa===n.getID(),ab=za?xa:wa;q.get(ab,function(bb){var cb=m.getUserIDFromParticipantID(bb.id),db=bb.short_name?bb.short_name:bb.name;va(r.createElement(h,{peerFBID:cb,peerName:db,isAnswered:ya,isOutgoingCall:za}));});}function la(ua,va){var wa=ua.log_message_data.name;if(ua.author==n.getID()){if(wa){va(w._("You named the conversation: {name}.",[w.param("name",r.createElement("span",{className:"_5wzs"},r.createElement(t,{renderEmoticons:true,renderEmoji:true,text:wa})))]));}else va(w._("You removed the conversation name."));}else q.get(ua.author,function(xa){var ya=ra(xa);if(wa){va(w._("{actor} named the conversation: {name}.",[w.param("actor",ya),w.param("name",r.createElement("span",{className:"_5wzs"},wa))]));}else va(w._("{actor} removed the conversation name.",[w.param("actor",ya)]));});}function ma(ua,va){if(ua.author==n.getID()){if(ua.log_message_data.image){va(w._("You changed the conversation picture."));}else va(w._("You removed the conversation picture."));}else q.get(ua.author,function(wa){var xa=ra(wa);if(ua.log_message_data.image){va(w._("{actor} changed the conversation picture.",[w.param("actor",xa)]));}else va(w._("{actor} removed the conversation picture.",[w.param("actor",xa)]));});}function na(ua,va){if(ua.author==n.getID()){va(w._("You changed the wallpaper."));}else q.get(ua.author,function(wa){var xa=ra(wa);va(w._("{actor} changed the wallpaper.",[w.param("actor",xa)]));});}function oa(ua,va){va(w._("Couldn't find previous messages."));}function pa(ua,va){var wa=ua.log_message_data,xa=wa.senderId,ya=wa.receiverId,za=xa===n.getID();q.getMulti([xa,ya],function(ab){va(r.createElement(p,r.__spread({},wa,{receiverParticipant:ab[ya],senderParticipant:ab[xa],viewerIsSender:za})));});}function qa(ua){return ra(ua,true);}function ra(ua,va){var wa=ua.fbid,xa=k.constructEndpoint({id:wa});if(ua.href)return (r.createElement("a",{className:"_5wzt",href:ua.href,"data-hovercard":xa},va?ua.short_name:ua.name));return ua.name;}function sa(ua){var va=ua.indexOf(n.getID());if(va>0){var wa=ua.filter(function(xa){return xa!==n.getID();});return [n.getID()].concat(wa);}return ua;}function ta(ua){return ua.log_message_data.event_name==='installing'||ua.log_message_data.event_name==='installed'||ua.log_message_data.event_name==='install_canceled';}},null);
__d("MercuryLogMessage.react",["DOM","Event","ChatVideoCallLink.react","ImmutableObject","MercuryLogMessageRenderer","MercuryLogMessageType","React","VideoCallSupport","cx","emptyFunction","formatDate","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();'use strict';var s=m,t=s.PropTypes,u=m.createClass({displayName:"MercuryLogMessage",propTypes:{maxWidth:t.number,message:t.instanceOf(j).isRequired,onImageLoad:t.func,onVideoCallLinkClick:t.func},getDefaultProps:function(){return {onImageLoad:p};},getInitialState:function(){return {messageText:null};},componentDidMount:function(){this.componentWillReceiveProps(this.props);},componentWillReceiveProps:function(v){k.renderText(v.message,function(w){this.setState({messageText:w});}.bind(this));},shouldComponentUpdate:function(v,w){return (this.state.messageText!=w.messageText||v.maxWidth!==this.props.maxWidth);},componentDidUpdate:function(){var v=m.findDOMNode(this.refs.attachment);k.renderAttachmentLegacy(v,this.props.message);g.scry(v,'img').forEach(function(w){var x=h.listen(w,'load',function(){this.props.onImageLoad(w);x.remove();}.bind(this));}.bind(this));},render:function(){return (m.createElement("div",m.__spread({},this.props,{className:r(this.props.className,"_5ye6"),style:Object.assign({},this.props.style,this._getStyle()),title:q(new Date(this.props.message.timestamp),'g:ia')}),k.renderIcon(this.props.message),m.createElement("div",{className:"_5ye7"},this.state.messageText,this.renderVideoCallLink()),m.createElement("div",{className:"_5ye8",ref:"attachment"})));},renderVideoCallLink:function(){if(this.props.message.log_message_type!==l.VIDEO_CALL||!this.props.onVideoCallLinkClick||!n.isVideoCallSupported())return null;return (m.createElement(i,{message:this.props.message,onClick:this.props.onVideoCallLinkClick}));},_getStyle:function(){return this.props.maxWidth?{maxWidth:this.props.maxWidth}:null;}});e.exports=u;},null);
__d("ChatConversation.react",["ChatDateBreak.react","ChatMessage.react","ImmutableObject","MercuryActionType","MercuryLogMessage.react","P2PNUXRenderer.react","P2PGKValues","React","cx","invariant"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();'use strict';var q=n,r=q.PropTypes,s=1000*60*60,t=n.createClass({displayName:"ChatConversation",propTypes:{maxBubbleWidth:r.number.isRequired,messages:r.arrayOf(r.instanceOf(i)).isRequired,onCallLinkClick:r.func,onImageLoad:r.func,onStickerClick:r.func},componentWillReceiveProps:function(u){p(u.maxBubbleWidth===this.props.maxBubbleWidth);},render:function(){var u=this.props.messages,v=[];for(var w=0;w<u.length;w++){var x=u[w],y=(w>0)?u[w-1]:null;if(x.is_cleared)continue;if(!y||y.is_cleared||x.timestamp-y.timestamp>s)v.push(n.createElement(g,{date:new Date(x.timestamp),key:'db:'+x.message_id}));if(x.action_type==j.LOG_MESSAGE){v.push(n.createElement(k,{className:"_5w0o",key:x.message_id,message:x,onImageLoad:this.props.onImageLoad,onCallLinkClick:this.props.onCallLinkClick}));}else{v.push(n.createElement(h,{key:x.message_id,message:x,maxBubbleWidth:this.props.maxBubbleWidth,onImageLoad:this.props.onImageLoad,onStickerClick:this.props.onStickerClick}));if(!m.WebBubbleV2&&l.isValidNUXMessage(x))v.push(n.createElement(l,{key:'onr_c:'+x.message_id,message:x,onImageLoad:this.props.onImageLoad,type:"chat"}));}}return n.createElement("div",null,v);}});e.exports=t;},null);
__d("MercuryTypingReceiver",["Arbiter","ChannelConstants","MercuryActionType","MercuryIDs","MercuryPayloadSource","MercuryViewer","TypingStates","mixInEventEmitter","setTimeoutAcrossTransitions","MercuryServerRequests"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=b('MercuryServerRequests').get(),q,r={},s=30000,t={};n(t,{'state-changed':true});function u(aa){var ba=r[aa]||{},ca=Object.keys(ba);ca.sort(function(da,ea){return ba[da]-ba[ea];});return ca;}function v(){q=null;var aa=Date.now(),ba={},ca=false;for(var da in r){var ea=false;for(var fa in r[da]||{})if(r[da][fa]<aa-s){delete r[da][fa];ea=true;}else ca=true;if(ea)ba[da]=u(da);}for(var ga in ba){x(ba);break;}if(ca)q=o(v,3000);}function w(aa,ba){if(aa in r)if(ba in r[aa]){delete r[aa][ba];y(aa);}}function x(aa){t.releaseHeldEventType('state-changed');t.emitAndHold('state-changed',aa);}function y(aa){var ba={};ba[aa]=u(aa);x(ba);}function z(aa){if(aa.thread_fbid)return p.getClientThreadIDNow(aa.thread_fbid);if(aa.type==='typ')return j.getThreadIDFromUserID(aa.from);return null;}g.subscribe([h.getArbiterType('typ'),h.getArbiterType('ttyp')],function(aa,ba){var ca=ba.obj,da=z(ca);if(da){var ea=j.getParticipantIDFromUserID(ca.from);if(ca.st==m.TYPING){r[da]=r[da]||{};var fa=r[da][ea];r[da][ea]=Date.now();if(!q)q=o(v,3000);!fa&&y(da);}else if(ca.st==m.INACTIVE)w(da,ea);}});p.subscribe('update-typing-state',function(aa,ba){var ca=ba.payload_source;if(ca!=k.CLIENT_CHANNEL_MESSAGE)return;var da=ba.actions;if(!da||!da.length)return;var ea=i.USER_GENERATED_MESSAGE;da.forEach(function(fa){if(fa.action_type==ea&&fa.author!=l.getID())w(fa.thread_id,fa.author);});});e.exports=t;},null);
__d("MercuryIndicatorController",["ArbiterMixin","DOM","MercuryActionType","MercuryDelayedRoger","MercuryIDs","MercuryMessageSourceTags","MercuryParticipants","MercuryRoger","MercuryTypingReceiver","MercuryViewer","arrayContains","copyProperties","formatDate","removeFromArray","fbt","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){b.__markCompiled&&b.__markCompiled();var v=b('MercuryThreads').get(),w=[];function x(y){this._threadID=y;this._canonicalUser=k.getUserIDFromThreadID(y);w.push(this);}r(x.prototype,g,{destroy:function(){t(w,this);},setLastMessage:function(y){this._lastMsg=y;this._handleStateChange();},_informStateChanged:function(y){if(y.activity=='none'&&this._currentActivity=='none')return;if(this._lastMsg&&p.isViewer(this._lastMsg.author))y.self_authored=true;this._currentActivity=y.activity;this.inform('state-changed',y);},_notifySentFrom:function(){var y,z,aa=this._lastMsg.location_text,ba=this._lastMsg.source_tags||[];if(aa){y=u._("Sent from {location}",[u.param("location",aa)]);z='sentFromMobile';}else if(q(ba,l.MESSENGER)){y=h.create('a',{href:'/mobile/messenger','class':'fcg',target:'_blank'},u._("Sent from Messenger"));z='sentFromMobile';}else if(q(ba,l.MOBILE)){y=h.create('a',{href:'/mobile','class':'fcg',target:'_blank'},u._("Sent from Mobile"));z='sentFromMobile';}else if(q(ba,l.EMAIL)){y=u._("Sent from email");z='sentFromEmail';}else{this._informStateChanged({activity:'none'});return;}this._informStateChanged({activity:z,text:y});},_notifySeenTimestamp:function(y){var z=n.getSeenTimestamp(this._threadID,y[0])*.001,aa=Date.now()*.001,ba;if(z<aa-518400){ba='M j';}else if(z<aa-86400){ba='D g:ia';}else ba='g:ia';this._informStateChanged({activity:'seen-timestamp',text:u._("Seen {timestamp}",[u.param("timestamp",s(z,ba))])});},_nameNormalizer:function(y){var z;m.getMulti(y,function(aa){function ba(da){if(aa[da]!==(void 0)){return aa[da].short_name.toLowerCase();}else return da;}var ca=y.map(ba);z=function(da){var ea=ba(da),fa=ca.indexOf(ea)!==ca.lastIndexOf(ea);return fa?aa[da].name:aa[da].short_name;};});return z;},_notifySeenBy:function(y){var z=this._lastMsg,aa=true;m.getMulti(y,function(ba){aa=false;if(this._lastMsg!=z)return;var ca=v.getThreadMetaNow(this._threadID),da=ca?ca.participants.length:0,ea=y.length+(z.author!=p.getID()),fa,ga=false,ha=da>2&&ea>=da-1,ia;if(ca)ia=this._nameNormalizer(ca.participants);if(!ia)ia=function(ma){return ba[ma].short_name;};if(ha){fa=u._("Seen by everyone");}else if(y.length==1){fa=u._("Seen by {user}",[u.param("user",ba[y[0]].short_name)]);}else if(y.length==2){fa=u._("Seen by {user1}, {user2}",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name)]);}else if(y.length==3){fa=u._("Seen by {user1}, {user2}, {user3}",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name),u.param("user3",ba[y[2]].short_name)]);}else if(y.length>3){var ja=Object.keys(ba).length-2,ka=u._({"*":"{num} more"},[u.param("num",ja,[0])]),la=h.create('span',{className:'more'},ka);fa=u._("Seen by {user1}, {user2}, {=num more link}",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name),u.param("=num more link",la)]);ga=true;}this._informStateChanged({activity:'seen-by',text:fa,seenBy:y,tooltip:ga});}.bind(this));aa&&this._informStateChanged({activity:'none'});},_notifyTyping:function(y){var z=this._lastMsg,aa=true;m.getMulti(y,function(ba){aa=false;if(this._lastMsg!=z)return;var ca=v.getThreadMetaNow(this._threadID),da=ca?ca.participants.length:0,ea;if(ca)ea=this._nameNormalizer(ca.participants);if(!ea)ea=function(ka){return ba[ka].short_name;};var fa,ga=false;if(da>2&&y.length>=da-1){fa=u._("Everyone is typing...");}else if(y.length==1){fa=u._("{name} is typing...",[u.param("name",ba[y[0]].short_name)]);}else if(y.length==2){fa=u._("{user1} and {user2} are typing...",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name)]);}else if(y.length==3){fa=u._("{user1}, {user2} and {user3} are typing...",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name),u.param("user3",ba[y[2]].short_name)]);}else if(y.length>3){var ha=Object.keys(ba).length-2,ia=u._({"*":"{num} more"},[u.param("num",ha,[0])]),ja=h.create('a',{href:'#'},ia);fa=u._("{user1}, {user2} and {=num more link} are typing...",[u.param("user1",ba[y[0]].short_name),u.param("user2",ba[y[1]].short_name),u.param("=num more link",ja)]);ga=true;}this._informStateChanged({activity:'typing',text:fa,typing:y,tooltip:ga});}.bind(this));aa&&this._informStateChanged({activity:'none'});},_handleStateChange:function(){var y=i.LOG_MESSAGE;if(!this._lastMsg||this._lastMsg.action_type==y){this._informStateChanged({activity:'none'});return;}if(this._typing&&this._typing.length){this._notifyTyping(this._typing);return;}if(this._canonicalUser&&this._lastMsg.author!=p.getID()){this._notifySentFrom();return;}var z=j.getSeenBy(this._threadID,true);if(z.length)if(this._canonicalUser){this._notifySeenTimestamp(z);return;}else{this._notifySeenBy(z);return;}this._informStateChanged({activity:'none'});}});o.addRetroactiveListener('state-changed',function(y){w.forEach(function(z){var aa=y[z._threadID];if(aa!==(void 0)){z._typing=aa;z._handleStateChange();}});});j.subscribe('state-changed',function(y,z){w.forEach(function(aa){z[aa._threadID]&&aa._handleStateChange();});});e.exports=x;},null);
__d("MercuryLastMessageIndicator.react",["DOM","MercuryIndicatorController","MercuryParticipants","React","Tooltip","cx","emptyFunction","joinClasses"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=j,p=o.PropTypes,q=j.createClass({displayName:"MercuryLastMessageIndicator",propTypes:{hideTyping:p.bool,indicatorWillShow:p.func,indicatorDidShow:p.func,lastMessage:p.object,threadID:p.string.isRequired},getDefaultProps:function(){return {indicatorWillShow:m,indicatorDidShow:m};},getInitialState:function(){return {data:{}};},componentDidMount:function(){this._setup(this.props);},componentWillReceiveProps:function(r){if(r.threadID!=this.props.threadID){this._destroy();this._setup(r);}else if(r.lastMessage!=this.props.lastMessage)this._controller.setLastMessage(r.lastMessage);},componentWillUpdate:function(r,s){if(this.isVisible(r,s))this.props.indicatorWillShow();},componentDidUpdate:function(){if(!this.isVisible())return;this.setText();this.setTooltip();this.props.indicatorDidShow();},componentWillUnmount:function(){this._destroy();},render:function(){return (j.createElement("div",{className:this.getRootClass()},j.createElement("div",{className:"_510h"}),j.createElement("span",{className:"_510f",ref:"text"}," ")));},getRootClass:function(){var r=(("_510g")+(this.state.data.self_authored?' '+"_510e":'')),s=this.state.data.activity,t=null;if(String(s).startsWith('seen')){t='seen';}else if(s=='typing'){t=this.props.hideTyping?null:s;}else t=s;return n(r,t,this.props.className);},isVisible:function(r,s){r=r||this.props;s=s||this.state;return (s.data&&s.data.activity!='none'&&!(r.hideTyping&&s.data.activity=='typing'));},setText:function(){if(this.state.data.text)g.setContent(j.findDOMNode(this.refs.text),this.state.data.text);},setTooltip:function(){if(this.state.data.activity=='seen-by'&&this.state.data.tooltip)i.getMulti(this.state.data.seenBy,function(r){var s=g.create('div',null,this.state.data.seenBy.map(function(t){return g.create('div',null,r[t].name);}));k.set(g.find(j.findDOMNode(this),'span.more'),s,'above','center');}.bind(this));},_setup:function(r){this._controller=new h(r.threadID);this._subscription=this._controller.subscribe('state-changed',function(s,t){return this.setState({data:t});}.bind(this));r.lastMessage&&this._controller.setLastMessage(r.lastMessage);},_destroy:function(){this._subscription.unsubscribe();this._controller.destroy();}});e.exports=q;},null);
__d("MercuryMessageList",["immutable","LogHistory","Map","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();'use strict';var k=h.getInstance('mercury_message_list');function l(n){this.$MercuryMessageList0=g.List(n||[]);this.$MercuryMessageList1();}l.prototype.append=function(n){var o;this.$MercuryMessageList0=(o=this.$MercuryMessageList0).push.apply(o,n);this.$MercuryMessageList1();m('append',n);};l.prototype.prepend=function(n){var o;this.$MercuryMessageList0=(o=this.$MercuryMessageList0).unshift.apply(o,n);this.$MercuryMessageList1();m('prepend',n);};l.prototype.update=function(n){var o=n.filter(function(p){return this.contains(p);}.bind(this));if(o.length===0)return;this.$MercuryMessageList0=this.$MercuryMessageList0.withMutations(function(p){o.forEach(function(q){var r=this.$MercuryMessageList2.get(q.message_id);if(r!==(void 0))p.set(r,q);}.bind(this));}.bind(this));m('update',o);};l.prototype.reorder=function(n){this.$MercuryMessageList0=g.List(n);this.$MercuryMessageList1();m('reorder',n);};l.prototype.hasReachedClearedMessages=function(){var n=this.$MercuryMessageList0.first();return !!(n&&n.is_cleared);};l.prototype.at=function(n){return this.$MercuryMessageList0.get(n);};l.prototype.contains=function(n){return this.$MercuryMessageList2.has(n.message_id);};l.prototype.toArray=function(){return this.$MercuryMessageList0.toArray();};l.prototype.toMap=function(){return new i(g.Seq(this.$MercuryMessageList0).map(function(n){return [n.message_id,n];}));};l.prototype.$MercuryMessageList1=function(){this.$MercuryMessageList2=new i(g.Seq(this.$MercuryMessageList0).map(function(n,o){return [n.message_id,o];}));};function m(event,n){j(function(){k.debug(event,{messageIDs:n.map(function(o){return o.message_id;})});},0);}e.exports=l;},null);
__d("MercuryMessageStore",["MercuryAPIArgsSource","LogHistory","MercuryViewer","MercuryMessageList","SubscriptionsHandler","MercuryThreadlistConstants","copyProperties","merge","mixInEventEmitter","setTimeoutAcrossTransitions","MercuryMessages","MercuryThreadInformer","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();'use strict';var q=b('MercuryMessages').get(),r=b('MercuryThreadInformer').get(),s=b('MercuryThreads').get(),t=h.getInstance('mercury_message_store');function u(w,x){this.$MercuryMessageStore0=w;this.$MercuryMessageStore1=new j();this.$MercuryMessageStore2=1;this.$MercuryMessageStore3=null;this.$MercuryMessageStore4=0;this.$MercuryMessageStore5=x||l.RECENT_MESSAGES_LIMIT;this.$MercuryMessageStore6=new k();this.$MercuryMessageStore6.addSubscriptions(r.subscribe('messages-received',function(y,z){return this.$MercuryMessageStore8(z);}.bind(this)),r.subscribe('messages-updated',function(y,z){return z[this.$MercuryMessageStore0]&&this.$MercuryMessageStore9(z[this.$MercuryMessageStore0]);}.bind(this)),r.subscribe('messages-reordered',function(y,z){return z[this.$MercuryMessageStore0]&&this.$MercuryMessageStorea();}.bind(this)));t.debug('constructed',{threadID:this.$MercuryMessageStore0});this.$MercuryMessageStoreb();}u.prototype.setNewThreadID=function(w){this.$MercuryMessageStorec=w;};u.prototype.destroy=function(){this.$MercuryMessageStore6&&this.$MercuryMessageStore6.release();t.debug('destroyed',{threadID:this.$MercuryMessageStore0});};u.prototype.subscribe=function(w){return this.addRetroactiveListener('updated',w);};u.prototype.fetchMoreMessages=function(){if(q.hasLoadedExactlyNMessages(this.$MercuryMessageStore0,this.$MercuryMessageStore4)&&q.hasLoadedAllMessages(this.$MercuryMessageStore0))return false;if(s.isNewEmptyLocalThread(this.$MercuryMessageStore0))return false;if(this.$MercuryMessageStore1.hasReachedClearedMessages())return false;return this.$MercuryMessageStoreb();};u.prototype.$MercuryMessageStoreb=function(){var w=this.$MercuryMessageStore4+this.$MercuryMessageStore5*this.$MercuryMessageStore2;t.debug('fetching',{threadID:this.$MercuryMessageStore0,limit:w});q.getThreadMessagesRange(this.$MercuryMessageStore0,0,w,this.$MercuryMessageStored.bind(this),null,g.MERCURY);if(this.$MercuryMessageStore2<10)this.$MercuryMessageStore2+=1;if(q.hasLoadedNMessages(this.$MercuryMessageStore0,w)){this.$MercuryMessageStorea();return false;}return true;};u.prototype.$MercuryMessageStored=function(w){if(w&&w.length){this.$MercuryMessageStore3=w[0].timestamp;this.$MercuryMessageStore4=w.length;t.debug('fetched',{threadID:this.$MercuryMessageStore0,earliestMessageTimestamp:this.$MercuryMessageStore3,count:this.$MercuryMessageStore4});}else if(w&&!w.length&&!this.$MercuryMessageStore4)this.$MercuryMessageStoree(u.THREAD_IS_EMPTY);};u.prototype.$MercuryMessageStore8=function(w){var x=[],y=w[this.$MercuryMessageStore0];if(y&&y.length)x=x.concat(y);if(this.$MercuryMessageStorec){var z=w[this.$MercuryMessageStorec];if(z&&z.length){x=x.concat(z);this.$MercuryMessageStorec=null;}}if(x.length){this.$MercuryMessageStore1.append(x);this.$MercuryMessageStore4+=x.length;var aa=x.every(function(ba){return ba.author!=i.getID();});this.$MercuryMessageStoree(u.MESSAGES_RECEIVED,{allFromOthers:aa});}};u.prototype.$MercuryMessageStore9=function(w){this.$MercuryMessageStore1.update(q.getMessagesFromIDs(Object.keys(w)));this.$MercuryMessageStoref();this.$MercuryMessageStoree(u.MESSAGES_CHANGED);};u.prototype.$MercuryMessageStorea=function(){if(!this.$MercuryMessageStore3)return;this.$MercuryMessageStore1.reorder(q.getThreadMessagesSinceTimestamp(this.$MercuryMessageStore0,this.$MercuryMessageStore3));this.$MercuryMessageStoref();this.$MercuryMessageStoree(u.MESSAGES_REORDERED);};u.prototype.$MercuryMessageStoree=function(w,x){var y=this.$MercuryMessageStore1.toArray();this.releaseHeldEventType('updated');this.emitAndHold('updated',n({messages:y,eventType:w},x));v(this.$MercuryMessageStore0,w,y);};u.prototype.$MercuryMessageStoref=function(){var w=this.$MercuryMessageStore1.at(0);if(w)this.$MercuryMessageStore3=w.timestamp;};function v(w,x,y){p(function(){t.debug('update:'+x,{threadID:w,messageIDs:y.map(function(z){return z.message_id;})});},0);}m(u,{MESSAGES_FETCHED:'fetched',MESSAGES_CHANGED:'changed',MESSAGES_RECEIVED:'received',MESSAGES_REORDERED:'reordered',THREAD_IS_EMPTY:'thread-is-empty'});o(u,{updated:true});e.exports=u;},null);
__d("ChatTabMessagesView",["Animation","Arbiter","ArbiterMixin","BanzaiLogger","BootloadedComponent.react","Bootloader","ChatConfig","ChatConversation.react","ChatWelcomeMessage","CSS","DOM","Event","MercuryLastMessageIndicator.react","LiveTimer","MercuryViewer","MercuryMessageStore","React","ServerTime","StickerActions","StickerState","StickerStoreController","Style","SubscriptionsHandler","UserAgent_DEPRECATED","arrayContains","copyProperties","getElementPosition","throttle"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha){b.__markCompiled&&b.__markCompiled();'use strict';var ia=70,ja=null,ka=20;function la(na){if(ja===null){var oa=na.childNodes[0];ba.set(na,'overflow','scroll');ja=oa.clientWidth-ia;ba.set(na,'overflow','');}return ja;}function ma(na,oa,pa,qa,ra,sa,ta,ua){this.loadingIcon=ra;this.threadID=na;this.sheetController=oa;this.scrollContainer=pa;this.conversationElem=qa;this.tabView=ua;t.restart(x.get()/1000);this._loadingMoreMessages=false;function va(){ma.inform('interaction-with-tab',na);}this._subscriptions=new ca();this._subscriptions.addSubscriptions(h.subscribe('overflow-applied-to-body',this.scrollToBottom.bind(this)),r.listen(this.scrollContainer,'mousedown',va));if(da.firefox()){var wa=('WheelEvent' in window)?'wheel':'DOMMouseScroll';this.scrollContainer.addEventListener(wa,va,false);}else this._subscriptions.addSubscriptions(r.listen(this.scrollContainer,'mousewheel',va));this._subscriptions.addSubscriptions(r.listen(this.scrollContainer,'scroll',ha(this.scrolling,50,this)));if(m.get('chat_react')){var xa;w.render(w.createElement(k,{bootloadPlaceholder:w.createElement("span",null),bootloadComponent:function(za){l.loadModules(["ChatTypingIndicators.react"],za);},threadID:this.threadID,indicatorsWillShow:function(){return xa=this.isScrolledToBottom();}.bind(this),indicatorsDidShow:function(){return xa&&this.scrollToBottom(true);}.bind(this)}),ta);}else l.loadModules(["MercuryTypingIndicator"],function(za){this.typingIndicator=new za(this.threadID,ta,this);}.bind(this));var ya;this.lastMessageIndicatorNode=sa;this.lastMessageIndicator=w.render(w.createElement(s,{threadID:this.threadID,hideTyping:true,indicatorWillShow:function(){return ya=this.isScrolledToBottom();}.bind(this),indicatorDidShow:function(){return ya&&this.scrollToBottom(true);}.bind(this)}),this.lastMessageIndicatorNode);this.initializeConversation();}fa(ma,i);fa(ma.prototype,{initializeConversation:function(){this._store=new v(this.threadID);this._conversation=w.render(w.createElement(n,{maxBubbleWidth:la(this.scrollContainer),messages:[],onImageLoad:function(na){var oa=this.scrollContainer,pa=oa.scrollTop+oa.clientHeight;if(pa+na.offsetHeight>=oa.scrollHeight)this.scrollToBottom();}.bind(this),onStickerClick:this._onStickerClick.bind(this),onCallLinkClick:function(na,oa,pa){ma.inform('video-call-clicked',{userID:na,threadID:oa,clickSource:pa});}}),this.conversationElem);this._subscriptions.addSubscriptions(this._store.subscribe(function(na){if(na.eventType==v.MESSAGES_RECEIVED&&na.allFromOthers&&!this.isScrolledToBottom()){this.sheetController.openNewMessagesSheet();this._newMessagesSheetOpened=true;}if(na.eventType==v.MESSAGES_REORDERED){this._loadingMoreMessages=false;p.hide(this.loadingIcon);}var oa=this.isScrolledToBottom(),pa=this._getLoadingHeight(),qa=this.scrollContainer.scrollHeight,ra=this.scrollContainer.scrollTop,sa=na.messages,ta=o.getWelcomeMessage(this.threadID);if(ta)sa.push(ta);this._conversation.setProps({messages:sa},function(){if(oa||this._shouldScrollToBottom){this.scrollToBottom();this.setShouldScrollToBottom(false);}else if(na.eventType==v.MESSAGES_REORDERED)this.scrollToPosition(this.scrollContainer.scrollHeight-qa-pa+ra);}.bind(this));this.lastMessageIndicator.setProps({lastMessage:sa.length>0?sa[sa.length-1]:null});if(na.eventType==v.MESSAGES_RECEIVED&&this._shouldShowStickerReplyNUX(sa)&&this.tabView&&this.tabView.isFocused())this.tabView.showStickerReplyNUX();if(na.eventType==v.MESSAGES_CHANGED)this._checkToAnimateSticker();}.bind(this)));},setShouldScrollToBottom:function(na){this._shouldScrollToBottom=na;},scrolling:function(){this._checkToAnimateSticker();if(this.isScrolledNearTop()&&!this._loadingMoreMessages&&!this.isScrolledToBottom()&&!this.tabView._isDragDropActive)if(this._store.fetchMoreMessages()){p.show(this.loadingIcon);this._loadingMoreMessages=true;}if(!this._newMessagesSheetOpened)return;if(this.isScrolledToBottom()){this.sheetController.closeNewMessagesSheet();this._newMessagesSheetOpened=false;}},getScrollTop:function(){return this.scrollContainer&&this.scrollContainer.scrollTop;},destroy:function(){q.scry(this.conversationElem,'.stickerContainer').forEach(function(na){return w.unmountComponentAtNode(na);});w.unmountComponentAtNode(this.conversationElem);this._subscriptions&&this._subscriptions.release();w.unmountComponentAtNode(this.lastMessageIndicatorNode);delete this.lastMessageIndicator;this._store&&this._store.destroy();this.destroyed=true;},_getLoadingHeight:function(){return this.loadingHeight||this.loadingIcon.clientHeight;},_shouldShowStickerReplyNUX:function(na){if(!z.shouldShowStickerReplyNUX()||!na.length)return false;var oa=na[na.length-1];if(oa.author===u.getID())return false;if(oa.has_attachment)return oa.attachments.some(function(pa){return pa.attach_type==='sticker';});return false;},isScrolledToBottom:function(na){var oa=this.scrollContainer;na=na||ka;return oa.scrollTop+oa.clientHeight>=oa.scrollHeight-na;},isScrolledNearTop:function(){return this.scrollContainer.scrollTop<this.scrollContainer.clientHeight;},scrollToBottom:function(na){this.scrollToPosition(this.scrollContainer.scrollHeight,na);},scrollToPosition:function(na,oa){this._scrollTopAnimation&&this._scrollTopAnimation.stop();if(oa===true){this._scrollTopAnimation=(new g(this.scrollContainer)).to('scrollTop',na).ease(g.ease.end).duration(400).go();}else this.scrollContainer.scrollTop=na;},_onStickerClick:function(na,oa){if(!na)return;j.log('StickersLoggerConfig',{event:'click_sticker',packid:na,stickerid:oa});var pa=this.tabView;z.onTrayDataReady(function(){if(ea(z.getPackIDsInTray(),na)){var qa=z.getPack(na);if(qa&&qa.isPromoted)y.addPack(na);pa.setStickersFlyoutPackID(na);}else aa.showStore(na);});},_checkToAnimateSticker:function(){var na=ga(this.scrollContainer);h.inform('chatScrolled/'+this.threadID,{scrollTop:this.scrollContainer.scrollTop,top:na.y,viewHeight:na.height});},setNewThreadID:function(na){this._store.setNewThreadID(na);}});e.exports=ma;},null);
__d("ChatTabOfficeStatus",["fbt","formatDate","CSS"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j=1,k=2,l=3,m={update:function(n,o){if(!n||!o||!o.officeStatus)return;this._updateIcon(n,o);this._updateTooltip(n,o);},_updateIcon:function(n,o){i.removeClass(n,'officeStatusNone');i.removeClass(n,'officeStatusAvailable');i.removeClass(n,'officeStatusSporadic');i.removeClass(n,'officeStatusOutOfOffice');switch(o.officeStatus){case j:i.addClass(n,'officeStatusAvailable');break;case k:i.addClass(n,'officeStatusSporadic');break;case l:i.addClass(n,'officeStatusOutOfOffice');break;default:i.addClass(n,'officeStatusNone');break;}},_updateTooltip:function(n,o){var p='';switch(o.officeStatus){case j:p+=g._("AVAILABLE");p+='\n';break;case k:p+=g._("SPORADIC");p+='\n';break;case l:p+=g._("OFF THE GRID");p+='\n';break;default:p+=g._("UNKNOWN");p+='\n';break;}if(o.officeStatusComment)p+=o.officeStatusComment;if(o.officeStatusLocation)p+=' ('+o.officeStatusLocation+')';if(o.officeStatusComment||o.officeStatusLocation)p+='\n';if(o.officeStatusEndDate){var q=h(o.officeStatusEndDate,'M d, Y');p+=g._("Until {date}",[g.param("date",q)]);}n.setAttribute('aria-label',p);n.setAttribute('data-hover','tooltip');}};e.exports=m;},null);
__d("ChatTabTypeaheadRenderer",["DOM","CompactTypeaheadRenderer","MercuryTypeaheadConstants","MercuryThreadMetadataRawRenderer","TypeaheadFacepile"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();function l(n,o){switch(n.type){case i.USER_TYPE:case i.PAGE_TYPE:return h(n,o);case i.THREAD_TYPE:return m(n,o);default:return g.create('div');}}function m(n,o){var p=[],q=n.mercury_thread;if(q.image_src){p.push(g.create('img',{alt:'',src:q.image_src}));}else{var r=n.participants_to_render.map(function(u){return u.big_image_src||u.image_src;});if(r){if(r instanceof Array){r=k.render(r);}else r=g.create('img',{alt:'',src:r});p.push(r);}}var s=q.name,t=j.renderRawParticipantList(q.thread_id,n.participants_to_render,q.participants.length,{names_renderer:j.renderShortNames});p.push(g.create('span',{className:'timestamp'},q.timestamp_relative));p.push(g.create('span',{className:'text'},s));p.push(g.create('span',{className:'subtext'},t));return g.create('li',{className:'node'},p);}l.className='compact';e.exports=l;},null);
__d("MercuryTypeahead",["Event","ArbiterMixin","DOM","DOMDimensions","Input","Keys","MercuryTypeaheadTemplates","Tokenizer","Typeahead","TypeaheadCore","copyProperties","cx"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();var s=function(t,u){this._domElement=null;this._typeahead=null;this._tokenizer=null;this._placeholder='';this._exclusions=[];this._viewNodeOrID=null;this._viewOptions={renderer:'compact',autoSelect:true};this._tokenizerBehaviors=[];this._heightPrev=null;this._dataSource=t;this._view=u;};q(s.prototype,h);q(s.prototype,{setPlaceholder:function(t){this._placeholder=t;return this;},setExcludedParticipantsFromThreadMeta:function(t){if(!t)return;if(!t.former_participants){this.setExcludedParticipants(t.participants);return;}var u=t.former_participants.filter(function(v){return v.is_friend===false;}).map(function(v){return v.id;});this.setExcludedParticipants(u.concat(t.participants));},setExcludedParticipants:function(t){this._exclusions=[];t.forEach(function(u){var v=u.indexOf(':');if(u.substr(0,v)=='fbid')this._exclusions.push(u.substr(v+1));}.bind(this));return this;},setViewNodeID:function(t){this._viewNodeOrID=t;},setViewNode:function(t){this._viewNodeOrID=t;},setFullWidthView:function(t){var u=i.create('div',{className:"_4ck uiTypeaheadView"});i.setContent(t,u);this.setViewNode(u);},setViewOption:function(t,u){this._viewOptions[t]=u;},addTokenizerBehavior:function(t){this._tokenizerBehaviors.push(t);},build:function(t){if(this._domElement)return;var u=m[':fb:mercury:tokenizer'].build(),v=m[':fb:mercury:typeahead'].build();this._domElement=u.getRoot();i.appendContent(this._domElement,v.getRoot());var w=v.getNode('textfield');k.setPlaceholder(w,this._placeholder);w.setAttribute('data-placeholder',this._placeholder);this._input=w;var x={node_id:this._viewNodeOrID,ctor:this._view,options:this._viewOptions},y={ctor:p,options:{setValueOnSelect:true}};this._typeahead=new o(this._dataSource,x,y,v.getRoot());this._typeahead.init();var z={inline:true,behaviors:this._tokenizerBehaviors};this._tokenizer=new n(this._domElement,this._typeahead);this._tokenizer.init(u.getNode('tokenarea'),'participants',[],z);this._tokenizer.subscribe(['addToken','removeToken','removeAllTokens'],this._tokensChanged.bind(this));this._tokenizer.subscribe('resize',function(){this.inform('resize');}.bind(this));g.listen(w,'focus',function(){this._resetDataSource();this._typeahead.init();}.bind(this));g.listen(this._domElement,'click',this.focus.bind(this));g.listen(w,'keydown',this.keydown.bind(this));this._heightPrev=j.getElementDimensions(this._domElement).height;},getElement:function(){return this._domElement;},getSelectedParticipantIDs:function(){var t=[];if(this._tokenizer)(this._tokenizer.getTokenValues()||[]).forEach(function(u){t.push('fbid:'+u);});return t;},getTokens:function(){var t=[];if(this._tokenizer)t=this._tokenizer.getTokens();return t;},getTokenizer:function(){return this._tokenizer;},keydown:function(event){if(this._tokenizer.inline&&event.keyCode==l.ESC){if(k.isEmpty(this._input)){var t=this._tokenizer.getLastToken();if(t&&t.isRemovable())this._tokenizer.removeToken(t);}else this._typeahead.getCore().reset();return false;}if(k.isEmpty(this._input)&&this._tokenizer.inline&&event.keyCode===l.RETURN){event.preventDefault();return this.inform('tokens-return');}},reset:function(){this._tokenizer&&this._tokenizer.removeAllTokens();this._typeahead&&this._typeahead.getCore().reset();},focus:function(){this._tokenizer&&this._tokenizer.focusInput();},getTypeahead:function(){return this._typeahead;},_resetDataSource:function(){this._dataSource.setExclusions(this._exclusions);},_tokensChanged:function(){this.inform('tokens-changed');}});e.exports=s;},null);
__d("ChatAddFriendsTabSheetRawRenderer",["ChatConfig","ChatTabTypeaheadRenderer","ContextualTypeaheadView","DOM","Event","MercuryConfig","MercuryDataSourceWrapper","MercuryTypeahead","ChatTabTemplates","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q={render:function(r,s,t,u,v,w){var x=w?o[':fb:mercury:chat:tab-sheet:add-friends-empty-tab'].build():o[':fb:mercury:chat:tab-sheet:add-friends'].build(),y={};if(l.MercuryDataSourceProcessor){y=w?m.chat_typeahead_source:m.chat_add_people_source;y.setShowThreads(w);}else if(w){y=m.source;}else y=m.add_people_source;var z=new n(y,i);z.setViewOption('renderer',h);z.setExcludedParticipantsFromThreadMeta(u);if(!w){var aa=g.get('IsWorkUser',false)?p._("Add colleagues to this chat"):p._("Add friends to this chat");z.setPlaceholder(aa);}z.build();j.replace(x.getNode('participantsTypeahead'),z.getElement());j.setContent(t,x.getRoot());z.getTokenizer().adjustWidth();var ba=x.getNode('participantsTypeahead').getAttribute('data-labelid'),ca=j.scry(z.getElement(),'input[type="text"]')[0];if(ca)if(ba){ca.setAttribute('aria-labelledby',ba);}else ca.setAttribute('aria-label',p._("To"));z.focus();if(!w){var da=function(){var ea=z.getSelectedParticipantIDs();if(ea.length)v(ea);s.close(r);};k.listen(x.getNode('doneButton'),'click',da);z.subscribe('tokens-return',function(){if(z.getTokens().length)da();});}return z;}};e.exports=q;},null);
__d("MultiChatController",["AsyncSignal","ChatOpenTab","copyProperties","Form","MercuryIDs","MercuryLocalIDs","MercuryServerRequests","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=b('MercuryServerRequests').get(),n=b('MercuryThreads').get();function o(){}i(o,{subscribe:function(p,q){p.subscribe('confirm',function(){this.createGroupThreadFromChooserDialog(p,q);}.bind(this));},createGroupThreadFromChooserDialog:function(p,q){var r=j.serialize(p.getRoot()),s=JSON.parse(r.profileChooserItems),t=[];for(var u in s)if(s[u])t.push(u);var v=o.createThreadForFBIDs(t);m.subscribe('update-thread-ids',function(w,x){for(var y in x)if(x[y]==v)new g('/ajax/groups/chat/log',{group_id:q,message_id:y}).send();});p.hide();},createThreadForTokens:function(p){if(!p.length)return;var q=p.length===1?k.getThreadIDFromUserID(p[0].split(':')[1]):l.generateThreadID();n.createNewLocalThread(q,p);h.openThread(q,'MultiChatController');},createThreadForFBIDs:function(p){var q=[];for(var r=0;r<p.length;r++)q.push("fbid:"+p[r]);return o.createThreadForTokens(q);}});e.exports=o;},null);
__d("ChatAddFriendsTabSheet",["ArbiterMixin","BanzaiLogger","ChatAddFriendsTabSheetRawRenderer","ChatConfig","ChatOpenTab","ChatTabActions","MercuryConfig","MercuryLogMessageType","MercurySourceType","MercuryTypeaheadConstants","MultiChatController","Style","copyProperties","MercuryMessageObject","MercuryMessageActions","MercuryThreadActions","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t=b('MercuryMessageObject').get(),u=b('MercuryMessageActions').get(),v=b('MercuryThreadActions').get(),w=b('MercuryThreads').get();function x(ba,ca,da,ea){this._threadID=ba;this._rootElement=ca;this._sheetView=da;this._typeahead=null;this._chatTabView=ea;}s(x.prototype,g,{render:function(){w.getThreadMeta(this._threadID,function(ba){var ca=ba.is_canonical_user?y:z,da=w.isNewEmptyLocalThread(this._threadID);this._typeahead=i.render(this,this._sheetView,this._rootElement,ba,ca.bind(null,ba),da);this._typeahead.subscribe('tokens-changed',function(){if(m.MercuryDataSourceProcessor){if(da)aa(this,this._typeahead,this._threadID,this._chatTabView);}else this.inform('chat/tokens-changed',{token_count:this._typeahead.getTokens().length});}.bind(this));this._typeahead.subscribe('resize',function(){this._sheetView.resize();}.bind(this));}.bind(this));},getParticipants:function(){if(!this._typeahead)return null;return this._typeahead.getSelectedParticipantIDs();},isPermanent:function(){return true;},isSheetWithInput:function(){return true;},getType:function(){return 'add_friends_type';},open:function(){this._sheetView.open(this);},close:function(){this._sheetView.close(this);},getHeight:function(){return r.get(this._rootElement,'height');}});function y(ba,ca){var da=ba.participants;q.createThreadForTokens(da.concat(ca));}function z(ba,ca){var da=ba.thread_id;if(w.isEmptyLocalThread(da)){v.addParticipants(da,ca);}else u.send(t.constructLogMessageObject(o.CHAT_WEB,da,n.SUBSCRIBE,{added_participants:ca}));k.openThread(da,'ChatAddFriendsTabSheet');}function aa(ba,ca,da,ea){var fa=ca.getTypeahead().getData(),ga=ca.getTokens(),ha=ca.getTypeahead().getCore();ha.getElement().removeAttribute('disabled');fa.setShowThreads(ga.length===0);var ia=ga.length==1&&ga[0].getInfo().render_type===p.THREAD_TYPE;if(ia){var ja=ga[0].getInfo().mercury_thread;if(ja){var ka=j.get('chat_react_share_uploader')?ea._sharePreview.getShareData():ea._shareLinkUploader.getShareData();if(ka)var la=j.get('chat_react_share_uploader')?function(ma){return ma.loadShareFromParams(ka.share_type,ka.share_params);}:function(ma){return ma.loadShareFromParams(ka.type,ka.params);};k.openThread(ja.thread_fbid,'openGroupChat','',la);}h.log('MercuryQueryResultsLoggerConfig',{event:'chat_tab_group_thread_click'});l.closeTab(da,'open_group_chat');}else{if(ga.length==1&&ga[0].getInfo().render_type===p.PAGE_TYPE)ha.getElement().setAttribute('disabled','disabled');h.log('MercuryQueryResultsLoggerConfig',{event:'chat_tab_tokens_changed',chat_tab_tokens:ga.map(function(ma){return ma.info.uid;})});ba.inform('chat/tokens-changed',{token_count:ga.length});}}e.exports=x;},null);
__d("ChatNameConversationTabSheetRawRenderer",["DOM","Event","Input","Keys","ChatTabTemplates","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();"use strict";var m={render:function(n,o,p,q,r,s){var t=k[':fb:mercury:chat:tab-sheet:name-conversation'].build(),u=t.getNode('nameInput'),v=t.getNode('doneButton'),w=l._("Done"),x=l._("Hide"),y=q.name;if(y){i.setValue(u,y);}else g.setContent(v,x);var z=function(){var aa=i.getValue(u);if(aa)r(aa);s();o.close(n);};h.listen(u,'input',function(){g.setContent(v,i.getValue(u).length===0?x:w);});h.listen(v,'click',z);h.listen(u,'keyup',function(aa){if(aa.keyCode===j.RETURN){z();return false;}});g.setContent(p,t.getRoot());!n.isAutomatic()&&u.focus();}};e.exports=m;},null);
__d("ChatNameConversationTabSheet",["AsyncRequest","ChatNameConversationTabSheetRawRenderer","MercuryAPIArgsSource","MercuryLogMessageType","MercurySourceType","MercuryMessageObject","MercuryMessageActions","MercuryServerRequests","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=b('MercuryMessageObject').get(),m=b('MercuryMessageActions').get(),n=b('MercuryServerRequests').get(),o=b('MercuryThreads').get(),p='/ajax/chat/multichat/name_conversation/dismiss.php',q={};function r(s,t,u){"use strict";this.$ChatNameConversationTabSheet0=s;this.$ChatNameConversationTabSheet1=t;this.$ChatNameConversationTabSheet2=u;this.$ChatNameConversationTabSheet3=false;}r.prototype.render=function(){"use strict";o.getThreadMeta(this.$ChatNameConversationTabSheet0,function(s){h.render(this,this.$ChatNameConversationTabSheet2,this.$ChatNameConversationTabSheet1,s,this.$ChatNameConversationTabSheet4.bind(null,s),this.$ChatNameConversationTabSheet5.bind(this,s));this.$ChatNameConversationTabSheet2.resize();}.bind(this));};r.prototype.isPermanent=function(){"use strict";return true;};r.prototype.isSheetWithInput=function(){"use strict";return true;};r.prototype.getType=function(){"use strict";return 'name_conversation_type';};r.prototype.open=function(s){"use strict";this.$ChatNameConversationTabSheet3=s;if(!(this.$ChatNameConversationTabSheet3&&this.$ChatNameConversationTabSheet6()))this.$ChatNameConversationTabSheet2.open(this);};r.prototype.close=function(){"use strict";this.$ChatNameConversationTabSheet2.close(this);};r.prototype.isAutomatic=function(){"use strict";return this.$ChatNameConversationTabSheet3;};r.prototype.$ChatNameConversationTabSheet6=function(){"use strict";return !!q[this.$ChatNameConversationTabSheet0];};r.prototype.$ChatNameConversationTabSheet7=function(){"use strict";q[this.$ChatNameConversationTabSheet0]=true;};r.prototype.$ChatNameConversationTabSheet5=function(s){"use strict";if(!s.name_conversation_sheet_dismissed||!this.$ChatNameConversationTabSheet6()){this.$ChatNameConversationTabSheet7();n.getServerThreadID(s.thread_id,function(t){new g(p).setData({thread_fbid:t}).send();});}};r.prototype.$ChatNameConversationTabSheet4=function(s,t){"use strict";var u=s.name;if((t||u)&&(t!=u))m.send(l.constructLogMessageObject(k.CHAT_WEB,s.thread_id,j.THREAD_NAME,{name:t}),null,i.CHAT);};e.exports=r;},null);
__d("ChatNewMessagesTabSheet",["Event","ArbiterMixin","DOM","ChatTabTemplates","copyProperties","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();function m(n,o,p){this._threadID=n;this._rootElement=o;this._sheetView=p;}k(m.prototype,h,{render:function(){var n=j[':fb:mercury:chat:tab-sheet:clickable-message-icon-sheet'].build();i.setContent(n.getNode('text'),l._("Scroll down to see new messages."));i.setContent(this._rootElement,n.getRoot());g.listen(n.getRoot(),'click',function(){this.inform('clicked',this._threadID);}.bind(this));},isPermanent:function(){return true;},isSheetWithInput:function(){return true;},getType:function(){return 'new_messages_type';},open:function(){this._sheetView.open(this);},close:function(){this._sheetView.close(this);}});e.exports=m;},null);
__d("ChatNoRecipientsTabSheet",["DOM","MercuryViewer","ChatTabTemplates","copyProperties","fbt","MercuryThreads","MercuryThreadInformer"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();var l=b('MercuryThreads').get(),m=b('MercuryThreadInformer').get();function n(o,p,q){this._threadID=o;this._rootElement=p;this._sheetView=q;m.subscribe('threads-updated',this._handleThreadsUpdated.bind(this));}j(n.prototype,{render:function(){var o=i[':fb:mercury:chat:tab-sheet:message-icon-sheet'].build();g.setContent(o.getNode('text'),k._("Everyone has left the conversation."));g.setContent(this._rootElement,o.getRoot());},isPermanent:function(){return true;},getType:function(){return 'no_recipients_type';},_handleThreadsUpdated:function(){l.getThreadMeta(this._threadID,function(o){var p=h.getID(),q=o.participants.filter(function(r){return r!=p;});if(q.length<1&&!l.isNewEmptyLocalThread(this._threadID)){this._sheetView.open(this);}else this._sheetView.close(this);}.bind(this));}});e.exports=n;},null);
__d("ChatOfflineTabSheet",["ChatPrivacyActionController","ChatVisibility","CSS","DOM","JSXDOM","Event","JSLogger","MercuryIDs","MercuryParticipants","ChatTabTemplates","WorkModeConfig","copyProperties","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();function u(v,w,x){this._rootElement=w;this._sheetView=x;this._logger=m.create('blackbird');this._canonicalUser=n.getUserIDFromThreadID(v);if(this._canonicalUser)this._privacyActionController=new g(this._canonicalUser,this._handlePrivacyChange.bind(this));}r(u.prototype,{render:function(){if(!this._canonicalUser){this._logger.error('offline_sheet_open_with_non_friend');return;}var v=p[':fb:mercury:chat:tab-sheet:message-icon-sheet'].build(),w='fbid:'+this._canonicalUser;o.get(w,function(x){var y='fbChatGoOnlineLink',z=k.a({href:"#",className:y},t._("turn on chat")),aa;if(q.is_work_user){aa=t._("To chat with {name} and other colleagues, {link}.",[t.param("name",x.short_name),t.param("link",z)]);}else aa=t._("To chat with {name} and other friends, {link}.",[t.param("name",x.short_name),t.param("link",z)]);j.setContent(v.getNode('text'),aa);i.addClass(v.getRoot(),"_1sk1");j.setContent(this._rootElement,v.getRoot());l.listen(this._rootElement,'click',function(event){if(i.hasClass(event.getTarget(),y)){if(h.isOnline())this._logger.error('tab_sheet_already_online');this._privacyActionController.togglePrivacy();this._logger.log('tab_sheet_go_online',{tab_id:this._canonicalUser});return false;}}.bind(this));this._sheetView.resize();}.bind(this));},_handlePrivacyChange:function(v){if(!this._canonicalUser)this._logger.error('user_blocked_sheet_privacy_changed_non_friend');switch(v){case g.OFFLINE:this._sheetView.open(this);break;case g.NORMAL:case g.BLOCKED:this._sheetView.close(this);break;}},isPermanent:function(){return true;},getType:function(){return 'offline_type';},destroy:function(){this._privacyActionController&&this._privacyActionController.destroy();}});e.exports=u;},null);
__d("ChatUploadWarningTabSheet",["DOM","ChatTabTemplates","fbt","copyProperties"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();function k(l,m,n){this._threadID=l;this._rootElement=m;this._sheetView=n;}j(k.prototype,{render:function(){var l=h[':fb:mercury:chat:tab-sheet:message-icon-sheet'].build();g.setContent(l.getNode('text'),i._("Please wait until the upload is complete before you send your message."));g.setContent(this._rootElement,l.getRoot());},isPermanent:function(){return false;},getType:function(){return 'upload_warning_type';},open:function(){this._sheetView.open(this);},close:function(){this._sheetView.close(this);}});e.exports=k;},null);
__d("MercuryReadOnlyReason",["React","fbt"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i={getReason:function(j){if(j.has_email_participant){return (h._("Sorry, this conversation is no longer active because messages can no longer be sent to email addresses. Messages sent to facebook.com email addresses will now be forwarded to primary email addresses, so you can continue this conversation by email. {Learn more}.",[h.param("Learn more",g.createElement("a",{href:"/help/224049364288051"},h._("Learn more")))]));}else return (h._("You cannot reply to this conversation."));}};e.exports=i;},null);
__d("ChatReadOnlyTabSheet",["React","MercuryReadOnlyReason","cx","MercuryThreads"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=b('MercuryThreads').get();function k(l,m,n){"use strict";this.$ChatReadOnlyTabSheet0=l;this.$ChatReadOnlyTabSheet1=m;this.$ChatReadOnlyTabSheet2=n;}k.prototype.render=function(){"use strict";var l=h.getReason(j.getThreadMetaNow(this.$ChatReadOnlyTabSheet0));g.render(g.createElement("div",{className:"_87-"},l),this.$ChatReadOnlyTabSheet1);};k.prototype.isPermanent=function(){"use strict";return false;};k.prototype.getType=function(){"use strict";return 'chat-thread-is-read-only';};k.prototype.open=function(){"use strict";this.$ChatReadOnlyTabSheet2.open(this);};k.prototype.close=function(){"use strict";this.$ChatReadOnlyTabSheet2.open(this);};e.exports=k;},null);
__d("ChatThreadIsMutedTabSheet",["Event","ArbiterMixin","DOM","ChatTabTemplates","copyProperties","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();function m(n,o,p){this._threadID=n;this._rootElement=o;this._sheetView=p;}k(m.prototype,h,{render:function(){var n=j[':fb:mercury:chat:tab-sheet:message-mute-sheet'].build();i.setContent(n.getNode('text'),l._("This conversation is muted. Chat tabs will not pop up for it and push notifications are off."));i.setContent(this._rootElement,n.getRoot());g.listen(n.getNode('unmuteButton'),'click',function(){this.inform('clicked',this._threadID);}.bind(this));},isPermanent:function(){return false;},getType:function(){return 'chat-thread-is-muted';},open:function(){this._sheetView.open(this);},close:function(){this._sheetView.close(this);}});e.exports=m;},null);
__d("ChatEmployeeAwaySheet",["ArbiterMixin","DOM","mixin","ChatTabTemplates"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();var k=i(g);for(var l in k)if(k.hasOwnProperty(l))n[l]=k[l];var m=k===null?null:k.prototype;n.prototype=Object.create(m);n.prototype.constructor=n;n.__superConstructor__=k;function n(o,p,q){"use strict";this.$ChatEmployeeAwaySheet0=o;this.$ChatEmployeeAwaySheet1=p;this.$ChatEmployeeAwaySheet2=q;}n.prototype.render=function(){"use strict";var o=j[':fb:mercury:employee-away-sheet'].build();h.setContent(this.$ChatEmployeeAwaySheet1,o.getRoot());};n.prototype.isPermanent=function(){"use strict";return true;};n.prototype.getType=function(){"use strict";return 'employee-away';};n.prototype.open=function(){"use strict";this.$ChatEmployeeAwaySheet2.open(this);};n.prototype.close=function(){"use strict";this.$ChatEmployeeAwaySheet2.close(this);};e.exports=n;},null);
__d("ChatUserBlockedTabSheet",["CSS","ChatPrivacyActionController","DOM","Event","GenderConst","JSLogger","MercuryIDs","MercuryParticipants","ChatTabTemplates","copyProperties","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){b.__markCompiled&&b.__markCompiled();function s(t,u,v){this._rootElement=u;this._sheetView=v;this._logger=l.create('blackbird');this._canonicalUser=m.getUserIDFromThreadID(t);if(this._canonicalUser)this._privacyActionController=new h(this._canonicalUser,this._handlePrivacyChange.bind(this));}p(s.prototype,{render:function(){if(!this._canonicalUser){this._logger.error('user_blocked_sheet_open_with_non_friend');return;}var t=o[':fb:mercury:chat:tab-sheet:user-blocked'].build(),u='fbid:'+this._canonicalUser;n.get(u,function(v){var w=null;switch(v.gender){case k.FEMALE_SINGULAR:case k.FEMALE_SINGULAR_GUESS:w=r._("You turned off chat for {name} but you can still send her a message.",[r.param("name",v.short_name)]);break;case k.MALE_SINGULAR:case k.MALE_SINGULAR_GUESS:w=r._("You turned off chat for {name} but you can still send him a message.",[r.param("name",v.short_name)]);break;default:w=r._("You turned off chat for {name} but you can still send them a message.",[r.param("name",v.short_name)]);}i.setContent(t.getNode('text'),w+' ');var x=r._("Turn on chat for {name}?",[r.param("name",v.short_name)]);i.setContent(t.getNode('actionLink'),x);g.addClass(t.getRoot(),"_1sk0");i.setContent(this._rootElement,t.getRoot());j.listen(t.getNode('actionLink'),'click',this._privacyActionController.togglePrivacy.bind(this._privacyActionController));this._sheetView.resize();}.bind(this));},_handlePrivacyChange:function(t){if(!this._canonicalUser)this._logger.error('user_blocked_sheet_privacy_changed_non_friend');if(t==h.BLOCKED){var u='fbid:'+this._canonicalUser;n.get(u,function(v){if(v.is_friend){this._sheetView.open(this);}else this._sheetView.close(this);}.bind(this));return;}this._sheetView.close(this);},isPermanent:function(){return true;},getType:function(){return 'user_blocked_type';},destroy:function(){this._privacyActionController&&this._privacyActionController.destroy();}});e.exports=s;},null);
__d("MercurySheetPolicy",[],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();var g={canReplaceOpenSheet:function(h,i){if(h.isSheetWithInput&&h.isSheetWithInput())return i.getType()!=h.getType()&&i.isSheetWithInput&&i.isSheetWithInput();if(h.getType()==i.getType())return false;if(h.isPermanent()&&!i.isPermanent())return false;return true;}};e.exports=g;},null);
__d("MercurySheetView",["Animation","ArbiterMixin","MercurySheetPolicy","CSS","DOM","Style","MercurySheetTemplates","Vector","copyProperties","cx","setTimeoutAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();var r=5000,s=function(t,u,v){this._threadID=t;this._rootElement=u;this._tabMainElement=v;this._openSheet=null;};o(s.prototype,h,{destroy:function(){k.empty(this._rootElement);},_openCommon:function(t,u){if(this._openSheet&&!i.canReplaceOpenSheet(this._openSheet,t)){if(t.couldNotReplace)t.couldNotReplace();return;}this.clear(function(){this._openSheet=t;var v=m[':fb:mercury:tab-sheet:loading'].build().getRoot();k.setContent(this._rootElement,v);j.show(v);j.show(this._rootElement);t.render();if(u){j.addClass(this._tabMainElement,'sheetSlide');j.addClass(this._tabMainElement,"_1sk4");var w=n.getElementDimensions(this._rootElement).y;l.set(this._rootElement,'bottom',w+'px');this.resize();this._animation=new g(this._rootElement).to('bottom',0).duration(150).ease(g.ease.both).ondone(function(){j.removeClass(this._tabMainElement,'sheetSlide');j.removeClass(this._tabMainElement,"_1sk4");this.resize();}.bind(this)).go();}else this.resize();if(!t.isPermanent()){var x=r;if(t.getCloseTimeout)x=t.getCloseTimeout();var y=this.getAutoCloseCallback(t);this._sheetCloseHandler=q(this.close.bind(this,t,y),x);if(t.timeoutCanBeReset)t.setResetTimeoutCallback(this.resetTimeout.bind(this));}}.bind(this));},getAutoCloseCallback:function(t){if(!t.autoCloseCallback)return null;return t.autoCloseCallback.bind(t);},resetTimeout:function(t,u){clearTimeout(this._sheetCloseHandler);var v=this.getAutoCloseCallback(t);this._sheetCloseHandler=q(this.close.bind(this,t,v),u);},set:function(t){return this._openCommon(t,false);},open:function(t){return this._openCommon(t,true);},close:function(t,u){if(this._openSheet!=t)return;if(!this._openSheet){u&&u();return;}if(this._animation)this._animation.stop();if(this._sheetCloseHandler){clearTimeout(this._sheetCloseHandler);this._sheetCloseHandler=null;}j.addClass(this._tabMainElement,'sheetSlide');j.addClass(this._tabMainElement,"_1sk4");var v=n.getElementDimensions(this._rootElement).y;this.resize();this._animation=new g(this._rootElement).to('bottom',v+'px').duration(100).ease(g.ease.begin).ondone(function(){k.empty(this._rootElement);j.hide(this._rootElement);j.removeClass(this._tabMainElement,'sheetSlide');j.removeClass(this._tabMainElement,"_1sk4");this._openSheet=null;this.resize();u&&u();}.bind(this)).go();},clear:function(t){this.close(this._openSheet,t);},resize:function(){this.inform('resize');}});e.exports=s;},null);
__d("ChatTabSheetController",["ChatAddFriendsTabSheet","ChatNameConversationTabSheet","ChatNewMessagesTabSheet","ChatNoRecipientsTabSheet","ChatOfflineTabSheet","ChatUploadWarningTabSheet","ChatReadOnlyTabSheet","ChatThreadIsMutedTabSheet","ChatEmployeeAwaySheet","ChatUserBlockedTabSheet","MercuryIDs","MercurySheetView","copyProperties"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){b.__markCompiled&&b.__markCompiled();var t=function(u,v,w,x){this._sheetView=new r(u,v,w);this._addFriendsTabSheet=new g(u,v,this._sheetView,x);this._nameConversationTabSheet=new h(u,v,this._sheetView);this._userBlockedTabSheet=new p(u,v,this._sheetView);this._offlineTabSheet=new k(u,v,this._sheetView);this._newMessagesTabSheet=new i(u,v,this._sheetView);this._uploadWarningTabSheet=new l(u,v,this._sheetView);this._threadIsMutedTabSheet=new n(u,v,this._sheetView);this._employeeAwaySheet=new o(u,v,this._sheetView);this._readOnlyTabSheet=new m(u,v,this._sheetView);if(!q.getUserIDFromThreadID(u))this._noRecipientsTabSheet=new j(u,v,this._sheetView);};s(t.prototype,{openAddFriendsSheet:function(){this._addFriendsTabSheet.open();},getAddFriendsTabSheet:function(){return this._addFriendsTabSheet;},getAddFriendsParticipants:function(){var u=this._addFriendsTabSheet.getParticipants();this._addFriendsTabSheet.close();return u;},openNameConversationSheet:function(u){this._nameConversationTabSheet.open(u);},openReadOnlySheet:function(){this._readOnlyTabSheet.open();},openNewMessagesSheet:function(){this._newMessagesTabSheet.open();},openUploadWarningTabSheet:function(){this._uploadWarningTabSheet.open();},openThreadIsMutedTabSheet:function(){this._threadIsMutedTabSheet.open();},openEmployeeAwaySheet:function(){this._employeeAwaySheet.open();},closeAutomaticNameConversationSheet:function(){if(this._nameConversationTabSheet.isAutomatic())this._nameConversationTabSheet.close();},closeThreadIsMutedTabSheet:function(){this._threadIsMutedTabSheet.close();},closeNewMessagesSheet:function(){this._newMessagesTabSheet.close();},closeUploadWarningTabSheet:function(){this._uploadWarningTabSheet.close();},onClickNewMessagesSheet:function(u){this._newMessageClickSub=this._newMessagesTabSheet.subscribe('clicked',u);},onClickThreadIsMutedSheet:function(u){this._threadIsMutedClickSub=this._threadIsMutedTabSheet.subscribe('clicked',u);},onResize:function(u){this._sheetView.subscribe('resize',u);},onTokensChanged:function(u){this._addFriendsTabSheet.subscribe('chat/tokens-changed',u);},destroy:function(){this._sheetView&&this._sheetView.destroy();this._offlineTabSheet&&this._offlineTabSheet.destroy();this._userBlockedTabSheet&&this._userBlockedTabSheet.destroy();this._newMessageClickSub&&this._newMessageClickSub.unsubscribe();this._threadIsMutedClickSub&&this._threadIsMutedClickSub.unsubscribe();}});e.exports=t;},null);
__d("ChatTitleLink.react",["Link.react","MercuryThreadTitle.react","React","TrackingNodes","cx"],function(a,b,c,d,e,f,g,h,i,j,k){b.__markCompiled&&b.__markCompiled();"use strict";var l=i,m=l.PropTypes,n=i.createClass({displayName:"ChatTitleLink",propTypes:{href:m.string,isNewThread:m.bool,thread:m.object,viewer:m.string},getDefaultProps:function(){return {href:null};},getTitle:function(){return this.refs.threadTitle.getTitle();},render:function(){if(!this.props.thread)return null;return (i.createElement(g,{"aria-level":"3",className:(("titlebarText")+(this.props.href===null?' '+"noLink":'')),"data-ft":j.getTrackingInfo(j.types.TITLE),"data-hover":"tooltip",href:this.props.href},i.createElement(h,{ref:"threadTitle",isNewThread:this.props.isNewThread,thread:this.props.thread,useAndSeparator:true,useShortName:!this.props.thread.is_canonical,viewer:this.props.viewer})));}});e.exports=n;},null);
__d("ChatVideoCallButton.react",["Link.react","ReactComponentWithPureRenderMixin","React","TrackingNodes","cx","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();"use strict";var m=i,n=m.PropTypes,o=i.createClass({displayName:"ChatVideoCallButton",mixins:[h],propTypes:{onClick:n.func,onKeyUp:n.func,shown:n.bool,tooltipLabel:n.string},getDefaultProps:function(){return {tooltipLabel:(l._("Start a video call"))};},render:function(){var p=j.getTrackingInfo(j.types.VIDEOCHAT),q=JSON.stringify({videochat:'call_clicked_bhat_tab'});return (i.createElement(g,{"aria-label":this.props.tooltipLabel,className:(("videoicon")+(' '+"button")+(!this.props.shown?' '+"hidden_elem":'')),"data-ft":p,"data-gt":q,"data-hover":"tooltip","data-tooltip-position":"above",onClick:this.props.onClick,onKeyUp:this.props.onKeyUp}));}});e.exports=o;},null);
__d("EmoticonUtils",["EmoticonsList","Parent"],function(a,b,c,d,e,f,g,h){b.__markCompiled&&b.__markCompiled();var i='emoticon_',j=g.symbols,k={getEmoteFromTarget:function(l){var m=h.byClass(l,'emoticon');if(!m)return null;var n=null;m.className.split(' ').forEach(function(o){if(o.startsWith(i))n=o.substring(i.length);});return j[n]||null;},insertEmoticon:function(l,m,n){var o=m.substring(0,n.start),p=m.substring(n.end);if(n.start>0&&!o.endsWith(' '))l=' '+l;if(!p.startsWith(' '))l+=' ';var q=o+l+p;n.start+=l.length;n.end=n.start;return {result:q,start:n.start,end:n.end};}};e.exports=k;},null);
__d("MercurySharePreview.react",["AsyncRequest","LeftRight.react","LoadingIndicator.react","MercuryFallbackShareAttachment.react","MercuryShareAttachmentRenderLocations","React","XUICloseButton.react","cx","invariant"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=l,q=p.PropTypes,r=l.createClass({displayName:"MercurySharePreview",propTypes:{imageSize:q.shape({width:q.number.isRequired,height:q.number.isRequired}).isRequired,location:q.oneOf(k.getValues()).isRequired,share:q.shape({params:q.array,type:q.number}),uri:q.string,onClose:q.func,onUpdate:q.func},getInitialState:function(){return {attachmentData:null,loading:false};},componentWillMount:function(){this._requestID=1337;this._currentRequest=null;},componentWillUnmount:function(){this._reset();},componentWillReceiveProps:function(s){o(!(s.share&&s.uri));if(!s.share&&!s.uri)return this._reset();var t=this.state.attachmentData||this.state.loading;if(s.share&&!t){this._loadFromShare(s.share);}else if(s.uri&&!(t&&this.props.uri==s.uri))this._loadFromURI(s.uri);},componentDidUpdate:function(s,t){this.props.onUpdate&&this.props.onUpdate(this);},getShareData:function(){return this.state.attachmentData&&this.state.attachmentData.share_data;},isLoading:function(){return this.state.loading;},_loadFromShare:function(s){this._currentRequest=new g().setURI('/message_share_attachment/fromParams/').setData({image_height:this.props.imageSize.height,image_width:this.props.imageSize.width,share_params:s.params,share_type:s.type}).setHandler(this._onShareLoaded.bind(this,this._getNextRequestID()));this._currentRequest.send();this.setState({loading:true,attachmentData:null});},_loadFromURI:function(s){this._currentRequest=new g().setURI('/message_share_attachment/fromURI/').setData({image_height:this.props.imageSize.height,image_width:this.props.imageSize.width,uri:s}).setHandler(this._onShareLoaded.bind(this,this._getNextRequestID()));this._currentRequest.send();this.setState({loading:true,attachmentData:null});},_getNextRequestID:function(){return (++this._requestID);},_getCurrentRequestID:function(){return this._requestID;},_onShareLoaded:function(s,t){if(this._getCurrentRequestID()!==s)return;this.setState({loading:false,attachmentData:t.payload});},_close:function(){this._reset();this.props.onClose&&this.props.onClose();},_reset:function(){this._getNextRequestID();this._currentRequest&&this._currentRequest.abort();this._currentRequest=null;this.setState({loading:false,attachmentData:null});},render:function(){var s=(("_tig")+(' '+"_tih"));if(this.state.loading)return (l.createElement(h,{direction:h.DIRECTION.right,className:s},l.createElement(i,{className:"_tii",size:"large",color:"white"}),l.createElement(m,{className:"_tij",shade:"dark",size:"small",onClick:this._close})));var t=this.state.attachmentData;if(!t)return l.createElement("div",null);return (l.createElement("div",null,l.createElement(m,{className:"_tij",shade:"dark",size:"small",onClick:this._close}),l.createElement(j,{attachment:t,location:k.CHAT_PREVIEW})));}});e.exports=r;},null);
__d("P2PAddCreditCardDialog.react",["Link.react","P2PAPI","P2PAPIUtils","P2PCreditCardForm.react","P2PLoadingMask.react","P2PLinkConstants","React","XUIButton.react","XUIDialog.react","XUIDialogTitle.react","XUIDialogBody.react","XUIDialogFooter.react","XUIGrayText.react","cx","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v){b.__markCompiled&&b.__markCompiled();'use strict';var w=m,x=w.PropTypes,y='fbP2PAddCreditCardDialog_learnMoreSentenceID',z=m.createClass({displayName:"P2PAddCreditCardDialog",propTypes:{asyncRequestState:x.object,onCancel:x.func,onDecline:x.func,onError:x.func,onSaving:x.func,onSuccess:x.func,showPayButton:x.bool},getDefaultProps:function(){return {asyncRequestState:{},onCancel:u,onDecline:u,onError:u,onSaving:u,onSuccess:u,showPayButton:false};},getInitialState:function(){return {declineAddCardShown:false,isValid:false,formData:{},loading:false,requestID:'',saveErrors:null};},componentWillReceiveProps:function(aa){var ba=aa.asyncRequestState?aa.asyncRequestState[this.state.requestID]:null;if(ba){this.setState({requestID:''});if(ba.error){this.handleOnSaveError(ba.error);}else this.handleOnSaveSuccess(ba);}},onSaveClick:function(){var aa=i.genRequestID();this.setState({loading:true,requestID:aa,saveErrors:null});this.props.onSaving();h.addCreditCard(Object.assign({requestID:aa},this.state.formData));},handleOnSaveSuccess:function(aa){this.props.onSuccess(aa);},handleOnSaveError:function(aa){this.setState({loading:false,saveErrors:aa});this.props.onError();},handleValidation:function(aa,ba){this.setState({isValid:aa,formData:ba});},isSaveButtonDisabled:function(){return this.state.loading||!this.state.isValid;},onToggle:function(aa){if(!aa)this.props.onCancel();},handleNoDebitCardClick:function(){this.setState({declineAddCardShown:true});},handleDeclineCardBackButtonClick:function(){this.setState({declineAddCardShown:false});},handleDeclineCardOkButtonClick:function(){this.setState({declineAddCardShown:false});this.props.onDecline();},getButtonType:function(){var aa='default';if(this.props.showPayButton)aa='confirm';return aa;},getButtonText:function(){var aa=v._("Save");if(this.props.showPayButton)aa=v._("Pay");return aa;},renderDeclineAddCard:function(){return (m.createElement("div",{className:"_2hn6"},m.createElement(p,null,v._("Don't Have a Debit Card?")),m.createElement(q,null,m.createElement(s,{display:"block",shade:"medium",size:"small"},v._("You need a debit card to send payments in messages. If you don't have a debit card, you won't be able to send payments at this time."))),m.createElement(r,null,m.createElement(n,{label:v._("Back"),onClick:this.handleDeclineCardBackButtonClick,size:"medium",use:"default"}),m.createElement(n,{label:v._("OK"),onClick:this.handleDeclineCardOkButtonClick,size:"medium",use:"default"}))));},renderAddCardForm:function(){return (m.createElement("div",{className:"_2hn6"},m.createElement(p,null,v._("Add a Debit Card")),m.createElement(q,null,m.createElement(j,{onValidation:this.handleValidation,saveErrors:this.state.saveErrors}),m.createElement("div",{className:"_4v64",id:y},v._("Your payment info is stored securely. {Learn more about p2p link}",[v.param("Learn more about p2p link",m.createElement(g,{"aria-describedby":y,href:l.addDebitCardHelpURI,target:"_blank"},v._("Learn more.")))]))),m.createElement(r,{leftContent:m.createElement(g,{className:"_2hn7",href:"#",onClick:this.handleNoDebitCardClick},v._("Don't have a debit card?"))},m.createElement(n,{use:this.getButtonType(),size:"medium",label:this.getButtonText(),disabled:this.isSaveButtonDisabled(),onClick:this.onSaveClick}))));},componentDidUpdate:function(){setTimeout(function(){this.refs.dialog&&this.refs.dialog.layer.updatePosition();}.bind(this));},render:function(){var aa;if(this.state.declineAddCardShown){aa=this.renderDeclineAddCard();}else aa=this.renderAddCardForm();return (m.createElement(o,{className:"_2hn8",layerHideOnBlur:false,ref:"dialog",onToggle:this.onToggle,shown:true,width:288},aa,m.createElement(k,{visible:this.state.loading})));}});e.exports=z;},null);
__d("P2PConfirmAmountDialog.react",["P2PLoadingMask.react","React","XUIButton.react","XUIDialog.react","XUIDialogBody.react","XUIDialogFooter.react","XUIDialogTitle.react","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){b.__markCompiled&&b.__markCompiled();var p=h,q=p.PropTypes,r=h.createClass({displayName:"P2PConfirmAmountDialog",propTypes:{amount:q.string,currencySymbol:q.string,onCancel:q.func,onConfirm:q.func,receiverName:q.string},getDefaultProps:function(){return {amount:'',currencySymbol:'',onCancel:n,onConfirm:n,receiverName:q.string};},getInitialState:function(){return {loading:false};},handleCancelClick:function(){this.props.onCancel();},handleConfirmClick:function(){this.setState({loading:true});this.props.onConfirm();},getFormattedAmount:function(){var s=this.props.amount,t=(parseFloat(s)).toFixed(2);return this.props.currencySymbol+''+t;},render:function(){return (h.createElement(j,{layerHideOnBlur:false,shown:true,width:300},h.createElement(m,{showCloseButton:false},o._("Confirm Payment")),h.createElement(k,null,o._("Do you want to pay {recipient name} {amount}?",[o.param("recipient name",this.props.receiverName),o.param("amount",this.getFormattedAmount())])),h.createElement(l,null,h.createElement(i,{label:o._("Cancel"),onClick:this.handleCancelClick,use:"default"}),h.createElement(i,{label:o._("Pay"),onClick:this.handleConfirmClick,use:"confirm"})),h.createElement(g,{visible:this.state.loading})));}});e.exports=r;},null);
__d("P2PSendMoneyAmountInput.react",["React","XUIError.react","XUIGrayText.react","cx","emptyFunction","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();'use strict';var m=g,n=m.PropTypes,o=10000,p=g.createClass({displayName:"P2PSendMoneyAmountInput",propTypes:{currencySymbol:n.string,onInputChange:n.func,value:n.string},getDefaultProps:function(){return {currencySymbol:'$',onInputChange:k,value:''};},getInitialState:function(){return {inputError:null,maxInputWidth:100,value:this.props.value,width:''};},componentDidMount:function(){this.updateWidth(this.state.value);},handleAmountInputChange:function(q){var r=q.target.value;this.clearInputError();this.updateAmount(r);},clearInputError:function(){this.setState({inputError:null});},setInputError:function(q){this.setState({inputError:q});},updateAmount:function(q){var r=true,s;q=q.replace(/[^0-9\.]+/g,'');s=parseFloat(q);if(s>=o){r=false;this.setInputError(l._("Please enter a smaller amount"));}var t=q.split('.'),u=t[0],v=t[1];if(v!==undefined){q=(u&&parseFloat(u)!==0?u:'0')+'.'+v.substr(0,2);}else if(u&&parseFloat(u)===0)q='0';this.setValue(q);s=parseFloat(q);r=r&&!isNaN(s)&&s>0;this.props.onInputChange(q,r);},setValue:function(q){this.setState({value:q},this.updateWidth);},updateWidth:function(){var q=this.getMockWidth();if(q)this.setState({width:Math.min(q,this.state.maxInputWidth)});},getMockWidth:function(){return g.findDOMNode(this.refs.mock_input).offsetWidth;},render:function(){return (g.createElement("div",{className:"_ipw"},g.createElement("label",null,g.createElement(i,{className:"_3-91",shade:"medium",size:"small",weight:"bold"},l._("Enter Amount")),g.createElement("div",{className:"_4puh"},g.createElement("div",{className:"_5fbp"},this.props.currencySymbol),g.createElement("div",{ref:"mock_input",className:"_5fbs"},this.state.value),g.createElement(h,{xuiError:this.state.inputError},g.createElement("input",{className:"_5fbv",onChange:this.handleAmountInputChange,ref:"textInput",style:{width:this.state.width},value:this.state.value}))))));}});e.exports=p;},null);
__d("P2PSendMoneyDialog.react",["Arbiter","CreditCardFormParam","Image.react","ImageBlock.react","Link.react","P2PAPI","P2PAddCreditCardDialog.react","P2PCreditCardStore","P2PChooseCreditCardForm.react","P2PConfirmAmountDialog.react","P2PLinkConstants","P2PLoadingMask.react","P2PLogger","P2PPaymentLoggerEvent","P2PPaymentLoggerEventFlow","P2PQEValues","P2PSendMoneyAmountInput.react","P2PVerifyCreditCardDialog.react","React","ReactLayeredComponentMixin","XUIButton.react","XUIContextualDialog.react","XUIGrayText.react","XUIText.react","cx","fbt","emptyFunction"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga){b.__markCompiled&&b.__markCompiled();'use strict';var ha=y,ia=ha.PropTypes,ja=fa._("Change"),ka=fa._("Add a Debit Card"),la=260,ma=100,na=y.createClass({displayName:"P2PSendMoneyDialog",mixins:[z],propTypes:{currency:ia.string,currencySymbol:ia.string,onAmountInputChange:ia.func,onBlur:ia.func,onError:ia.func,onToggle:ia.func,onSendSuccess:ia.func,receiver:ia.object,theme:ia.string},getDefaultProps:function(){return {currency:'USD',currencySymbol:'$',onAmountInputChange:ga,onBlur:ga,onError:ga,onSendClick:ga,onSendSuccess:ga,onToggle:ga,receiver:{},theme:''};},getInitialState:function(){var oa=n.getAll();return {asyncRequestState:n.getAsyncRequestState(),addCreditCardDialogShown:false,amount:'',creditCards:oa,confirmAmountDialogShown:false,isAmountValid:false,loading:false,selectedCard:oa[0],showChooseCreditCardForm:false,verifyCreditCardDialogShown:false};},passwordCancelSubscribeToken:null,log:function(oa,pa){s.log(oa,Object.assign({www_event_flow:u.UI_FLOW_P2P_SEND,object_id:this.props.receiver.userId},pa));},componentWillUnmount:function(){if(this.passwordCancelSubscribeToken!==null){g.unsubscribe(this.passwordCancelSubscribeToken);this.passwordCancelSubscribeToken=null;}if(this.creditCardStoreSub){this.creditCardStoreSub.remove();this.creditCardStoreSub=null;}},componentWillMount:function(){this.creditCardStoreSub=n.addListener('change',this.onCreditCardStoreChange);this.log(t.UI_ACTN_INITIATE_SEND);},onAmountInputChange:function(oa,pa){this.setState({amount:oa,isAmountValid:pa});},onCreditCardStoreChange:function(){var oa=n.getAll();this.setState({asyncRequestState:n.getAsyncRequestState(),creditCards:oa,selectedCard:!this.state.selectedCard?oa[0]:this.state.selectedCard});},shouldShowConfirmAmountDialog:function(){var oa=parseFloat(this.state.amount);return oa>=ma;},shouldShowVerifyCreditCardDialog:function(){return !this.state.selectedCard.getIsVerified();},handleSendClick:function(oa){if(this.isSendButtonDisabled())return false;this.log(t.UI_ACTN_SEND_CLICKED,{raw_amount:this.state.amount,currency:this.props.currency});this.initiatePayment();},initiatePayment:function(){if(this.shouldShowConfirmAmountDialog()){this.setState({addCreditCardDialogShown:false,confirmAmountDialogShown:true});this.log(t.UI_ACTN_CONFIRM_AMOUNT,{raw_amount:this.state.amount,currency:this.props.currency});return;}if(this.shouldShowVerifyCreditCardDialog()){this.setState({addCreditCardDialogShown:false,verifyCreditCardDialogShown:true});this.log(t.UI_ACTN_VERIFY_CSC,{raw_amount:this.state.amount,currency:this.props.currency});return;}this.createTransaction();},shouldShowLoading:function(){return (!this.state.addCreditCardDialogShown&&!this.state.confirmAmountDialogShown&&!this.state.verifyCreditCardDialogShown);},createTransaction:function(){var oa={};this.setState({loading:this.shouldShowLoading()});oa[h.CREDENTIAL_ID]=this.state.selectedCard.getCredentialId();oa.amount=this.state.amount;oa.receiverId=this.props.receiver.userId;this.passwordCancelSubscribeToken=g.subscribeOnce('PasswordReauthDialogCancelClick',this.handlePasswordReauthDialogCancelClick);l.createTransaction({formData:oa,error:this.setCreateTransferError,success:this.setCreateTransferSuccess});this.log(t.UI_ACTN_CONFIRM_SEND,{raw_amount:this.state.amount,currency:this.props.currency});},hideAllDialogs:function(){this.setState({addCreditCardDialogShown:false,confirmAmountDialogShown:false,verifyCreditCardDialogShown:false});},setCreateTransferError:function(oa){if(this.isMounted()){this.hideAllDialogs();this.setState({loading:false});}this.props.onError(oa);this.log(t.UI_ACTN_SEND_FAIL);},setCreateTransferSuccess:function(oa){if(this.isMounted()){this.setState({loading:false});this.hideAllDialogs();}this.props.onSendSuccess(oa);this.log(t.UI_ACTN_SEND_SUCCESS);},handlePasswordReauthDialogCancelClick:function(){this.passwordCancelSubscribeToken=null;this.setState({loading:false});},onAddCreditCardCancel:function(){this.setState({addCreditCardDialogShown:false});this.log(t.UI_ACTN_CANCEL_ADD_CARD);},onAddCreditCardSaving:function(){this.log(t.UI_ACTN_CONFIRM_CARD_DETAILS);},onAddCreditCardSuccess:function(oa){var pa=this.state.creditCards.filter(function(qa){var ra=qa.getCredentialId();return (oa[h.CREDENTIAL_ID]===ra);})[0];this.setState({selectedCard:pa});if(this.state.isAmountValid){this.initiatePayment();}else{this.setState({addCreditCardDialogShown:false});this.focusAmountInput();}this.log(t.UI_ACTN_ADD_CARD_SUCCESS);},onAddCreditCardError:function(){this.log(t.UI_ACTN_ADD_CARD_FAIL);},onAddCreditCardDecline:function(){this.setState({addCreditCardDialogShown:false});this.props.onBlur();},focusAmountInput:function(){if(this.refs.send_money_amount_input)y.findDOMNode(this.refs.send_money_amount_input).focus();},_onBlur:function(){this.props.onBlur();if(!this.state.loading)this.log(t.UI_ACTN_SEND_MONEY_CANCELLED);},handleAddCreditCardClick:function(){this.setState({addCreditCardDialogShown:true,showChooseCreditCardForm:false});},handleBackClick:function(){this.setState({showChooseCreditCardForm:false},function(){this.focusAmountInput();});},handleChooseCardNextClick:function(){var oa=this.refs.choose_credit_card_form.getSelectedCard();this.setState({selectedCard:oa,showChooseCreditCardForm:false},function(){this.focusAmountInput();});},handleAddCardNextClick:function(){this.setState({addCreditCardDialogShown:true});this.log(t.UI_ACTN_INITIATE_ADD_CARD);},handleChangeSelectedCardClick:function(){var oa={};if(this.state.creditCards.length===1){oa.addCreditCardDialogShown=true;}else oa.showChooseCreditCardForm=true;this.setState(oa);},onConfirmAmountCancel:function(){this.setState({confirmAmountDialogShown:false});},onConfirmAmountSuccess:function(){if(this.shouldShowVerifyCreditCardDialog()){this.setState({confirmAmountDialogShown:false,verifyCreditCardDialogShown:true});}else this.createTransaction();},onVerifyCreditCardSuccess:function(){this.createTransaction();},onVerifyCreditCardCancel:function(){this.setState({verifyCreditCardDialogShown:false});},isSendButtonDisabled:function(){return (!this.state.isAmountValid||!this.state.creditCards.length||this.state.loading);},isAddCardNextButtonDisabled:function(){return !this.state.isAmountValid;},renderAddDebitCardLink:function(){return (y.createElement("div",{ref:"send_money_dialog_add_card_text"},y.createElement(k,{className:"_49nm",href:"#",onClick:this.handleAddCreditCardClick},ka)));},renderSelectedCard:function(){var oa=this.state.selectedCard;return (y.createElement("div",{className:"_21x5"},y.createElement("div",{className:"_49nn"},oa.getName()),y.createElement("div",{className:"_21wx"},oa.getCreditCardNumberFormatted()),y.createElement("div",{className:"_21ww"},'\u00b7'),y.createElement(k,{className:"_21wy",onClick:this.handleChangeSelectedCardClick,href:"#"},ja)));},renderFormButtons:function(){var oa;if(!this.state.creditCards.length){oa=this.renderAddCardNextButton();}else if(this.state.showChooseCreditCardForm){oa=y.createElement("div",null,this.renderChooseCardBackButton(),this.renderChooseCardNextButton());}else oa=this.renderPayButton();return oa;},renderChooseCardBackButton:function(){return (y.createElement(aa,{className:"_2abj",label:fa._("Back"),onClick:this.handleBackClick,ref:"back_button",size:"medium",use:"default"}));},renderAddCardNextButton:function(){return (y.createElement(aa,{disabled:this.isAddCardNextButtonDisabled(),label:fa._("Next"),onClick:this.handleAddCardNextClick,ref:"add_card_next_button",size:"medium",use:"default"}));},renderChooseCardNextButton:function(){return (y.createElement(aa,{label:fa._("Next"),onClick:this.handleChooseCardNextClick,ref:"choose_card_next_button",size:"medium",use:"confirm"}));},renderPayButton:function(){return (y.createElement(aa,{className:"_21x6",disabled:this.isSendButtonDisabled(),label:fa._("Pay"),onClick:this.handleSendClick,ref:"send_button",size:"medium",use:"confirm"}));},renderPaymentDetails:function(){var oa,pa=v.SendMoneyFlyoutBottomText||'';if(this.state.creditCards.length){if(this.state.showChooseCreditCardForm){oa=this.renderAddDebitCardLink();}else oa=this.renderSelectedCard();}else oa=y.createElement("div",{className:"_2abl"},y.createElement(ca,{display:"block",ref:"send_money_dialog_add_card_next_text",size:"small",shade:"light"},pa));return oa;},renderSendMoneyForm:function(){return (y.createElement("div",null,y.createElement("div",{className:"_49no _2pi4",ref:"send_money_dialog_title"},y.createElement(j,{spacing:"large"},y.createElement(i,{heigh:40,src:this.props.receiver.big_image_src||this.props.receiver.image_src,width:40}),y.createElement("div",{className:"_3-8w"},y.createElement(ca,{display:"block",weight:"normal",size:"small"},fa._("Send to")),y.createElement(da,{display:"block",size:"small",color:"dark",weight:"bold"},this.props.receiver.name))),y.createElement(k,{className:"_49np",href:q.helpCenterURI,target:"_blank"})),y.createElement("div",{className:"_2abm"},this.renderMainContainer()),y.createElement("div",{className:"_21w-"},y.createElement("div",{className:"_21x4"},this.renderPaymentDetails()),y.createElement("div",{className:"_4zf-"},this.renderFormButtons()))));},renderMainContainer:function(){var oa;if(this.state.showChooseCreditCardForm){oa=y.createElement("div",{className:"_xn7"},y.createElement(o,{creditCards:this.state.creditCards,selectedCard:this.state.selectedCard,ref:"choose_credit_card_form"}));}else oa=y.createElement("div",{className:"_2abn"},y.createElement(w,{currencySymbol:this.props.currencySymbol,onInputChange:this.onAmountInputChange,ref:"send_money_amount_input",value:this.state.amount}));return oa;},renderLayers:function(){var oa={};if(this.state.addCreditCardDialogShown){oa.addCreditCard=y.createElement(m,{asyncRequestState:this.state.asyncRequestState,ref:"send_money_dialog_add_credit_card_form",onCancel:this.onAddCreditCardCancel,onDecline:this.onAddCreditCardDecline,onSuccess:this.onAddCreditCardSuccess,onError:this.onAddCreditCardError,onSaving:this.onAddCreditCardSaving,showPayButton:this.state.isAmountValid});}else if(this.state.confirmAmountDialogShown){oa.confirmAmount=y.createElement(p,{amount:this.state.amount,currencySymbol:this.props.currencySymbol,onCancel:this.onConfirmAmountCancel,onConfirm:this.onConfirmAmountSuccess,receiverName:this.props.receiver.short_name});}else if(this.state.verifyCreditCardDialogShown)oa.verifyCreditCard=y.createElement(x,{asyncRequestState:this.state.asyncRequestState,creditCard:this.state.selectedCard,isSending:true,onCancel:this.onVerifyCreditCardCancel,onSuccess:this.onVerifyCreditCardSuccess});return oa;},render:function(){var oa=this.props.theme==='messenger';return (y.createElement(ba,{alignment:oa?'right':'left',context:this.props.context,onBlur:this._onBlur,shown:true,width:la,position:this.props.position||'above'},y.createElement("div",{className:(("_21x9")+(oa?' '+"_1pka":''))},this.renderSendMoneyForm(),y.createElement(r,{ref:"send_money_dialog_loader",visible:this.state.loading}))));}});e.exports=na;},null);
__d("P2PSendMoneyButton.react",["Image.react","LayerSlowlyFadeOnShow","Link.react","P2PErrorDialog.react","P2PLinkConstants","P2PPasswordProtectionNUXDialog.react","P2PPasswordProtectionStatusTypes","P2PSendMoneyDialog.react","P2PTransferRiskResult","P2PTransferParam","P2PVerificationFlowHelper","React","ReactLayeredComponentMixin","TooltipLink.react","XUIButton.react","XUIDialog.react","XUIDialogTitle.react","XUIDialogBody.react","XUIDialogFooter.react","XUIDialogOkayButton.react","XUIGrayText.react","cx","emptyFunction","fbt","ix"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea){b.__markCompiled&&b.__markCompiled();'use strict';var fa=r,ga=fa.PropTypes,ha=r.createClass({displayName:"P2PSendMoneyButton",mixins:[s],propTypes:{theme:ga.string,disabled:ga.bool,onTrigger:ga.func,receiver:ga.object},getDefaultProps:function(){return {disabled:false,onTrigger:ca,receiver:{}};},getInitialState:function(){return {confirmationDialogShown:false,dialogShown:false,passwordNUXPending:false,passwordProtectionNUXDialogShown:false,sendErrorObject:null,underManualReviewDialogShown:false};},originalCreateTransactionResponse:null,_onButtonClick:function(ia){if(this._clickGuard||this.props.disabled)return;this.setState({dialogShown:true});},_handleDialogSendClick:function(){this.setState({dialogShown:false});},_handleDialogBlur:function(){this.setState({dialogShown:false});},_prepareForClick:function(){this._clickGuard=this.state.dialogShown;},handleOnSendSuccess:function(ia){this.setState({dialogShown:false});var ja=ia[p.RISK_RESULT];this.originalCreateTransactionResponse=ia;if(ja===o.REQUIRE_VERIFICATION){q.startVerificationFlow(ia.id,true,this.handlePostSendSteps);}else if(ja===o.UNDER_MANUAL_REVIEW){this.setState({underManualReviewDialogShown:true});}else this.handlePostSendSteps();},handlePostSendSteps:function(){var ia=this.originalCreateTransactionResponse,ja=ia.passwordProtection===m.NOT_SET;if(ia.isFirstSend){this.setState({confirmationDialogShown:true,passwordNUXPending:ja});}else if(ja)this.setState({passwordProtectionNUXDialogShown:true});this.originalCreateTransactionResponse=null;this.props.onTrigger();},onPasswordProtectionNUXComplete:function(){this.setState({passwordProtectionNUXDialogShown:false});},handleConfirmationOKClick:function(){this.setState({confirmationDialogShown:false,passwordProtectionNUXDialogShown:this.state.passwordNUXPending,passwordNUXPending:false});},handleSendError:function(ia){this.setState({sendErrorObject:ia});},handleErrorDialogOKClick:function(){this.setState({sendErrorObject:null});},onRiskResultDialogConfirmed:function(){this.setState({underManualReviewDialogShown:false},function(){this.handlePostSendSteps();}.bind(this));},renderLayers:function(){var ia={};if(this.state.sendErrorObject)ia.sendError=r.createElement(j,{error:this.state.sendErrorObject,onOKClick:this.handleErrorDialogOKClick,ref:"send_error",title:da._("Problem While Sending Money")});if(this.state.dialogShown)ia.sendMoneyDialog=r.createElement(n,{context:r.findDOMNode(this.refs.p2pSendMoneyButton),onBlur:this._handleDialogBlur,onError:this.handleSendError,onSendClick:this._handleDialogSendClick,onSendSuccess:this.handleOnSendSuccess,receiver:this.props.receiver,ref:'send_money_dialog',theme:this.props.theme});if(this.state.confirmationDialogShown)ia.confirmationDialog=r.createElement(v,{behaviors:{LayerFadeOnShow:false,LayerSlowlyFadeOnShow:h},layerHideOnBlur:false,ref:"confirmation_dialog",shown:true,width:300},r.createElement(w,{showCloseButton:false},da._("Payment Sent")),r.createElement(x,null,r.createElement("div",{className:"_3hd2"},r.createElement(g,{height:50,width:50,src:ea("/images/p2p/check_mark-sm.png")})),r.createElement(aa,{display:"block",size:"small",shade:"dark"},da._("When you receive money, it will go on this card, too. You can update your card in {Link with text that goes to settings page}.",[da.param("Link with text that goes to settings page",r.createElement(i,{target:"_blank",href:k.settingsWWWURI},da._("Payments Settings")))]))),r.createElement(y,null,r.createElement(z,{action:"cancel",use:"default",onClick:this.handleConfirmationOKClick})));if(this.state.passwordProtectionNUXDialogShown)ia.passwordProtectionNUXDialog=r.createElement(l,{onComplete:this.onPasswordProtectionNUXComplete});if(this.state.underManualReviewDialogShown)ia.underManualReviewDialog=r.createElement(v,{layerHideOnBlur:false,ref:"under_manual_review_dialog",shown:true,width:300},r.createElement(w,{showCloseButton:false},da._("Reviewing Payment Info")),r.createElement(x,null,da._("For your security, this payment is in review for up to 24 hours. When it's confirmed, it will go through.")),r.createElement(y,null,r.createElement(u,{label:da._("OK"),onClick:this.onRiskResultDialogConfirmed,use:"confirm"})));return ia;},render:function(){var ia=da._("Send money"),ja='';if(this.props.receiver)ja=da._("{receiverName} is unable to receive money at the moment.",[da.param("receiverName",this.props.receiver.short_name)]);var ka=!this.props.disabled?ia:null,la=this.props.disabled?ja:'';return (r.createElement(t,{alignH:"center",className:((this.state.dialogShown?"open":'')+(this.props.disabled?' '+"disabled":'')+(this.props.theme!=='messenger'?' '+"_5uqy":'')),position:"above",tooltip:la,onClick:this._onButtonClick,onMouseDown:this._prepareForClick,title:ka,ref:"p2pSendMoneyButton"}));}});e.exports=ha;},null);
__d("SelectionPosition",["Event","InputSelection","SubscriptionsHandler","merge"],function(a,b,c,d,e,f,g,h,i,j){b.__markCompiled&&b.__markCompiled();function k(l){"use strict";this.$SelectionPosition0=l;this.$SelectionPosition1={start:0,end:0};this.$SelectionPosition2=new i();this.$SelectionPosition3=false;this.updatePos();this.enable();}k.prototype.getPos=function(){"use strict";return j(this.$SelectionPosition1);};k.prototype.setPos=function(l,m){"use strict";this.$SelectionPosition1={start:l,end:m};this.restore();};k.prototype.updatePos=function(){"use strict";this.$SelectionPosition1=h.get(this.$SelectionPosition0);};k.prototype.restore=function(){"use strict";h.set(this.$SelectionPosition0,this.$SelectionPosition1.start,this.$SelectionPosition1.end);};k.prototype.enable=function(){"use strict";if(!this.$SelectionPosition3){this.$SelectionPosition2.addSubscriptions(g.listen(this.$SelectionPosition0,'keyup',this.updatePos.bind(this)),g.listen(this.$SelectionPosition0,'click',this.updatePos.bind(this)));this.$SelectionPosition3=true;}};k.prototype.disable=function(){"use strict";if(this.$SelectionPosition3){this.$SelectionPosition2.release();this.$SelectionPosition3=false;}};e.exports=k;},null);
__d("XStickerReplyNUXController",["XController"],function(a,b,c,d,e,f){b.__markCompiled&&b.__markCompiled();e.exports=b("XController").create("\/stickers\/tooltip\/",{});},null);
__d("MercurySeenByAll",["CSS","DataStore","MercuryDelayedRoger","DOM","MercuryIDs","MercuryViewer","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l){b.__markCompiled&&b.__markCompiled();var m=b('MercuryThreads').get(),n={},o={updateOnSeenChange:function(q,r,s){n[q.tagName]=true;h.set(q,'thread-id',r.thread_id);g.addClass(q,'seenByListener');p(q,r,s);}};function p(q,r,s){var t=null;if(s){t=k.getParticipantIDFromUserID(s);}else t=l.getID();var u=r.participants.filter(function(w){return w!==t;}),v=r.participants.length>0&&r.participants[0]===t;g.conditionClass(q,'repliedLast',v);g.conditionClass(q,'seenByAll',v&&i.getSeenBy(r.thread_id).length===u.length);}i.subscribe('state-changed',function(q,r){for(var s in n){var t=j.scry(document.body,s+'.seenByListener');for(var u=0;u<t.length;u++){var v=t[u],w=h.get(v,'thread-id');if(r[w])m.getThreadMeta(w,function(x){p(v,x);});}}});e.exports=o;},null);
__d("MercuryThreadMetadataRenderer",["CSS","DOM","Emoji","HTML","JSLogger","MercuryAttachmentType","MercuryIDs","MercuryMessageSourceTags","MercurySingletonMixin","MercuryThreadImage.react","MercuryThreadMetadataRawRenderer","MercuryThreadTitle.react","MercuryParticipants","React","MercurySeenByAll","MercuryServerRequests","Style","MercuryThreads","Tooltip","URI","WebMessengerThreadPermalinks","arrayContains","createArrayFromMixed","copyProperties","cx","formatDate","fbt"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga){b.__markCompiled&&b.__markCompiled();var ha=k.create('wm_timestamp');function ia(na){this._fbid=na;this._serverRequests=v.getForFBID(na);this._threads=x.getForFBID(na);}da(ia,o);da(ia.prototype,{renderTimestamp:function(na,oa,pa,qa){if(qa){if(!oa){ha.warn('no_title');oa=(new Date(qa)).toLocaleDateString();}na.setAttribute('title',oa);na.setAttribute('data-utime',qa/1000);if(!pa){ha.warn('no_display');pa=fa(new Date(qa),'g:ia');}h.setContent(na,pa);g.show(na);}},renderMessageSourceTags:function(na,oa,pa,qa){var ra='',sa='',ta='';if(ba(pa,n.MESSENGER)){ra=ga._("Sent from Messenger");sa=new z('/mobile/messenger');ta="_9g";}else if(ba(pa,n.MOBILE)){ra=ga._("Sent from Mobile");sa=new z('/mobile/');ta="_9j";}else if(ba(pa,n.CHAT)){ra=ga._("Sent from chat");ta="_9h";}else if(ba(pa,n.EMAIL)){if(qa){ra=ga._("Sent from {email}",[ga.param("email",qa)]);}else ra=ga._("Sent from email");ta="_9i";}if(ta){y.set(na,ra);g.addClass(oa,ta);if(sa){na.setAttribute('href',sa);}else na.removeAttribute('href');}else g.hide(na);},renderMessageLocation:function(na,oa,pa){var qa=z('/ajax/messaging/hovercard/map.php').setQueryData(pa);na.setAttribute('data-hovercard',qa);g.removeClass(na,"_b9");g.show(oa);},renderSpoofWarning:function(na,oa,pa){if(oa){g.addClass(na,"_sa");y.set(na,ga._("Unable to confirm {name_or_email} as the sender.",[ga.param("name_or_email",pa.name)]));}},renderChatSpoofWarning:function(na,oa,pa){if(oa)h.appendContent(na,ga._("Unable to confirm {name_or_email} as the sender.",[ga.param("name_or_email",pa.name)]));},renderCoreThreadlist:function(na,oa,pa,qa,ra){qa=qa||{};this.renderThreadImage(na,oa.getNode('image'));var sa=oa.getNode('accessibleName'),ta=[oa.getNode('name')];if(sa)ta.push(sa);ma(this,na,ta,qa);if(na.folder&&ra)la(oa.getNode('folderBadge'),na.folder);var ua=oa.getNode('timestamp');this.renderTimestamp(ua,na.timestamp_absolute,na.timestamp_relative,na.timestamp);this.renderSnippet(na,oa.getNode('snippet'));ka(oa,na);pa(oa,na);},renderAndSeparatedParticipantList:function(na,oa,pa){pa=pa||{};pa.last_separator_uses_and=true;this._threads.getThreadMeta(na,function(qa){ma(this,qa,oa,pa);}.bind(this));},renderSnippet:function(na,oa){var pa=false,qa=h.create('span');g.addClass(qa,'MercuryRepliedIndicator');h.appendContent(oa,qa);u.updateOnSeenChange(qa,na,this._fbid);var ra=na.snippet;if(ra){if(na.snippet_has_attachment)h.appendContent(oa,h.create('span',{className:'MercuryAttachmentIndicator'}));if(na.is_forwarded_snippet)h.appendContent(oa,h.create('strong',{className:"_55q_"},ga._("Forwarded Message:")));if(ra.substr(0,4)=='?OTR'){ra=ga._("[encrypted message]");}else ra=ra.replace(/\r\n|[\r\n]/g," ");ra=j(i.htmlEmojiAndEmote(ra));}else{if(na.is_forwarded_snippet)h.appendContent(oa,h.create('strong',{className:"_55q_"},ga._("Forwarded message")));if(na.snippet_has_attachment&&na.snippet_attachments&&na.snippet_attachments.length){pa=true;ra=h.create('span');d(['MercuryAttachmentSnippet.react'],function(ua){t.render(t.createElement(ua,{thread:na,viewer:this._fbid}),ra);}.bind(this));}}var sa=na.participants.length;if(na.is_subscribed)sa--;var ta=na.snippet_sender;if(!pa&&ta&&m.getParticipantIDFromUserID(this._fbid)!=ta&&sa>1){s.get(ta,function(ua){if(ua.short_name){h.appendContent(oa,ga._("{name}: {conversation_snippet}",[ga.param("name",ua.short_name),ga.param("conversation_snippet",ra)]));}else h.appendContent(oa,ra);});}else h.appendContent(oa,ra);},renderWebMessengerLink:function(na,oa,pa,qa){aa.getThreadURI(na,function(ra){oa.setAttribute('href',ra);pa&&pa();},qa);},renderThreadImage:function(na,oa){t.render(t.createElement(p,{thread:na,viewer:this._fbid}),oa);},renderParticipantList:function(na,oa,pa,qa){return q.renderRawParticipantList(this._serverRequests.getServerThreadIDNow(na),oa,pa,qa);},renderThreadNameAndParticipantList:function(na,oa,pa,qa){var ra=q.renderRawParticipantList(this._serverRequests.getServerThreadIDNow(na),oa,pa,qa),sa=this._threads.getThreadMetaNow(na);if(!sa.name)return ra;return ga._("{conversation_name} [with {participant_list}]",[ga.param("conversation_name",sa.name),ga.param("participant_list",ra)]);},renderParticipantCount:function(na,oa){return q.renderRawParticipantCount(oa);}});function ja(na){if(!na.snippet_attachments)return [];return na.snippet_attachments.filter(function(oa){return oa.attach_type===l.PHOTO;});}function ka(na,oa){var pa=ja(oa);if(pa.length===0)return;var qa=pa[0].thumbnail_url;if(!qa)return;var ra=(pa.length==1)?'snippet-thumbnail-single':'snippet-thumbnail-multiple',sa=na.getNode(ra);if(!sa)return;var ta=h.find(sa,'i');w.set(ta,'background-image','url('+qa+')');g.show(sa);}function la(na,oa){ca(na).forEach(function(pa){h.setContent(pa,oa);});}function ma(na,oa,pa,qa){pa=ca(pa);var ra=na._fbid;if(oa.name){pa.forEach(function(ta){t.render(t.createElement(r,{thread:oa,viewer:ra,showUnreadCount:!!qa.show_unread_count}),ta);});return;}var sa=oa.participants;if(oa.participants.length>1)sa=oa.participants.filter(function(ta){return ta!=m.getParticipantIDFromUserID(ra);});s.getMulti(sa,function(ta){q.renderParticipantListWithNoThreadName(na._serverRequests.getServerThreadIDNow(oa.thread_id),oa,sa,ta,pa,qa);});}e.exports=ia;},null);
__d("ChatTabView",["Arbiter","ArbiterMixin","AsyncDialog","AsyncRequest","AsyncSignal","AvailableListConstants","BanzaiODS","Bootloader","BootloadedComponent.react","ChatAddToThreadButton.react","ChatArchiveWarning.react","ChatBehavior","ChatCloseButton.react","ChatConfig","ChatContextualDialogController","ChatEmployeeAwayWarning","ChatOpenTab","ChatPhotoUploader.react","ChatPrivacyActionController","ChatQuietLinks","ChatShareLinkUploader","ChatStickerButton.react","ChatStickerTriggerController","ChatTabActions","ChatTabMenu.react","ChatTabMessagesView","ChatTabOfficeStatus","ChatTabSheetController","ChatTitleLink.react","ChatVisibility","ChatVideoCallButton.react","MercuryConstants","CurrentUser","CSS","CurrentLocale","Dialog","Dock","DOM","DOMEvent","DOMQuery","DragDropTarget","EmoticonsList","EmoticonUtils","Event","FBRTCCore","Focus","ImmutableObject","Input","Keys","Locale","LogHistory","MercuryIDs","MercuryFileUploader","MercuryLogMessageType","MercuryParticipants","MercuryShareAttachmentRenderLocations","MercurySharePreview.react","MercurySourceType","MercuryThreadInfo","MercuryThreadMetadataRawRenderer","MercuryThreadMuter","MercuryTypingReceiver","MercuryViewer","NubController","P2PSendMoneyButton.react","P2PTransferStore","Parent","PhotosUploadWaterfall","PresencePrivacy","PresenceStatus","React","Run","SelectionPosition","StickerActions","StickerConfig","StickerConstants","StickersFlyout.react","StickerState","Style","SubscriptionsHandler","SyntheticMouseEvent","ChatTabTemplates","TextAreaControl","Toggler","Tooltip","TypingDetectorController","URLScraper","URI","UserAgent_DEPRECATED","WaterfallIDGenerator","WebMessengerThreadPermalinks","XStickerReplyNUXController","copyProperties","createCancelableFunction","csx","cx","fbt","getActiveElement","isEmpty","setIntervalAcrossTransitions","ChatReactInput","MercuryMessageActions","MercuryMessages","MercuryMessageObject","MercuryServerRequests","MercuryThreadInformer","MercuryThreadMetadataRenderer","MercuryThreadActions","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,ad,bd){b.__markCompiled&&b.__markCompiled();'use strict';var cd=b('ChatReactInput').module,dd=b('MercuryMessageActions').get(),ed=b('MercuryMessages').get(),fd=b('MercuryMessageObject').get(),gd=b('MercuryServerRequests').get(),hd=b('MercuryThreadInformer').get(),id=b('MercuryThreadMetadataRenderer').get(),jd=b('MercuryThreadActions').get(),kd=b('MercuryThreads').get(),ld=/^\s*$/,md={},nd=null,od,pd=10,qd=960,rd=eb.getInstance('chat_tab_view');function sd(ne,oe){var pe=ra.create('div');oe=oe&&oe.filter(function(se){return se!=qb.getID();});if(ad(oe))return mc.remove(ne);var qe=oe.length,re=qe-pd;if(re>1)oe=oe.slice(0,pd);ib.getMulti(oe,function(se){for(var te in se){var ue=se[te],ve=jc[':fb:mercury:chat:multichat-tooltip-item'].build();ra.setContent(ve.getNode('name'),ue.name);var we=fb.getUserIDFromParticipantID(te),xe=we&&xb.get(we)==l.ACTIVE;na.conditionShow(ve.getNode('icon'),xe);na.conditionClass(ve.getNode('name'),'tooltipItemWithIcon',xe);ra.appendContent(pe,ve.getRoot());}if(re>1){var ye=yc._("and {number of hidden chat participants} more.",[yc.param("number of hidden chat participants",re)]);ra.appendContent(pe,ra.create('div',{},ye));}mc.set(ne,pe,'above');});}var td={},ud=null,vd=false;function wd(ne,oe,pe){if(pe){td[ne]=oe;if(!ud)ud=bd(xd,600);}else{na.removeClass(oe,'highlightTitle');delete td[ne];}}function xd(){for(var ne in td){var oe=td[ne];if(oe.parentNode){na.conditionClass(oe,'highlightTitle',vd);}else delete td[ne];}vd=!vd;if(!Object.keys(td).length){clearInterval(ud);ud=null;}}function yd(ne){var oe=fb.tokenize(ne);switch(oe.type){case 'user':return jc[':fb:mercury:chat:user-tab'].build();}return jc[':fb:mercury:chat:multichat-tab'].build();}function zd(ne){var oe=ne._getInputValue(),pe=ne._fileUploader.getAttachments();if(fe(ne))be(ne,oe,pe,function(qe){var re=ne._fileUploader.getImageFiles();if(re.length>0){qe.image_ids=re;qe.has_attachment=true;}var se=ne._fileUploader.getAnimatedImageFiles();if(se.length>0){qe.gif_ids=se;qe.has_attachment=true;}var te=ne._fileUploader.getVideoFiles();if(te.length>0){qe.video_ids=te;qe.has_attachment=true;}var ue=ne._fileUploader.getAudioFiles();if(ue.length>0){qe.audio_ids=ue;qe.has_attachment=true;}var ve=ne._fileUploader.getFiles();if(ve.length>0){qe.file_ids=ve;qe.has_attachment=true;}dd.send(qe);ne._fileUploader.removeAttachments();ne._shareLinkUploader&&ne._shareLinkUploader.clear();if(ne._sharePreview)ne._sharePreview.setProps({share:null,uri:null});if(!t.get('chat_react_input'))ne._getNode('input').value='';ne._typingDetector&&ne._typingDetector.resetState();ne._messagesView&&ne._messagesView.setShouldScrollToBottom(true);});}function ae(ne,oe){if(oe===0)return;ie(ne,vb.POST_PUBLISHED,{count:oe});ne._waterfallID=rc.generate();}function be(ne,oe,pe,qe){kd.getThreadMeta(ne._threadID,function(re){var se=lb.CHAT_WEB;if(ne._shareLinkUploader&&ne._shareLinkUploader.getAttachData()&&ne._shareLinkUploader.loadedFromFeed())se=lb.SAM_UFI;var te=fd.constructUserGeneratedMessageObject(oe,se,ne._threadID);if(pe.length>0){te.has_attachment=true;te.raw_attachments=pe;}if(ne._shareLinkUploader){var ue=ne._shareLinkUploader.getAttachData();if(ue){te.has_attachment=true;te.content_attachment=ue;}}if(ne._sharePreview){var ve=ne._sharePreview.getShareData();if(ve){te.has_attachment=true;te.shareable_attachment=ve;}}if(kd.isNewEmptyLocalThread(ne._threadID)){var we=ne._sheetController.getAddFriendsParticipants();if(we===null||we.length===0)return;we=we.filter(function(ye){return ye!=qb.getID();});if(we.length===0){te.thread_id=fb.getThreadIDFromUserID(ma.getID());}else if(we.length===1){te.thread_id=fb.getThreadIDFromParticipantID(we[0]);}else jd.addParticipants(ne._threadID,we);}if(kd.isEmptyLocalThread(ne._threadID)){te.message_id=fb.tokenize(ne._threadID).value;var xe=kd.getThreadMetaNow(re.thread_id);te.specific_to_list=Array.from(xe.participants);}if(typeof te!='undefined')te.signatureID=ne._signatureID;te.ui_push_phase=la.UIPushPhase;qe(te);if(ne._threadID!==te.thread_id&&!ne._photoUploader.isUploading()){da.closeTab(ne._threadID);w.openThread(te.thread_id,'ChatTabView');}});}function ce(ne){ne._blocked=true;ne._sheetController.openUploadWarningTabSheet();}function de(ne){return (ne._fileUploader.isUploading()||ne._photoUploader.isUploading()||(ne._sharePreview&&ne._sharePreview.isLoading()));}function ee(ne){return ne._fileUploader.isUploading();}function fe(ne){var oe=ne._getInputValue();if(!ld.test(oe))return true;if(ne._fileUploader.getAttachments().length>0||ne._fileUploader.getImageFiles().length>0||ne._fileUploader.getAnimatedImageFiles().length>0||ne._fileUploader.getVideoFiles().length>0||ne._fileUploader.getAudioFiles().length>0||ne._fileUploader.getFiles().length>0)return true;if(ne._shareLinkUploader&&ne._shareLinkUploader.getAttachData())return true;if(ne._sharePreview&&ne._sharePreview.getShareData())return true;return false;}function ge(ne){if(!ne._blocked||ee(ne))return;ne._blocked=false;zd(ne);ne._sheetController.closeUploadWarningTabSheet();}function he(ne){ne._nubController.flyoutContentChanged();var oe=ne._getNode('attachmentShelf');oe.scrollTop=oe.scrollHeight;}function ie(ne,oe,pe){vb.sendSignal(uc({qn:ne._waterfallID,step:oe,uploader:vb.APP_CHAT},pe||{}));}function je(ne,oe,pe,qe,re){if(oe)gd.ensureThreadIsFetched(oe);this._threadID=ne;this._signatureID=pe;this._eventListeners=[];this._tabTemplate=yd(ne);this._tabElem=this._tabTemplate.getRoot();if(re){this.insertBefore(re);}else this.appendTo(qe);this._titlebar=this._getNode('nubFlyoutTitlebar');this._iconsContainerNode=this._getNode('iconsContainer');this._inputContainerNode=this._getNode('inputContainer');this._waterfallID=rc.generate();this._subscriptionsHandler=new hc();this._initializeAutoSendPhotoUploader();this._stickersFlyoutShown=false;var se=ta.scry(this._tabElem,"._1ia");if(se&&se.length>0){this._dropTarget=new ua(se[0]);this._dropTarget.setOnFilesDropCallback(this._filesDropped.bind(this));this._dropTarget.setOnURLDropCallback(this._linkDropped.bind(this));this._dropTarget.enable();}this._sheetController=new ha(this._threadID,this._getNode('sheet'),this._tabElem,this);if(t.get('chat_react_option_menu')){this._initializeReactMenu(this._getNode('fileAttachmentShelf'));}else{this._fileUploader=new gb(this._getNode('fileAttachmentShelf'),this._tabTemplate.getNode('attachButtonForm'),this._tabTemplate.getNode('fileInput'),this._tabTemplate.getNode('attachID'));this._initializeUploader(this._fileUploader);}this._initializeArchiveWarning();this._initializeAddToThreadButton();this._initializeVideoCallButton();this._initializeCloseButton();this._initializeTitle();this._sheetController.onClickNewMessagesSheet(function(){this._messagesView&&this._messagesView.scrollToBottom();this.focus();this.tryMarkAsRead();}.bind(this));this._sheetController.onClickThreadIsMutedSheet(function(){jd.unmute(this._threadID);this.focus();}.bind(this));this._nubController=new rb().init(this._tabElem);this._sheetController.onResize(this._nubController.flyoutContentChanged.bind(this._nubController));this._sheetController.onTokensChanged(function(xe,ye){kd.getThreadMeta(this._threadID,function(ze){this._updateControls(ze,ye.token_count);}.bind(this));}.bind(this));if(nd===null)nd=!t.get('seen_autosend_photo_nux');this._messagesView=null;if(t.get('chat_react_option_menu')){sc.getThreadURI(ne,function(xe){return this._setTitleHref(xe);}.bind(this));}else{var te=this._getNode('conversationLink');na.hide(te);id.renderWebMessengerLink(ne,te,function(){na.show(te);this._setTitleHref(te.href);}.bind(this));}if(!fb.getUserIDFromThreadID(this._threadID))this._titlebarTooltipAnchor=this._getNode('titlebarText');var ue=this._getCanonicalUserID();if(this._getCanonicalUserID()){ib.get(fb.getParticipantIDFromUserID(ue),function(xe){if(xe.href)this._setTitleHref(xe.href);}.bind(this));}else if(t.get('chat_react_option_menu')&&this._reactChatTabMenu.getURL()){this._setTitleHref(this._reactChatTabMenu.getURL());}else if(te&&te.href)this._setTitleHref(te.href);this._nubController.subscribe('resize',function(){this._resizeInputContainer();}.bind(this));this._setNameConversationLink();this._listen('closeButton','click',this._closeClicked);this._listen('dockButton','click',this._nubClicked);this._listen('dockButton','keydown',this._dockKeyDown);this._listen('nubFlyoutTitlebar','click',this._titleClicked);this._listen('chatConv','click',this._chatConvClicked);this._listen('inputContainer','click',this._inputContainerClicked);this._listen('addFriendLink','click',this._addFriendLinkClicked,true);this._listen('nameConversationLink','click',this._nameConversationLinkClicked,true);this._listen('clearWindowLink','click',this._clearHistory,true);this._listen('unsubscribeLink','click',this._unsubscribeLinkClicked,true);this._listen('reportSpamLink','click',this._reportSpamClicked,true);this._listen('createGroupLink','click',this._createGroupClicked,true);this._listen('enableDesktopNotif','click',this._enableDesktopNotif,true);this._listen('muteThreadLink','click',ob.showMuteChangeDialog.bind(null,this._threadID,null),true);this._listen('unmuteThreadLink','click',function(){jd.unmute(this._threadID);lc.hide();}.bind(this),true);this._listen('switchToWorkUserLink','click',this._switchToWorkUserClicked,true);this._listen('sheet','keydown',function(event){if(!event.getModifiers().any&&event.keyCode===cb.TAB){this._focusInput();event.kill();}}.bind(this));if(this._getNode('officeStatus'))this._listen('officeStatus','click',function(){return false;},true);this._stickersFlyoutToggler=this._getNode('emoticons');if(cc.WebStickerTrigger)this._stickerTriggerController=new ca(this._getNode('stickersTriggerFlyoutContainer'),this._getNode('emoticonIndicator'),this._stickersFlyoutToggler,this._stickerSelected.bind(this),this._searchStickers.bind(this));this._initializeInput();if(fc.shouldShowStickerSearchNUX())this._listen('emoticons','click',function(){if(fc.shouldShowStickerSearchNUX()){bc.selectPack(dc.SEARCH_PACK_ID);fc.clearShowStickerSearchNUX();}},true);if(t.get('chat_react_sticker_button')){this._stickerButton=yb.render(yb.createElement(ba,{className:"_4vui",flyoutAlignment:"left",onFlyoutShown:this._onFlyoutShown.bind(this),onFlyoutHidden:this._onFlyoutHidden.bind(this),onStickerSelect:this._stickerSelected.bind(this),onEmoticonSelect:this._emoticonSelected.bind(this)}),this._getNode('stickerButtonContainer'));m.bumpEntityKey('chat.web','sticker_button.mounting_attempted');}else{var ve=this._getNode('stickers');if(ve)this._stickersFlyout=yb.render(yb.createElement(ec,{onStickerSelect:function(xe){this._stickerSelected(xe);}.bind(this),onShown:this._onFlyoutShown.bind(this),onHidden:this._onFlyoutHidden.bind(this),onEmoticonSelect:this._emoticonSelected.bind(this),onEscKeyDown:this._hideStickersFlyoutIfShown.bind(this)}),ve);this._eventListeners.push(fc.addListener(fc.PACK_SELECTED,function(xe){if(this._stickersFlyout&&this._stickersFlyout.isMounted())this._stickersFlyout.setProps({packID:xe});}.bind(this)));}this._renderOrionTrigger();if(!this._isP2PEnabled())this._transferStoreSub=tb.addListener('change',this._onP2PTransferStoreChange.bind(this));this._privacyLink=this._getNode('privacyLink');if(this._privacyLink){this._privacyActionController=new y(ue,this._updatePrivacyLink.bind(this));this._eventListeners.push(xa.listen(this._privacyLink,'click',this._privacyActionController.togglePrivacy.bind(this._privacyActionController)));}kd.getThreadMeta(this._threadID,function(xe){this._setUpMutingSettings(xe);}.bind(this));z.removeEmptyHrefs(this._tabElem);md[ne]=this;this.updateAvailableStatus();this.updateTab();this._setCloseTooltip(false);var we={threadID:ne,userID:ue,signatureID:this._signatureID};new k('/ajax/chat/opentab_tracking.php',we).send();this._checkUnsentMessages=vc(function(){if(this._hasUnfinishedPost())return yc._("You haven't sent your message yet. Do you want to leave without sending?");if(ed.getNumberLocalMessages(this._threadID))return yc._("Your message is still being sent. Are you sure you want to leave?");return null;}.bind(this));zb.onBeforeUnload(this._checkUnsentMessages,false);this._logUnsentPhotos=vc(ke.bind(null,this));zb.onUnload(this._logUnsentPhotos);}function ke(ne){if(ne._photoUploader.isUploading())ie(ne,vb.CANCEL_DURING_UPLOAD);}function le(){for(var ne in md){md[ne].updateAvailableStatus();md[ne].updateMultichatTooltip();}}g.subscribe(['buddylist/availability-changed'],le);wb.subscribe(['privacy-changed','privacy-availability-changed'],le);r.subscribe(r.ON_CHANGED,function(){for(var ne in md)kd.getThreadMeta(ne,function(oe){md[ne]._updateUnreadCount(oe);});});pb.addRetroactiveListener('state-changed',function(ne){for(var oe in ne){var pe=ne[oe]&&ne[oe].length,qe=md[oe];qe&&qe.showTypingIndicator(pe);}});hd.subscribe('threads-updated',function(ne,oe){for(var pe in md){var qe=md[pe];oe[pe]&&qe.updateTab();if(qe._newThreadIDFromPhotoUpload&&!qe._photoUploader.isUploading()&&oe[qe._newThreadIDFromPhotoUpload]){da.closeTab(qe._threadID);w.openThread(qe._newThreadIDFromPhotoUpload,'ChatTabView');qe._newThreadIDFromPhotoUpload=null;}}});hd.subscribe('threads-deleted',function(ne,oe){for(var pe in md)oe[pe]&&da.closeTab(pe,'thread_deleted');});uc(je,h,{get:function(ne){return md[ne];}});uc(je.prototype,{getThreadID:function(){return this._threadID;},showAddFriend:function(){setTimeout((function(){this._sheetController.openAddFriendsSheet();}).bind(this),0);},showNameConversation:function(ne){setTimeout((function(){this._sheetController.openNameConversationSheet(ne);}).bind(this),0);},hideAutomaticNameConversation:function(){setTimeout((function(){this._sheetController.closeAutomaticNameConversationSheet();}).bind(this),0);},isVisible:function(){return na.shown(this._tabElem);},setVisibleState:function(ne,oe){var pe=na.shown(this._tabElem),qe=na.hasClass(this._tabElem,'opened');na.conditionShow(this._tabElem,ne);na.conditionClass(this._tabElem,'opened',oe);if(!(pe&&qe)&&ne&&oe){if(!this._messagesView)this._messagesView=new fa(this._threadID,this._sheetController,this._getNode('chatConv'),this._getNode('conversation'),this._getNode('loadingIndicator'),this._getNode('lastMessageIndicator'),this._getNode('typingIndicator'),this);this._nubController.flyoutContentChanged();this._messagesView.scrollToBottom();}if(pe&&qe&&!(ne&&oe))this._contextualDialogController&&this._contextualDialogController.tabNotActive();},focus:function(){if(na.hasClass(this._tabElem,'opened')){this._focusInput();}else this._getNode('dockButton').focus();},isFocused:function(){var ne=zc();return ub.byClass(ne,"_50mz")===this._tabElem;},hasEmptyInput:function(){var ne;if(t.get('chat_react_input')){if(!this._chatInput||!this._chatInput.isMounted())return false;ne=this._chatInput.getValue();}else ne=this._getNode('input').value;return ld.test(ne);},getInputElem:function(){if(t.get('chat_react_input')){if(!this._chatInput||!this._chatInput.isMounted())return null;return yb.findDOMNode(this._chatInput);}else return this._getNode('input');},setStickersFlyoutPackID:function(ne){if(this._stickerButton){this._setPackIDReact(ne);}else this._setPackIDLegacy(ne);},loadShareFromParams:function(ne,oe){this._shareLinkUploader&&this._shareLinkUploader.loadShareFromParams(ne,oe);if(this._sharePreview)this._sharePreview.setProps({share:{params:oe,type:ne},uri:null});},_linkDropped:function(ne){this._shareLinkUploader&&this._shareLinkUploader.loadShare(ne);if(this._sharePreview)this._sharePreview.setProps({share:null,uri:ne});},_filesDropped:function(ne){if(this._fileUploader)this._fileUploader.addDroppedFiles(ne);},_setPackIDLegacy:function(ne){var oe=this._stickersFlyout;if(!this._stickersFlyoutToggler||!oe||!oe.isMounted())return;bc.selectPack(ne);this._toggleStickersFlyoutShownLegacy(true);},_setPackIDReact:function(ne){if(!this._stickerButton.isMounted())return;bc.selectPack(ne);this._toggleStickersFlyoutShownReact(true);},_toggleStickersFlyoutShownReact:function(ne){this._stickerButton.showFlyout();this._stickersFlyoutShown=ne;},_toggleStickersFlyoutShownLegacy:function(ne){if(ne){lc.show(this._stickersFlyoutToggler);}else lc.hide(this._stickersFlyoutToggler);this._stickersFlyoutShown=ne;},_hideStickersFlyoutIfShown:function(){if(this._stickersFlyoutToggler&&this._stickersFlyout&&this._stickersFlyoutShown)this._toggleStickersFlyoutShownLegacy(false);},showStickerReplyNUX:function(){if(od)return;var ne=this._getNode('stickerButtonContainer')||this._getNode('emoticons');new j(tc.getURIBuilder().getURI()).setRelativeTo(ne).setData({thread_id:this._threadID}).setHandler(function(oe){fc.clearShowStickerReplyNUX();}).send();},insertBefore:function(ne){ra.insertBefore(ne._tabElem,this._tabElem);},appendTo:function(ne){ra.appendContent(ne,this._tabElem);},nextTabIs:function(ne){var oe=ne&&ne._tabElem;return this._tabElem.nextSibling==oe;},getScrollTop:function(){return ra.find(this._tabElem,'.fbNubFlyoutBody.scrollable').scrollTop;},setScrollTop:function(ne){ra.find(this._tabElem,'.fbNubFlyoutBody.scrollable').scrollTop=ne;},_unmountComponentAtNodeSafe:function(ne){var oe=this._getNode(ne);oe&&yb.unmountComponentAtNode(oe);},destroy:function(){this._selectionPosition&&this._selectionPosition.disable();while(this._eventListeners.length)this._eventListeners.pop().remove();if(this._dropTarget)this._dropTarget.disable();this._checkUnsentMessages&&this._checkUnsentMessages.cancel();this._logUnsentPhotos&&this._logUnsentPhotos.cancel();this._messagesView&&this._messagesView.destroy();this._sheetController&&this._sheetController.destroy();if(t.get('chat_react_option_menu')){yb.unmountComponentAtNode(this._getNode('menuContainer'));}else this._fileUploader&&this._fileUploader.destroy();if(t.get('chat_react_header')){yb.unmountComponentAtNode(this._getNode('addToThreadContainer'));this._unmountComponentAtNodeSafe('archiveContainer');this._unmountComponentAtNodeSafe('videoCallButtonContainer');yb.unmountComponentAtNode(this._getNode('closeButtonContainer'));yb.unmountComponentAtNode(this._getNode('titleContainer'));}if(t.get('chat_react_share_uploader')&&this._sharePreview&&this._sharePreview.isMounted()){yb.unmountComponentAtNode(yb.findDOMNode(this._sharePreview));}else this._shareLinkUploader&&this._shareLinkUploader.clear();try{yb.unmountComponentAtNode(this._getNode('photoUploaderContainer'));}catch(ne){m.bumpEntityKey('chat.web','chattab.unmount_failed');}if(t.get('chat_react_sticker_button')){yb.unmountComponentAtNode(this._getNode('stickerButtonContainer'));}else yb.unmountComponentAtNode(this._getNode('stickers'));if(cc.WebStickerTrigger)this._stickerTriggerController.destroy();this._subscriptionsHandler&&this._subscriptionsHandler.release();this._contextualDialogController&&this._contextualDialogController.destroy();this._privacyActionController&&this._privacyActionController.destroy();if(t.get('chat_react_input')){yb.unmountComponentAtNode(this._getNode('inputContainer'));}else bb.reset(this._getNode('input'));ra.remove(this._tabElem);delete md[this._threadID];qa.unregisterNubController(this._nubController);},updateAvailableStatus:function(){kd.getThreadMeta(this._threadID,function(ne){var oe=l.OFFLINE,pe=false,qe=this._getCanonicalUserID();if(qe){oe=xb.get(qe);pe=ya.isAvailableForWebrtcCalling(qe);}else{var re=ne.participants.map(function(te){return fb.getUserIDFromParticipantID(te);});oe=xb.getGroup(re);}if(!ja.isOnline())oe=l.OFFLINE;if(qe)this._updateCallLink();na.conditionClass(this._tabElem,"_5238",oe===l.ACTIVE);na.conditionClass(this._tabElem,"_4hwz",pe);na.conditionClass(this._tabElem,"_5239",oe===l.MOBILE);var se=this._getNode('presenceIndicator');switch(oe){case l.ACTIVE:se.setAttribute('alt',yc._("Online"));break;case l.MOBILE:se.setAttribute('alt',yc._("Mobile"));break;default:se.removeAttribute('alt');break;}}.bind(this));},updateTab:function(){this._setNameConversationLink();kd.getThreadMeta(this._threadID,function(ne){var oe=[this._getNode('name')];if(!t.get('chat_react_header')){oe.push(this._getNode('titlebarText'));}else if(this._title.isMounted())this._title.setProps({thread:ne},function(){this._getNode('chatWrapper').setAttribute('aria-label',this._title.getTitle());}.bind(this));id.renderAndSeparatedParticipantList(this._threadID,oe,{names_renderer:nb.renderShortNames,check_length:true});this._updateControls(ne);this._updateMutingSettings(ne);this._updateUnreadCount(ne);this.updateMultichatTooltip();this._updateArchiveWarning(ne);this._updateEmployeeAwayWarning(ne);this._updateOfficeStatus(ne);this._updateNewThread(ne);this._updateNameConversationSheet(ne);this._updateReadOnlySheet(ne);this._updateSwitchToWork(ne);}.bind(this));},_setNameConversationLink:function(){var ne=this._getNode('nameConversationLink');if(ne)kd.isEmptyLocalThread(this._threadID)?na.hide(ne):na.show(ne);},_updateNameConversationSheet:function(ne){if(mb.canReply(ne)&&!ne.name&&!ne.is_canonical&&!ne.name_conversation_sheet_dismissed&&!ne.has_email_participant&&!ne.read_only&&!kd.isEmptyLocalThread(ne.thread_id)){this.showNameConversation(true);}else this.hideAutomaticNameConversation();},_updateReadOnlySheet:function(ne){var oe=mb.canReply(ne),pe=kd.isEmptyLocalThread(ne.thread_id);if(!oe&&!pe)this._sheetController.openReadOnlySheet();},updateSignatureID:function(ne){this._signatureID=ne;},_showPhotoNUXIfNecessary:function(){if(nd){nd=false;new j('/ajax/chat/photo_nux.php').setRelativeTo(this._getNode('photoUploaderContainer')).setData({threadID:this._threadID}).send();return true;}},_setUpMutingSettings:function(ne){var oe=mb.isMuted(ne);if(oe)this._sheetController.openThreadIsMutedTabSheet();this._updateActionMenu(oe);},_updateMutingSettings:function(ne){var oe=mb.isMuted(ne),pe;if(t.get('chat_react_option_menu')){pe=this._reactChatTabMenu.props.isMuted;}else pe=na.shown(this._getNode('unmuteThreadLink').parentNode);if(oe&&!pe){this._sheetController.openThreadIsMutedTabSheet();}else if(!oe&&pe)this._sheetController.closeThreadIsMutedTabSheet();this._updateActionMenu(oe);},_updateActionMenu:function(ne){if(t.get('chat_react_option_menu')){this._reactChatTabMenu.isMounted()&&this._reactChatTabMenu.setProps({isMuted:ne});}else{na.conditionShow(this._getNode('muteThreadLink').parentNode,!ne);na.conditionShow(this._getNode('unmuteThreadLink').parentNode,ne);}},_updateArchiveWarning:function(ne){if(ma.isEmployee())ib.getMulti(ne.participants,this._showArchiveWarningIfAllParticipantsAreEmployees.bind(this));},_updateEmployeeAwayWarning:function(ne){v.updateEmployeeAwayWarning(ne,function(){this._sheetController.openEmployeeAwaySheet();}.bind(this),function(){});},_updateOfficeStatus:function(ne){var oe=this._getNode('officeStatus');if(!oe||fb.isMultichat(ne.thread_id))return;var pe=fb.getParticipantIDFromUserID(ne.canonical_fbid);ib.get(pe,function(qe){ga.update(oe,qe);});},_updateSwitchToWork:function(ne){if(ma.isEmployee()&&ma.hasWorkUser()&&fb.isMultichat(ne.thread_id)){ib.getMulti(ne.participants,function(oe){this._showSwitchToWork(this._isEmployeesOnly(oe));}.bind(this));}else this._showSwitchToWork(false);},_updateControls:function(ne,oe){var pe=false;if(ne&&ne.thread_id){var qe=fb.tokenize(ne.thread_id);if(qe.type==='user'){var re=qe.value;pe=!gd.isUser(re);}}var se=mb.canReply(ne)&&(!ad(ne.participants)||!!oe);na.conditionShow(this._inputContainerNode,se);na.conditionShow(this._iconsContainerNode,se);if(!t.get('chat_react_option_menu')){na.conditionShow(this._getNode('dropdown'),se);}else if(this._reactChatTabMenu.isMounted()){this._reactChatTabMenu.setProps({isEmptyChat:kd.isNewEmptyLocalThread(ne.thread_id),show:se});if(pe)this._reactChatTabMenu.setProps({showAddFriend:null});}var te=se&&!pe;if(t.get('chat_react_header')){this._addToThreadButton.isMounted()&&this._addToThreadButton.setProps({shown:te});}else na.conditionShow(this._getNode('addToThreadLink'),te);this._resizeInputContainer();this._updateOrionTrigger(se);},_updateOrionTrigger:function(ne){if(this._orionTrigger&&ne){this._setOrionTriggerProps();}else if(!this._orionTrigger)this._renderOrionTrigger();},_setOrionTriggerProps:function(){var ne=this.getParticipantIDForOrionNUX(),oe=true;na.conditionShow(this._orionTriggerContainer,ne);if(ne){ib.get(ne,function(pe){pe=ab.set(pe,{userId:this._getUserIdFromParticipantID(ne)});if(pe.orion_eligible||tb.hasReceivedFromSender(pe.userId))oe=false;this._orionTrigger.setProps({receiver:pe,disabled:oe});}.bind(this));}else this._orionTrigger.setProps({receiver:{}});},_getUserIdFromParticipantID:function(ne){return fb.getUserIDFromParticipantID(ne);},_onP2PTransferStoreChange:function(){this._renderOrionTrigger();if(this._transferStoreSub){this._transferStoreSub.remove();this._transferStoreSub=null;}},_isP2PEnabled:function(){return t.get('p2p_enabled');},_renderOrionTrigger:function(){var ne=this._isP2PEnabled()||tb.hasTransfers();if(ne){this._orionTriggerContainer=this._getNode('orionTriggerContainer');this._orionTrigger=yb.render(yb.createElement(sb,{onTrigger:this._orionTriggered.bind(this)}),this._orionTriggerContainer);na.addClass(this._inputContainerNode,"_11d6");this._setOrionTriggerProps();}},getParticipantIDForOrionNUX:function(){var ne=this._sheetController.getAddFriendsTabSheet(),oe=ne.getParticipants(),pe=this._getCanonicalUserID(),qe=null;if(pe){qe=fb.getParticipantIDFromUserID(pe);}else if(oe&&oe.length===1)qe=oe[0];return qe;},_resizeInputContainer:function(){var ne=this._tabElem.clientWidth,oe=2,pe=ne-(this._inputContainerNode.clientWidth+oe),qe=db.isRTL()?'left':'right';gc.set(this._iconsContainerNode,qe,pe+'px');if(!t.get('chat_react_input'))kc.getInstance(this._getNode('input')).update();},_updateNewThread:function(ne){if(kd.isNewEmptyLocalThread(ne.thread_id))this.showAddFriend();},_isEmployeesOnly:function(ne){for(var oe in ne)if(!ne[oe].employee)return false;return true;},_showArchiveWarningIfAllParticipantsAreEmployees:function(ne){var oe=this._isEmployeesOnly(ne),pe=t.get('chat_react_header'),qe=pe?this._getNode('archiveContainer'):this._getNode('titanArchiveWarning');if(qe){if(this._titlebarTooltipAnchor)na.conditionClass(this._titlebarTooltipAnchor,'narrowTitleBar',oe);if(pe){this._archiveWarning.isMounted()&&this._archiveWarning.setProps({shown:oe});}else na.conditionShow(qe,oe);}},_showSwitchToWork:function(ne){if(!t.get('chat_react_option_menu')){var oe=this._getNode('switchToWorkUserLink');if(oe)na.conditionShow(oe,ne);}else if(this._reactChatTabMenu.isMounted())this._reactChatTabMenu.setProps({hasSwitchToWork:ne});},updateMultichatTooltip:function(){kd.getThreadMeta(this._threadID,function(ne){if(!ne.is_canonical){var oe;if(t.get('chat_react_header')){oe=yb.findDOMNode(this._title);}else oe=this._titlebarTooltipAnchor;sd(oe,ne.participants);}}.bind(this));},_getNode:function(ne){return this._tabTemplate.getNode(ne);},_getCanonicalUserID:function(){return fb.getUserIDFromThreadID(this._threadID);},_listen:function(ne,event,oe,pe){var qe=this._getNode(ne);if(qe){this._eventListeners.push(xa.listen(qe,event,oe.bind(this)));}else if(!pe)throw new Error('Could not find node "'+ne+'"');},_closePreClicked:function(ne){this._closeMouseDown=true;},_closeClicked:function(ne){ke(this);da.closeTab(this._threadID);if(ne instanceof ic){ne.stopPropagation();return;}ne.kill();},_closeEnter:function(ne){if(ne.keyCode===cb.RETURN)this._closeClicked(ne);},_nubClicked:function(ne){ne.kill();return je.inform('nub-activated',this._threadID);},_dockKeyDown:function(event){if(event.keyCode===cb.RETURN||event.keyCode===cb.SPACE){je.inform('nub-activated',this._threadID);event.kill();}else this._handleHotkeyPressed(event);},_handleHotkeyPressed:function(event){if(event.keyCode===cb.ESC){this._handleEscape();if(t.get('chat_react_input'))event=new sa(event);event.kill();}else if(event.keyCode===cb.TAB)this._handleTabPressed(event);},_handleTabPressed:function(event){if(!event.ctrlKey){var ne=je.inform('tab-pressed',{id:this._threadID,shiftPressed:event.shiftKey});if(t.get('chat_react_input'))event=new sa(event);!ne&&event.kill();return true;}},_handleEscape:function(){if(this._stickersFlyoutShown){this._stickerButton?this._toggleStickersFlyoutShownReact(false):this._toggleStickersFlyoutShownLegacy(false);return;}ke(this);if(this.hasEmptyInput()){je.inform('esc-pressed',this._threadID);}else{var ne=yc._("Are you sure you want to close this chat window?"),oe=yc._("You haven't sent your message."),pe=new pa().setTitle(ne).setBody(oe).setButtons([pa.CLOSE,pa.CANCEL]).setHandler(je.inform.bind(je,'esc-pressed',this._threadID,null)).setModal(true).show(),qe=pe.getButtonElement('yes');qe&&za.set(qe);}},_titleClicked:function(event){var ne=event.getTarget();if(!ub.byClass(ne,'titlebarText')&&!ub.byClass(ne,'uiSelector')&&!ub.byClass(ne,'addToThread')&&!ub.byClass(ne,'optionMenu')&&!ub.byClass(ne,'videoicon')&&!ub.byClass(ne,'close')){event.kill();da.lowerTab(this._threadID);this.focus();}},_callEnter:function(ne){if(ne.keyCode===cb.RETURN)this._callClicked(ne);},_callClicked:function(ne){if(ne.target)ne.target.blur();var oe=this._getCanonicalUserID();if(ya.isAvailableForWebrtcCalling(oe)){var pe='chat_tab_icon';if(ne.target&&na.hasClass(ne.target,'video_call_tour'))pe='chat_tab_icon_tour';je.inform('video-call-clicked',{threadID:this._threadID,userID:oe,clickSource:pe});}if(t.get('chat_react_header')){ne.stopPropagation();}else return false;},_addFriendLinkClicked:function(){this.showAddFriend();},_nameConversationLinkClicked:function(){this.showNameConversation();},_showParticipantsClicked:function(){gd.getServerThreadID(this._threadID,function(ne){i.send(new j(pc('/ajax/browser/dialog/multichat_members/').addQueryData({id:ne})));});},_clearHistory:function(){var ne=kd.getThreadMetaNow(this._threadID);if(ne){var oe=this._getCanonicalUserID();gd.clearChat(this._threadID,oe,ne.timestamp);}},_unsubscribeLinkClicked:function(){var ne=[];ne.push({name:'unsubscribe',label:yc._("Leave Conversation"),handler:this._unsubscribeToThread.bind(this)});ne.push(pa.CANCEL);new pa().setTitle(yc._("Leave conversation?")).setBody(yc._("You will stop receiving messages from this conversation and people will see that you left.")).setButtons(ne).show();},_switchToWorkUserClicked:function(){var ne=[];ne.push({name:'move',label:yc._("Move Conversation"),handler:this._switchToWork.bind(this)});ne.push(pa.CANCEL);new pa().setTitle(yc._("Move Conversation to Work Account?")).setBody(yc._("Do you want to move this conversation so that it is shown in your work account instead?")).setButtons(ne).show();},_getUserParticipants:function(ne){var oe=[];ne.forEach(function(pe){var qe=fb.getUserIDFromParticipantID(pe);qe&&oe.push(qe);});return oe;},_createGroupClicked:function(){kd.getThreadMeta(this._threadID,function(ne){if(!ne.is_canonical){var oe=pc('/ajax/groups/create_get.php').addQueryData({ref:'web_messenger_dock',parent_id:'0'}),pe=this._getUserParticipants(ne.participants);oe.addQueryData({members:pe});if(ne.name)oe.addQueryData({name:ne.name});i.send(new j(oe));}}.bind(this));},_enableDesktopNotif:function(){Notification.requestPermission();},_reportSpamClicked:function(){var ne=this._getCanonicalUserID(),oe=pc('/ajax/chat/report.php').addQueryData({id:ne}).addQueryData({src:'top_report_link'});i.send(new j(oe));},_inputPasted:function(event){if(qc.chrome()){var ne=event.clipboardData||event.originalEvent.clipboardData;if(!ne||!ne.items||ne.items.length<1)return;var oe=ne.items[0].type;if(oe!=='image/png')return;if(ne.items[0].getAsFile){var pe=ne.items[0].getAsFile();this._photoUploader.uploadFile(pe);}}},_focusInput:function(){if(t.get('chat_react_input')){this._chatInput&&this._chatInput.isMounted()&&this._chatInput.focus();}else this._getNode('input').focus();},_focusTab:function(){na.addClass(this._tabElem,'focusedTab');this.tryMarkAsRead();this._contextualDialogController&&this._contextualDialogController.tabFocused();if(!od&&this._showPhotoNUXIfNecessary())g.subscribe(['ChatNUX/show','ChatNUX/hide'],function(event){od=event==='ChatNUX/show';});this._closeMouseDown=false;this._setCloseTooltip(true);je.inform('focus-tab',this._threadID);},_blurTab:function(){na.removeClass(this._tabElem,'focusedTab');!this._closeMouseDown&&this._setCloseTooltip(false);},_setCloseTooltip:function(ne){if(t.get('chat_react_header')){this._closeButton.isMounted()&&this._closeButton.setProps({active:ne});return;}var oe=this._getNode('titlebarCloseButton'),pe=ne?yc._("Press Esc to close"):yc._("Close tab");mc.set(oe,pe,'above');},_inputKeyDown:function(event){this.tryMarkAsRead();if(event.keyCode===cb.RETURN&&!event.shiftKey){if(ee(this)){ce(this);event.kill&&event.kill();return;}zd(this);if(cc.WebStickerTrigger)this._stickerTriggerController.activateAfterparty();event.kill&&event.kill();return;}if(event.keyCode===cb.DOWN&&event.shiftKey&&this.hasEmptyInput()){event.kill&&event.kill();da.lowerTab(this._threadID);this.focus();return;}this._handleHotkeyPressed(event);},_initializeInput:function(){if(!t.get('chat_react_input')){var ne=this._inputContainerNode.clientHeight;kc.getInstance(this._getNode('input')).subscribe('resize',function(){var oe=this._inputContainerNode.clientHeight;if(oe!=ne)this._nubController.flyoutContentChanged();ne=oe;}.bind(this));this._listen('input','focus',this._focusTab);this._listen('input','blur',this._blurTab);this._listen('input','paste',this._inputPasted);if(qc.firefox()&&oa.get()=='ko_KR'){this._listen('input','keyup',this._inputKeyDown);}else this._listen('input','keydown',this._inputKeyDown);this._initializeThingsWithInputFn(this._tabTemplate.getNode('input'));}else{this._chatInput=yb.render(yb.createElement(cd,{initializeThingsWithInputFn:this._initializeThingsWithInputFn.bind(this),inputChanged:function(oe){if(cc.WebStickerTrigger)this._stickerTriggerController.updateInput(oe);}.bind(this),inputKeyDown:this._inputKeyDown.bind(this),onAddMention:this._onAddMention.bind(this),onBlur:this._blurTab.bind(this),onEscape:this._handleEscape.bind(this),onFocus:this._focusTab.bind(this),onTab:this._handleTabPressed.bind(this),openFlyoutFn:this._toggleStickersFlyoutShownLegacy.bind(this,true),stickersFlyoutToggler:this._stickersFlyoutToggler,searchTriggeredWord:function(){this._toggleStickersFlyoutShownLegacy(true);this._searchStickers(this._stickerTriggerController.getTriggeredWord());}.bind(this),resizeFn:function(oe){gc.set(this._getNode('inputContainer'),'height',oe+'px');this._nubController.flyoutContentChanged();}.bind(this),uploadPhotoFn:this._photoUploader.uploadFile}),this._getNode('chatInputContainer'));if(cc.WebStickerTrigger)this._stickerTriggerController.setInput(this._chatInput);}},_initializeSharePreview:function(ne,oe){this._sharePreview=yb.render(yb.createElement(kb,{imageSize:{width:qd,height:qd},location:jb.CHAT_PREVIEW,onClose:this._focusInput.bind(this),onUpdate:function(){he(this);ge(this);}.bind(this)}),this._getNode('shareAttachmentShelf'));xa.listen(ne,'keyup',function(){var pe=oe?oe():ne.value;!pe.length&&this._urlScraper.reset();}.bind(this));this._urlScraper=new oc(ne,oe);this._urlScraper.subscribe('match',function(pe,qe){this._sharePreview.setProps({share:null,uri:(qe&&qe.url)});}.bind(this));},_initializeThingsWithInputFn:function(ne,oe){if(t.get('chat_react_share_uploader')){this._initializeSharePreview(ne,oe);}else{this._shareLinkUploader=new aa(this._getNode('shareAttachmentShelf'),ne,this.focus.bind(this),oe,this._appendTextToInput.bind(this));this._initializeUploader(this._shareLinkUploader);}kd.getThreadMeta(this._threadID,function(pe){gd.getServerThreadID(this._threadID,function(qe){this._typingDetector=new nc(this._getCanonicalUserID(),ne,'mercury-chat',null,qe,oe);}.bind(this));}.bind(this));},_getInputValue:function(){if(t.get('chat_react_input')){if(!this._chatInput||!this._chatInput.isMounted())return '';return this._chatInput.getValue()||'';}else return this._tabTemplate.getNode('input').value||'';},_appendTextToInput:function(ne){if(t.get('chat_react_input')){if(this._chatInput&&this._chatInput.isMounted())this._chatInput.appendText(ne);}else this._getNode('input').value+=ne;},_hasUnfinishedPost:function(){return fe(this)||de(this);},tryMarkAsRead:function(){if(!this._messagesView||this._messagesView.isScrolledToBottom()){jd.markRead(this._threadID);jd.markSeen(this._threadID);return true;}return false;},_chatConvClicked:function(ne){this.tryMarkAsRead();if(ub.byTag(ne.getTarget(),'a')||ra.getSelection())return;this.focus();},_inputContainerClicked:function(ne){this.tryMarkAsRead();this.focus();},showTypingIndicator:function(ne){if(t.get('chat_closed_tab_typing_indicator_animated')){var oe=ra.find(this._tabElem,"._54m9");if(ne){this._animatedTypingIndicator=yb.render(yb.createElement(o,{bootloadPlaceholder:yb.createElement("span",null),bootloadComponent:function(pe){n.loadModules(["MercuryTypingAnimation.react"],pe);}}),oe);this._updateAnimatedIndicatorColor();na.addClass(this._tabElem,"_54m8");na.show(oe);}else{na.removeClass(this._tabElem,"_54m8");na.hide(oe);yb.unmountComponentAtNode(oe);this._animatedTypingIndicator=null;}}else na.conditionClass(this._tabElem,'typing',ne);},_updateAnimatedIndicatorColor:function(){if(this._animatedTypingIndicator){var ne=na.hasClass(this._tabElem,'highlightTab')?'light':'dark';this._animatedTypingIndicator.setProps({color:ne});}},_updateUnreadCount:function(ne){var oe=ne.unread_count;if(typeof oe!='undefined'){var pe=!!oe&&(!r.showsTabUnreadUI||r.showsTabUnreadUI()),qe=this._getNode('numMessages');na.conditionShow(qe,pe);na.conditionClass(this._tabElem,'highlightTab',pe);this._updateAnimatedIndicatorColor();wd(this._threadID,this._tabElem,pe);ra.setContent(qe,oe);}},_updateCallLink:function(){var ne=this._getCanonicalUserID();if(ne===ma.getID()){this._hideVideoCallouts();if(t.get('chat_react_header')){this._videoCallButton.isMounted()&&this._videoCallButton.setProps({shown:false});}else na.hide(this._getNode('videoCallLink'));return;}var oe=ya.callabilityForUser(ne),pe=fb.getParticipantIDFromUserID(ne);if(oe!=ya.CallabilityStatus.AVAILABLE)this._hideVideoCallouts();ib.get(pe,function(qe){this._setVideoCallTooltip(ya.generateCallButtonTooltip(qe.short_name,oe));}.bind(this));},_setVideoCallTooltip:function(ne){if(t.get('chat_react_header')){this._videoCallButton.isMounted()&&this._videoCallButton.setProps({tooltipLabel:ne});}else mc.set(this._getNode('videoCallLink'),ne);},_hideVideoCallouts:function(){this._contextualDialogController.hideVideoCallouts();},_updatePrivacyLink:function(ne){var oe;if(ne==y.OFFLINE){oe=yc._("Go online");if(t.get('chat_react_option_menu')){this._reactChatTabMenu.isMounted()&&this._reactChatTabMenu.setProps({privacyText:oe});}else ra.setContent(this._privacyLink,oe);return;}var pe=this._getCanonicalUserID();if(!pe)return;var qe='fbid:'+pe;ib.get(qe,function(re){if(ne==y.BLOCKED){oe=yc._("Turn On Chat for {name}",[yc.param("name",re.short_name)]);}else oe=yc._("Turn Off Chat for {name}",[yc.param("name",re.short_name)]);if(t.get('chat_react_option_menu')){this._reactChatTabMenu.isMounted()&&this._reactChatTabMenu.setProps({privacyText:oe});}else ra.setContent(this._privacyLink,oe);}.bind(this));},_unsubscribeToThread:function(){if(!kd.isEmptyLocalThread(this._threadID)){var ne=fd.constructLogMessageObject(lb.CHAT_WEB,this._threadID,hb.UNSUBSCRIBE,{removed_participants:[qb.getID()]});dd.send(ne);}da.closeTab(this._threadID,'unsubscribed');return true;},_switchToWork:function(){if(!kd.isEmptyLocalThread(this._threadID)){var ne=fd.constructLogMessageObject(lb.CHAT_WEB,this._threadID,hb.SWITCH_TO_WORK,{removed_participants:[qb.getID()]});dd.send(ne);}da.closeTab(this._threadID,'unsubscribed');return true;},_initializeUploader:function(ne){this._subscriptionsHandler.addSubscriptions(ne.subscribe(['all-uploads-completed','upload-canceled'],function(){ge(this);}.bind(this)),ne.subscribe('dom-updated',function(){he(this);}.bind(this)),ne.subscribe('submit',function(){this._focusInput();}.bind(this)));},_initializeReactMenu:function(ne){var oe=this._getNode('menuContainer'),pe=fb.isMultichat(this._threadID),qe=kd.isNewEmptyLocalThread(this._threadID),re=this._sheetController.openAddFriendsSheet.bind(this._sheetController);if(oe)this._reactChatTabMenu=yb.render(yb.createElement(ea,{onFileUploaderMounted:this.setFileUploader.bind(this),updatePrivacyLinkFunc:this._updatePrivacyLink.bind(this),nameConversationFunc:this._nameConversationLinkClicked.bind(this),showParticipantsFunc:this._showParticipantsClicked.bind(this),leaveConversationFunc:this._unsubscribeLinkClicked.bind(this),clearHistoryFunc:this._clearHistory.bind(this),reportSpamFunc:this._reportSpamClicked.bind(this),createGroupFunc:this._createGroupClicked.bind(this),switchToWorkFunc:this._switchToWorkUserClicked.bind(this),isMultichat:pe,isEmptyChat:qe,showAddFriend:re,threadID:this._threadID,attachmentsShelf:ne,onUploadFinished:ge.bind(this,this),onUpdateAttachmentsShelf:he.bind(this,this),onSubmit:this._focusInput.bind(this),enableDesktopNotif:function(){this._enableDesktopNotif();}.bind(this)}),oe);},_initializeArchiveWarning:function(){if(t.get('chat_react_header'))this._archiveWarning=yb.render(yb.createElement(q,{isFBAtWork:t.IsWorkUser,shown:true}),this._getNode('archiveContainer'));},_initializeAddToThreadButton:function(){if(t.get('chat_react_header')){this._addToThreadButton=yb.render(yb.createElement(p,{isFBAtWork:t.get('IsWorkUser',false),onClick:this._addFriendLinkClicked.bind(this),shown:true}),this._getNode('addToThreadContainer'));}else this._listen('addToThreadLink','click',this._addFriendLinkClicked,true);},_initializeVideoCallButton:function(){if(!fb.getUserIDFromThreadID(this._threadID))return;var ne=null;if(t.get('chat_react_header')){this._videoCallButton=yb.render(yb.createElement(ka,{shown:true,onClick:this._callClicked.bind(this),onKeyUp:this._callEnter.bind(this)}),this._getNode('videoCallButtonContainer'));ne=yb.findDOMNode(this._videoCallButton);}else{ne=this._getNode('videoCallLink');this._listen('videoCallLink','click',this._callClicked,true);this._listen('videoCallLink','keyup',this._callEnter,true);}this._contextualDialogController=new u(this._threadID,ne);},_initializeCloseButton:function(){if(t.get('chat_react_header')){this._closeButton=yb.render(yb.createElement(s,{onClick:this._closeClicked.bind(this),onKeyUp:this._closeEnter.bind(this),onMouseDown:this._closePreClicked.bind(this)}),this._getNode('closeButtonContainer'));}else{this._listen('titlebarCloseButton','click',this._closeClicked);this._listen('titlebarCloseButton','keyup',this._closeEnter);this._listen('titlebarCloseButton','mousedown',this._closePreClicked);}},_initializeTitle:function(){if(t.get('chat_react_header')){var ne=kd.getThreadMetaNow(this._threadID);this._title=yb.render(yb.createElement(ia,{isNewThread:kd.isNewEmptyLocalThread(this._threadID),thread:ne,viewer:ma.getID()}),this._getNode('titleContainer'));}},setFileUploader:function(ne){this._fileUploader=ne;},_initializeAutoSendPhotoUploader:function(){this._photoUploader=yb.render(yb.createElement(x,{onSubmit:this._handlePUSubmit.bind(this),onAllUploadsComplete:this._handlePUAllUploadsCompleted.bind(this),onLastUploadFail:this._handlePULastUploadFailed.bind(this),onLastUploadCancel:this._handlePULastUploadCanceled.bind(this)}),this._getNode('photoUploaderContainer'));},_handlePUSubmit:function(ne,oe){ie(this,vb.UPLOAD_START,oe);be(this,'',[],function(pe){if(this._threadID!==pe.thread_id){this._newThreadIDFromPhotoUpload=pe.thread_id;if(this._messagesView)this._messagesView.setNewThreadID(pe.thread_id);}pe.content_attachment=null;dd.addAttachmentPlaceholder(pe,oe.upload_id,oe);}.bind(this));me('submit',oe);this._focusInput();},_handlePULastUploadFailed:function(ne,oe){ie(this,vb.CLIENT_ERROR,oe);me('failed',oe);dd.cancelAttachmentPlaceholder(oe.upload_id,oe);var pe=yc._("Photo Upload Failed"),qe=yc._("Please try again. Make sure you are uploading a valid photo.");new pa().setTitle(pe).setBody(qe).setButtons(pa.OK).show();},_handlePULastUploadCanceled:function(ne,oe){ie(this,vb.CANCEL_DURING_UPLOAD,oe);me('canceled',oe);dd.cancelAttachmentPlaceholder(oe.upload_id,oe);},_handlePUAllUploadsCompleted:function(ne,oe){ie(this,vb.ALL_UPLOADS_DONE,oe);me('completed',oe);dd.confirmAttachmentPlaceholder(oe.upload_id,oe);var pe=oe.image_ids.length||oe.attachments.length;ae(this,pe);},_stickerSelected:function(ne){be(this,'',[],function(oe){oe.has_attachment=true;oe.sticker_id=ne;dd.send(oe);this.focus();}.bind(this));this._messagesView&&this._messagesView.scrollToBottom();},_emoticonSelected:function(ne){var oe=va.symbols[ne];if(!oe)return;if(t.get('chat_react_input')){this._chatInput.insertEmoticon(oe);return;}this._selectionPosition=this._selectionPosition||new ac(this._getNode('input'));var pe=kc.getInstance(this._getNode('input')),qe=pe.getValue(),re=wa.insertEmoticon(oe,qe,this._selectionPosition.getPos());pe.setValue(re.result);this._selectionPosition.setPos(re.start,re.end);},_orionTriggered:function(){be(this,'',[],function(ne){this.focus();}.bind(this));this._messagesView&&this._messagesView.scrollToBottom();},_addStickerSearchNUXIndicator:function(){na.addClass(this._getNode('emoticonIndicator'),'nux');od=false;},_onFlyoutShown:function(ne){if(t.get('chat_react_sticker_button')){var oe=this._stickersFlyout.props.packID;if(oe!==dc.SEARCH_PACK_ID)this.focus();}if(cc.WebStickerTrigger){this._stickerTriggerController.onFlyoutShown(ne);}else ne();this._stickersFlyoutShown=true;},_searchStickers:function(ne,oe){this._stickersFlyout.isMounted()&&this._stickersFlyout.setProps({packID:dc.SEARCH_PACK_ID,trigger:ne},oe);},_onFlyoutHidden:function(){this._stickersFlyoutShown=false;this.focus();},_setTitleHref:function(ne){if(t.get('chat_react_header')){this._title.isMounted()&&this._title.setProps({href:ne});}else{var oe=this._getNode('titlebarText');oe.setAttribute('href',ne);oe.removeAttribute('rel');na.removeClass(oe,'noLink');}},_onAddMention:function(ne){this._linkDropped((new pc(ne.getURI())).getQualifiedURI().toString());}});function me(ne,oe){rd.debug('photo_uploader:'+ne,Object.assign({},oe));}e.exports=je;},null);
__d("ChatNewMessageHandler",["ChatActivity","ChatMentionsNotifications","ChatTabModel","ChatTabView","JSLogger","MercuryAssert","MercuryBrowserAlerts","UserActivity","MercuryConfig","MercuryThreadlistConstants"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){b.__markCompiled&&b.__markCompiled();var q=k.create('chat_new_message'),r={_notify:function(s,t,u){if(o.DesktopNotificationsGK)h.notifyIfMessageToMe(t);var v=j.get(s);u.view_is_visible=v&&v.isVisible();u.view_is_focused=v&&v.isFocused();if(!u.view_is_visible)q.log('message_to_hidden');u.is_active=g.isActive();m.messageReceived(t);},newMessage:function(s,t){l.isThreadID(s);var u=i.getTab(s),v={thread_id:s,message_id:t.message_id,to_new_tab:!u,to_raised_tab:u?!!u.raised:true};this._notify(s,t,v);q.log('message',v);}};m.subscribe('before-alert',function(s,event){var t=event.threadID,u=j.get(t),v=i.getTab(t),w=p.MESSAGE_NOTICE_INACTIVITY_THRESHOLD;if(v&&v.raised&&u&&u.isVisible()&&u.isFocused()&&n.isActive(w)){u.tryMarkAsRead();event.cancelAlert();}});e.exports=r;},null);
__d("ChatTabLRUManager",["ChatTabView","ChatTabModel","InitialServerTime","MercuryThreads"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();var j=b('MercuryThreads').get(),k={getLRUVisibleTab:function(l){if(l.hasRoomForRaisedTab())return (void 0);var m=Object.keys(l.getTabsToShow()||{}),n=1*60,o=null,p=Infinity;for(var q=0;q<m.length;q++){var r=m[q],s=j.getThreadMetaNow(r);if(h.isTabPromoted(r))continue;if(!g.get(r).hasEmptyInput()||!s)continue;var t=(i.serverTime-s.timestamp)/1000;if(!s.timestamp||(s.timestamp&&s.timestamp<p&&t>n)){o=s.thread_id;p=s.timestamp;}}return o;}};e.exports=k;},null);
__d("ChatTabPolicy",["ChatBehavior","JSLogger","MercuryActionType","MercuryLogMessageType","MercuryAssert","MercuryIDs","MercuryParticipantTypes","MercurySourceType","MercuryThreadInfo","MercuryThreadMode","MercuryViewer","MessagingTag","PresencePrivacy","ShortProfiles","MercuryThreadActions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();var u=b('MercuryThreadActions').get(),v=h.create('tab_policy');e.exports={messageIsAllowed:function(w,x,y){var z=w.thread_id,aa=x.message_id;k.isThreadID(z);k.isParticipantID(x.author);var ba;if(o.isMuted(w)){ba={thread_id:z,message_id:aa,mute_settings:w.mute_settings};v.log('message_thread_muted',ba);return;}if(w.mode==p.OBJECT_ORIGINATED){ba={thread_id:z,message_id:aa,mode:w.mode};v.log('message_object_originated',ba);return;}if(x.source==n.EMAIL||x.source==n.TITAN_EMAIL_REPLY){ba={thread_id:z,message_id:aa,source:x.source};v.log('message_source_not_allowed',ba);return;}var ca=l.getUserIDFromParticipantID(x.author);if(!ca){v.log('message_bad_author',{thread_id:z,message_id:aa,user:ca});return;}if(x.action_type!=i.USER_GENERATED_MESSAGE&&!this._messageIsNewlyCreatedGroup(x,w)){ba={thread_id:z,message_id:aa,type:x.action_type};v.log('message_non_user_generated',ba);return;}if(w.is_canonical_user&&!g.notifiesUserMessages()){v.log('message_jabber',{thread_id:z,message_id:aa});u.markSeen(z,true);return;}if(w.is_canonical&&!w.canonical_fbid){v.log('message_canonical_contact',{thread_id:z,message_id:aa});return;}if(w.folder!=r.INBOX){v.log('message_folder',{thread_id:z,message_id:aa,folder:w.folder});return;}var da=l.getUserIDFromParticipantID(q.getID());t.getMulti([ca,da],function(ea){if(!s.allows(ca)){v.log('message_privacy',{thread_id:z,message_id:aa,user:ca});return;}var fa=ea[ca].employee&&ea[da].employee;if(!fa&&ea[ca].type!==m.FRIEND){v.log('message_non_friend',{thread_id:z,message_id:aa,user:ca});return;}y();});},_messageIsNewlyCreatedGroup:function(w,x){return w.action_type===i.LOG_MESSAGE&&w.log_message_type===j.THREAD_NAME&&x.message_count===1;}};},null);
__d("ChatTabViewSelector",["Event","Arbiter","ChatTabActions","CSS","DataStore","DOM","MenuDeprecated","NubController","ChatTabTemplates","Toggler","copyProperties","MercuryThreadInformer","MercuryThreads","MercuryThreadMetadataRenderer"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();var r=b('MercuryThreadInformer').get(),s=b('MercuryThreads').get(),t=b('MercuryThreadMetadataRenderer').get();function u(v){var w=o[':fb:chat:tab:selector'].build(),x=w.getRoot(),y=w.getNode('menu'),z=l.find(y,'.uiMenuInner'),aa={},ba=new n().init(x);j.hide(x);l.insertBefore(v,x);function ca(fa){var ga=0;for(var ha in aa){var ia=aa[ha],ja=s.getThreadMetaNow(ha),ka=ia.getNode('unreadCount'),la=(ja&&ja.unread_count)||0;ga+=la;if(la>9)la='+';j.conditionClass(ka,'invisible_elem',!la);l.setContent(ka,la);}var ma=w.getNode('numMessages');j.conditionShow(ma,ga);l.setContent(ma,ga);}this.setTabData=function(fa){aa={};if(fa.length<1){j.hide(x);return;}j.show(x);l.empty(z);fa.forEach(function(ga){var ha=o[':fb:chat:tab:selector:item'].build();aa[ga.id]=ha;var ia=ha.getNode('content');t.renderAndSeparatedParticipantList(ga.id,ia);l.prependContent(z,ha.getRoot());k.set(ha.getRoot(),'threadID',ga.id);var ja=ha.getNode('closeButton');g.listen(ja,'click',function(event){i.closeTab(ga.id,'selector/close-tab');event.kill();});});ba.flyoutContentChanged();l.setContent(w.getNode('numTabs'),fa.length);ca();};function da(event,fa){if(fa.menu!=y)return;var ga=k.get(fa.item,'threadID');u.inform('selected',ga);p.hide(x);}function ea(event,fa){m.register(y);}m.subscribe('select',da.bind(this));p.listen('show',x,function(){h.inform('layer_shown',{type:'ChatTabSelector'});ea();});p.listen('hide',x,function(){h.inform('layer_hidden',{type:'ChatTabSelector'});});r.subscribe('threads-updated',ca);}q(u,new h());e.exports=u;},null);
__d("ChatTabController",["Arbiter","BanzaiLogger","ChatActivity","ChatConfig","ChatNewMessageHandler","ChatTabActions","ChatTabLRUManager","ChatTabMessagesView","ChatTabModel","ChatTabPolicy","ChatTabView","ChatTabViewSelector","JSLogger","MercuryViewer","Style","UserAgent_DEPRECATED","VideoCallCore","ChatTabPresence","ChatTypeaheadBehavior","MercuryThreadInformer","MercuryThreadActions","MercuryThreads"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){b.__markCompiled&&b.__markCompiled();b('ChatTabPresence');b('ChatTypeaheadBehavior');var x=b('MercuryThreadInformer').get(),y=b('MercuryThreadActions').get(),z=b('MercuryThreads').get(),aa=j.get('tab_auto_close_timeout')||7200000,ba=s.create('tab_controller');function ca(na,oa,pa){var qa=o.get().tabs,ra=qa[na],sa,ta;if(qa.length===0)return false;var ua=qa.slice(na+1),va=qa.slice(0,na),wa=ua.concat(va);if(!oa)wa.reverse();if(ra)wa.push(ra);for(var xa=0;xa<wa.length;xa++){sa=wa[xa];ta=q.get(sa.id);if(ta&&ta.isVisible()&&(!pa||sa.raised)){ta.focus();return true;}}return false;}function da(na,oa){var pa=oa&&oa.getRightmostHiddenTab();if(pa===na)return null;return pa;}function ea(){return Math.floor(Math.random()*2147483648).toString(16);}function fa(na,oa,pa,qa){l.raiseTab(na,true,pa);var ra=oa&&oa.getLeftmostVisibleTab(),sa=oa&&oa.getTabsToShow();if(sa&&!sa[na]&&ra){o.promoteThreadInPlaceOfThread(na,ra,da(na,oa),true);}else l.promoteTab(na);g.inform('chat/open-tab',na);var ta=q.get(na);ta&&ta.focus();}function ga(na,oa){if(!o.getTab(na))l.raiseTab(na,false);var pa=oa&&m.getLRUVisibleTab(oa),qa=oa&&oa.getTabsToShow();if(qa&&!qa[na]&&pa)o.promoteThreadInPlaceOfThread(na,pa,da(na,oa));}function ha(na){r.subscribe('selected',function(pa,qa){fa(qa,na);});g.subscribe('page_transition',function(pa,qa){l.closeFragileTabs();});g.subscribe('chat-visibility/go-offline',function(){l.closeAllTabs();});i.subscribe('idle',function(pa,qa){if(qa>aa){var ra=o.get().tabs;ra.forEach(function(sa){var ta=sa.id;z.getThreadMeta(ta,function(ua){if(!ua.unread_count){ba.log('autoclose_idle_seen',{thread_id:ta,idleness:qa});l.closeTab(ta,'autoclose_idle_seen');}});});}});q.subscribe('nub-activated',function(pa,qa){fa(qa,na);});q.subscribe('focus-tab',function(pa,qa){var ra=o.getTab(qa);if(ra&&ra.raised)fa(qa,na,ra.signatureID,true);});function oa(pa,qa){h.log('VideoCallLoggerConfig',{event:'chat_tab_call_click'});w.showOutgoingCallDialog(qa.userID,qa.clickSource);}q.subscribe('video-call-clicked',oa);n.subscribe('video-call-clicked',oa);n.subscribe('interaction-with-tab',function(pa,qa){var ra=o.getTab(qa);ra&&ra.raised&&y.markSeen(qa);});q.subscribe('esc-pressed',function(pa,qa){ba.log('close_esc',{thread_id:qa});var ra=o.indexOf(qa);l.closeTab(qa,'close_esc');setTimeout(function(){ca(ra-1,true,true);},0);});x.subscribe('messages-received',function(pa,qa){for(var ra in qa){var sa=qa[ra];for(var ta=0;ta<sa.length;ta++){var ua=sa[ta];if(ua.author!=t.getID()){if(!ua.is_unread){ba.log('message_already_read',{action_id:ua.action_id,thread_id:ua.thread_id});continue;}z.getThreadMeta(ra,function(va){p.messageIsAllowed(va,ua,function(){ga(ra,na);k.newMessage(ra,ua);});});}}}});x.subscribe('thread-read-changed',function(pa,qa){for(var ra in qa)if(!qa[ra].mark_as_read){ba.log('autoclose_marked_unread',{thread_id:ra});l.closeTab(ra,'autoclose_marked_unread');}});q.subscribe('tab-pressed',function(pa,qa){return !ca(o.indexOf(qa.id),qa.shiftPressed);});g.subscribe(s.DUMP_EVENT,function(pa,qa){qa.chat_controller={auto_close_timeout:aa};});this.openTab=function(pa,qa,ra){fa(pa,qa,ea());if(ra)ra(q.get(pa));};}if(v.firefox()){var ia=function(){return u.get(document.body,'overflowX')+' '+u.get(document.body,'overflowY');},ja=ia(),ka=function(){var na=ia();if(na!==ja){ja=na;g.inform('overflow-applied-to-body');}};if('MutationObserver' in window){var la=new MutationObserver(ka),ma={attributes:true,attributeFilter:['class','style']};la.observe(document.documentElement,ma);}else document.documentElement.addEventListener('DOMAttrModified',function(event){if(event.getTarget()===document.documentElement&&(event.attrName==='class'||event.attrName==='style'))ka();},false);}e.exports=ha;},null);
__d("ChatTabViewCoordinator",["Arbiter","ChatTabModel","ChatTabView","ChatTabViewSelector","CSS","JSLogger","VideoCallSupport"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){b.__markCompiled&&b.__markCompiled();var n=l.create('chat_tab_coordinator');function o(p,q){var r=new j(p),s={},t=false;function u(){var y=h.get(),z={};y.tabs.forEach(function(ba){z[ba.id]=1;});n.log('process_tab_changed',{model_tabs:Object.keys(z),view_tabs:Object.keys(s)});for(var aa in s)if(!z[aa]){n.log('remove_tab',{tab_id:aa});s[aa].destroy();delete(s[aa]);}v(y);w(y);if(y.tabNeedsFocus&&!y.tabNeedsFocus.isFocused())y.tabNeedsFocus.focus();}function v(y){var z=null;y.tabs.forEach(function(aa){var ba=aa.id,ca=false;if(!s[ba]){n.log('add_tab',{tab_id:ba});s[ba]=new i(ba,aa.server_id,aa.signatureID,p,z);ca=true;}else s[ba].updateSignatureID(aa.signatureID);if(s[ba].isFocused())y.tabNeedsFocus=s[ba];if(!ca&&!s[ba].nextTabIs(z)){var da=s[ba].getScrollTop();if(z){s[ba].insertBefore(z);}else s[ba].appendTo(p);if(da)s[ba].setScrollTop(da);}z=s[ba];});}function w(y){var z=q.getTabsToShow(y),aa=[],ba=false;y.tabs.forEach(function(ca){if(!z[ca.id]){s[ca.id].setVisibleState(false,ca.raised);aa.push(ca);}});y.tabs.forEach(function(ca){if(z[ca.id]){s[ca.id].setVisibleState(true,ca.raised);ba|=ca.raised;}});r.setTabData(aa);x(ba);}function x(y){if(!y&&t){g.inform('layer_hidden',{type:'ChatTab'});t=false;}else if(y&&!t){g.inform('layer_shown',{type:'ChatTab'});t=true;}}if(m.isVideoCallSupported())k.addClass(p,'videoCallEnabled');q.subscribe('tabs-changed',u);u();}e.exports=o;},null);
__d("TabsViewport",["Arbiter","ArbiterMixin","ChatTabModel","Dock","DOM","DOMDimensions","Event","Parent","Vector","ViewportBounds","areJSONRepresentationsEqual","copyProperties","csx","shield"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){b.__markCompiled&&b.__markCompiled();var u=175,v=269,w=0;function x(){return u;}function y(){return v;}function z(aa){this._root=aa;var ba=this._recalculateWidth.bind(this);m.listen(window,'resize',ba);j.subscribe('resize',ba);g.subscribeOnce('sidebar/initialized',ba,g.SUBSCRIBE_NEW);i.subscribe('chat/tabs-changed',t(this._recalculateTabs,this,true));this._recalculateWidth();this._initialized=true;}r(z.prototype,h,{_root:null,_initialized:false,_availableWidth:0,_maxShown:1,_viewState:null,_recalculateWidth:function(){var aa=z._getAvailableDockWidth(this._root),ba=Math.max(1,Math.floor(aa/y())),ca=ba!=this._maxShown;if(!this._viewState||ca||aa<=this._viewState.usedWidth||aa>this._viewState.widthToShowNext){this._availableWidth=aa;this._maxShown=ba;this._viewState=null;this._recalculateTabs(ca);}},_onTabsChanged:function(){if(this._initialized){this.inform('tabs-changed');this.inform('max-to-show-changed',this._maxShown);this.inform('max-to-show-change-completed');}},_recalculateTabs:function(aa){var ba=z._getTabsToShow(i.get(),this._availableWidth);if(aa||!q(this._viewState,ba)){this._viewState=ba;this._onTabsChanged();}},getMaxTabsToShow:function(){return this._maxShown;},checkWidth:function(){this._recalculateWidth();},hasRoomForRaisedTab:function(){return this._availableWidth-this._viewState.usedWidth>y();},getTabsToShow:function(){return JSON.parse(JSON.stringify(this._viewState.tabsToShow));},getShowingTabsOrder:function(){var aa=i.get(),ba=this._viewState.tabsToShow;return aa.tabs.filter(function(ca){return ba[ca.id];});},getRightmostHiddenTab:function(){var aa=i.get(),ba=this._viewState.tabsToShow,ca=aa.tabs.filter(function(ea){return !ba[ea.id];}),da=ca.shift();return da?da.id:null;},getLeftmostVisibleTab:function(){var aa=this.getShowingTabsOrder(),ba=aa.pop();return ba?ba.id:null;},getRaisedVisibleTabs:function(){var aa=[],ba=this.getShowingTabsOrder(),ca=ba.length;for(var da=0;da<ca;da++)if(i.getTab(ba[da].id).raised)aa.push(ba[da].id);return aa;},shouldPromoteOnRaise:function(aa){if(!this._viewState.tabsToShow[aa])return true;if(this._viewState.nextToHide!=aa)return false;var ba=i.getTab(aa),ca=ba&&ba.raised;return !ca&&(this._availableWidth-this._viewState.usedWidth<y()-x());}});r(z,{_getAvailableDockWidth:function(aa){var ba=l.getViewportWithoutScrollbarDimensions().width;ba-=p.getLeft()+p.getRight();ba-=50;var ca=n.byClass(aa,'fbDock'),da=k.find(ca,"._56ox"),ea=o.getElementDimensions(da).x;ba-=ea;var fa=k.scry(ca,"._56oy");ea+=o.getElementDimensions(fa.pop()).x;var ga=o.getElementDimensions(ca),ha=ga.x-ea;if(ha>w)w=ha;ba-=w;ba-=15;return Math.max(ba,0);},_getTabsToShow:function(aa,ba){ba=Math.max(ba,y()+1);function ca(sa,ta){return (sa.raised||!ta)?y():x();}var da=JSON.parse(JSON.stringify(aa.tabs)),ea=-1,fa=null;if(aa.promoted)da.forEach(function(sa,ta){if(sa.id===aa.promoted){ea=ta;fa=sa;}});var ga=0,ha=false,ia=0,ja=!fa;da.forEach(function(sa,ta){var ua=ca(sa,ha);ha=ha||!sa.raised;sa.leftmostOffset=ga+ua;ga+=ua;if(sa.leftmostOffset<ba)ia++;ja|=ta==ea;sa.alreadyPlacedPromoted=ja;});function ka(sa,ta,ua){var va={};for(var wa=0;wa<ta;wa++){var xa=sa[wa];if(!xa.alreadyPlacedPromoted&&wa==ta-1){va[ua]=true;}else va[xa.id]=true;}return va;}var la=ka(da,ia,aa.promoted),ma=ka(da,ia-1,aa.promoted),na=null;for(var oa in la)if(!ma[oa])na=oa;var pa=da[ia-1],qa=pa?pa.leftmostOffset:0,ra=Infinity;if(ia<da.length)ra=da[ia].leftmostOffset;return {nextToHide:na,tabsToShow:la,usedWidth:qa,widthToShowNext:ra};}});e.exports=z;},null);
__d("ChatApp",["CSS","JSLogger","Promise"],function(a,b,c,d,e,f,g,h,i){b.__markCompiled&&b.__markCompiled();'use strict';var j={init:function(m,n,o){if(this._isInitialized){h.create('chat_app').error('repeated_init');return;}this._rootElem=m;i.resolve().then(function(){return k(o);}).then(function(){return l(n);}).then(function(){this._isInitialized=this._isLoaded=true;}.bind(this));},isInitialized:function(){return !!this._isInitialized;},isHidden:function(){return !this._isInitialized||this._isHidden;},hide:function(){if(this.isHidden())return;g.hide(this._rootElem);this._isHidden=true;},unhide:function(){if(this._isInitialized){if(this._isHidden){g.show(this._rootElem);this.tabsViewport.checkWidth();d(['Dock'],function(m){m.resizeAllFlyouts();});this._isHidden=false;}}else if(!this._isLoaded){d(['UIPagelet'],function(m){m.loadFromEndpoint('ChatTabsPagelet','ChatTabsPagelet');m.loadFromEndpoint('BuddylistPagelet','BuddylistPagelet');});this._isLoaded=true;}}};function k(m){return new i(function(n){d(['MercuryChannelHandler','MercuryDeliveryState','MercuryServerRequests','MercuryStateCheck'],function(o,p,q,r){o.get().turnOn();q.get().handleUpdate(m);p.get();r.initialize();n();});});}function l(m){return new i(function(n){d(['ChatTabController','ChatTabViewCoordinator','TabsViewport'],function(o,p,q){j.tabsViewport=new q(m);j.tabViewCoordinator=new p(m,j.tabsViewport);j.tabController=new o(j.tabsViewport);n();});});}e.exports=j;},null);