/*1356495997,178142517*/

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

__d("AsyncDOM",["CSS","DOM"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('DOM'),i={invoke:function(j,k){for(var l=0;l<j.length;++l){var m=j[l],n=m[0],o=m[1],p=m[2],q=m[3],r=(p&&k)||null;if(o)r=h.scry(r||document.documentElement,o)[0];switch(n){case 'eval':(new Function(q)).apply(r);break;case 'hide':g.hide(r);break;case 'show':g.show(r);break;case 'setContent':h.setContent(r,q);break;case 'appendContent':h.appendContent(r,q);break;case 'prependContent':h.prependContent(r,q);break;case 'insertAfter':h.insertAfter(r,q);break;case 'insertBefore':h.insertBefore(r,q);break;case 'remove':h.remove(r);break;case 'replace':h.replace(r,q);break;default:}}}};e.exports=i;});
__d("Live",["Arbiter","AsyncDOM","AsyncSignal","ChannelConstants","DataStore","DOM","ServerJS","createArrayFrom","emptyFunction"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('AsyncDOM'),i=b('AsyncSignal'),j=b('ChannelConstants'),k=b('DataStore'),l=b('DOM'),m=b('ServerJS'),n=b('createArrayFrom'),o=b('emptyFunction');function p(r,s){s=JSON.parse(JSON.stringify(s));new m().setRelativeTo(r).handle(s);}var q={logAll:false,startup:function(){q.startup=o;g.subscribe(j.getArbiterType('live'),q.handleMessage.bind(q));},lookupLiveNode:function(r,s){var t=l.scry(document.body,'.live_'+r+'_'+s);t.forEach(function(u){if(k.get(u,'seqnum')===undefined){var v=JSON.parse(u.getAttribute('data-live'));k.set(u,'seqnum',v.seq);}});return t;},handleMessage:function(r,s){var t=s.obj,u=t.fbid,v=t.assoc,w=this.lookupLiveNode(u,v);if(!w)return false;w.forEach(function(x){if(t.expseq){var y=k.get(x,'seqnum'),z=k.get(x,'message_buffer');if(z===undefined){z={};k.set(x,'message_buffer',z);}var aa={obj:t};z[t.expseq]=aa;if(t.expseq!=y){q.log('mismatch',t.fbid,t.expseq,y);return false;}while(true){y=k.get(x,'seqnum');var ba=z[y];if(ba){h.invoke(ba.obj.updates,x);if(ba.obj.js)p(x,ba.obj.js);q.log('seqmatch',t.fbid,'exp',t.expseq,'cur',y);delete z[y];}else break;}}else{h.invoke(t.updates,x);if(t.js)p(x,t.js);}});},log:function(){if(q.logAll){var r=n(arguments).join(':');new i('/common/scribe_endpoint.php',{c:'live_sequence',m:r}).send();}}};e.exports=q;});
__d("legacy:live-js",["Live"],function(a,b,c,d){a.Live=b('Live');},3);
function ufi_add_ft_hidden_node(a){if(a.link_data)return;var b=collect_data_attribs(a,['ft']).ft;if(Object.keys(b).length){var c=DOM.create('input',{type:'hidden',name:'link_data',value:JSON.stringify(b)});a.appendChild(c);}}function ufi_add_all_link_data(){Bootloader.loadComponents('dom-collect',function(){DOM.scry(document.body,'form.commentable_item').forEach(ufi_add_ft_hidden_node);});}function question_add_all_link_data(){Bootloader.loadComponents('dom-collect',function(){DOM.scry(document.body,'form.fbEigenpollForm').forEach(ufi_add_ft_hidden_node);DOM.scry(document.body,'form.fbQuestionPollForm').forEach(ufi_add_ft_hidden_node);});}