/*!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=this.state.starsShown?' '+"_22mn":'')+(p1)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 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 * * 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>>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=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;kar.AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var la={};for(var ma=0;mar.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-tq){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(bathis._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=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;ji.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-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;um){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;v0)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=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;jga){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-1){var jb=z[ib];return v({},jb);}return null;},getEmptyTab:function(){var hb;for(var ib=0;ibl)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(o0)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.id0;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;ga0){var ea=this._calculatePageForPack(this.props.selectedPackID);if(this.state.page!==ea)this._setPage(ea,0);}},_calculatePageForPack:function(ea){for(var fa=0;fa0;},_canGoNext:function(){return this.state.page+1h){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;j1){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;s0,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&&r0,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&&p0)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=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;lb0;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;z0)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;w0)?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]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.scrollTop0&&!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;u1){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;qn)){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;xaaa){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;tathis._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;daw)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