/*1358292668,173220391*/

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

__d("legacy:ShortProfiles",["ShortProfiles"],function(a,b,c,d){a.ShortProfiles=b('ShortProfiles');},3);
__d("legacy:TooltipLink",["TooltipLink"],function(a,b,c,d){a.TooltipLink=b('TooltipLink');},3);
__d("legacy:XHPTemplate",["XHPTemplate"],function(a,b,c,d){a.XHPTemplate=b('XHPTemplate');},3);
function DynamicFacepile(){}copyProperties(DynamicFacepile.prototype,{init:function(a,b,c,d){this._facepile=c;this._maxFacepileSize=b;this._memberIDs=a;this._facepileItemMap={};var e=DOM.scry(this._facepile,'li');for(var f=0,g=a.length;f<g;++f)this._facepileItemMap[a[f]]=e[f];this._template=d;},containsID:function(a){return this._facepileItemMap[a];},removeFacepileItem:function(a){var b=this._facepileItemMap[a.uid];if(!b)return;delete this._facepileItemMap[a.uid];this._memberIDs.splice(this._memberIDs.indexOf(a.uid),1);DOM.remove(b);},addFacepileItem:function(a){var b=this._template.render(),c=XHPTemplate.getNode(b,'img');c.src=a.photo;var d=XHPTemplate.getNode(b,'anchor');d.href=URI('/profile.php').addQueryData({id:a.uid});TooltipLink.setTooltipText(d,a.name);DOM.prependContent(this._facepile,b);this._facepileItemMap[a.uid]=b;this._memberIDs.unshift(a.uid);if(this._memberIDs.length>this._maxFacepileSize){var e=this._memberIDs.pop(),f=this._facepileItemMap[e];DOM.remove(f);delete this._facepileItemMap[e];}}});
var FriendsDashSideCol={init:function(a){this._flid=a;var b='listeditor/friend_lists_changed',c=Arbiter.subscribe(b,function(d,e){if(d==b&&e.list_info.list_id==this._flid){if(e.refresh_member_box)new AsyncRequest('/ajax/friends/lists/list_modified.php').setMethod('GET').setReadOnly(true).setData({list_id:this._flid}).send();if(e.removed_uid){DOM.scry($('home_stream'),'.aid_'+e.removed_uid).forEach(CSS.hide);}else if(e.undo_remove&&e.added_uid){DOM.scry($('home_stream'),'.aid_'+e.added_uid).forEach(CSS.show);}else Arbiter.inform(UIIntentionalStreamMessage.REFRESH_STREAM,{filter:'fl_'+this._flid,noScroll:1});}}.bind(this),Arbiter.SUBSCRIBE_NEW);PageTransitions.registerHandler(Arbiter.unsubscribe.curry(c));}};
__d("CloseFriendsSuggestionMegaphone",["Animation","Arbiter","AsyncRequest","CSS","DOM","PageTransitions","$","createObjectFrom","cx","ge"],function(a,b,c,d,e,f){var g=b('Animation'),h=b('Arbiter'),i=b('AsyncRequest'),j=b('CSS'),k=b('DOM'),l=b('PageTransitions'),m=b('$'),n=b('createObjectFrom'),o=b('cx'),p=b('ge'),q=400,r=235,s={},t=false,u,v,w,x,y,z,aa={},ba,ca=false,da=0,ea=7,fa=8,ga=17,ha=25,ia=5;function ja(va,wa,xa){new g(va).show().from('opacity',0).to('opacity',1).duration(wa).ondone(xa).go();}function ka(va,wa,xa){new g(va).from('opacity',1).to('opacity',0).hide().duration(wa).ondone(xa).go();}function la(){var va=k.scry(v,'li'),wa=t?ga:fa,xa=Math.min(wa,va.length),ya=[];for(var za=0;za<xa;za++){var ab=va[za].id.split('_').pop();if(!aa[ab]){aa[ab]=true;ya.push(ab);}}var bb={tids:ya,key:ba};new i().setURI('/friends/ajax/log_data.php').setData(bb).send();}function ma(){if(!t){t=true;new g(v).to('height',r).duration(q).go();ja(w,q);}}function na(){for(var va in s)k.scry(v,'#cf_suggestion_item_'+va).forEach(function(wa){j.hide(wa);});}function oa(){var va="_wj fbTimelineBoxCount fbTimelineBoxCountFriends";k.replace(k.find(y,'.fbTimelineBoxCountFriends'),k.create('span',{className:va},'+'+(z-ea+1)));}function pa(va,wa,xa){var ya=k.find(va,'.collector_item'),za=k.find(va,'.picker_item'),ab=xa?ya:za,bb=xa?za:ya;ka(va,q,function(){k.prependContent(wa,va);j.show(ab);j.hide(bb);ja(va,q);});qa(xa);}function qa(va){if(va){if(z==ea+1){j.show(m('cf_suggestion_collector_overflow_num'));}else if(z>ea+1)oa();if(z){j.addClass(x,"cfSuggestionCollectorNonempty");j.show(m('cf_suggestion_collector_placeholder'));}}else{if(z==ea){j.hide(m('cf_suggestion_collector_overflow_num'));}else if(z>ea)oa();if(!z){j.removeClass(x,"cfSuggestionCollectorNonempty");j.hide(m('cf_suggestion_collector_placeholder'));}}}function ra(){var va={flid:u,purpose:'warning',cf_count:z};new i().setURI('/ajax/friends/lists/cf_megaphone/contextual_dialog').setData(va).send();}function sa(va){ma();var wa=k.find(v,'ul'),xa=k.find(x,'ul'),ya=k.scry(y,'#cf_suggestion_item_'+va);if(s[va]){z--;da--;pa(ya[0],wa,false);s[va]=false;}else{z++;da++;if(z>=ha&&da>=ia&&!ca){ca=true;ra();}s[va]=true;if(ya.length){pa(ya[0],xa,true);la();}else{new i().setURI('/ajax/friends/lists/cf_megaphone/picker_item').setData({id:va}).setHandler(function(za){var ab=k.prependContent(xa,za.payload)[0];ja(ab,q);qa(true);s[va]=true;}.bind(this)).send();return;}}}function ta(){ka(m('megaphone_story_747'),q);var va='#navItem_fl_'+u,wa=k.find(p('sideNav'),va);if(wa){j.removeClass(m('listsNav'),'belowThreshold');var xa={flid:u,purpose:'edu'};new i().setURI('/ajax/friends/lists/cf_megaphone/contextual_dialog').setData(xa).send();}}var ua={init:function(va,wa,xa,ya,za){if(k.scry(m(wa),'#pagelet_home_stream')){y=k.find(k.prependContent(m(wa),va)[0],'#cf_megaphone_content_id');v=k.find(y,'#cf_suggestion_picker');x=k.find(y,'#cf_suggestion_collector');w=k.find(y,'.doneButton');u=ya;z=xa.length;s=n(xa);ba=za;var ab=h.subscribe('listeditor/friend_lists_changed',function(bb,cb){if(cb.list_info.list_id==ya)if(cb.removed_uid&&s[cb.removed_uid]){sa(cb.removed_uid);}else if(cb.added_uid&&!s[cb.added_uid])sa(cb.added_uid);},h.SUBSCRIBE_NEW);l.registerHandler(h.unsubscribe.curry(ab));la();}},expandPicker:function(){ma();},hide:function(){ta();},toggleFriend:function(va){sa(va);var wa={flid:u,id:va,source:'closefriendsmegaphone'};if(s[va]){wa.add=1;}else wa.remove=1;new i().setURI('/friends/ajax/lists.php').setData(wa).send();}};a.CloseFriendsSuggestionMegaphone=e.exports=ua;});
__d("legacy:DynamicFriendListEducation",["DynamicFriendListEducation"],function(a,b,c,d){a.DynamicFriendListEducation=b('DynamicFriendListEducation');},3);
function FriendListMembersBox(){}copyProperties(FriendListMembersBox.prototype,{init:function(a,b,c,d,e,f,g){this._root=a;this._flid=b;this._listSize=d;this._headerTitle=DOM.find(this._root,'.uiHeaderTitle');this._headerActions=DOM.find(this._root,'.uiHeaderActions a');this._facepile=new DynamicFacepile();this._facepile.init(c,e,f.firstChild,g);var h=[Arbiter.subscribe(['FriendListSuggestions/add','FriendListMemberTypeahead/add','FriendListHovercard/add'],this.handleAddEvent.bind(this)),Arbiter.subscribe('FriendListHovercard/remove',this.handleRemoveEvent.bind(this))];PageTransitions.registerHandler(function(){h.forEach(Arbiter.unsubscribe);});},handleAddEvent:function(a,b){if(b.flid!==this._flid||!b.uid)return;if(this._facepile.containsID(b.uid))return;if(!b.photo||!b.name){requireLazy(['ShortProfiles'],function(c){c.get(b.uid,function(d,e){if(e.exist){d.flid=this._flid;d.photo=e.thumbSrc;d.name=e.firstName;this._facepile.addFacepileItem(d);}}.bind(this,b));}.bind(this));}else this._facepile.addFacepileItem(b);CSS.removeClass(this._root,'empty');CSS.show(this._headerActions);this._listSize++;this.updateListSize();},handleRemoveEvent:function(a,b){if(b.flid!==this._flid||!b.uid)return;this._listSize--;this.updateListSize();this._facepile.removeFacepileItem(b);},updateListSize:function(){DOM.setContent(this._headerTitle,tx._("{num_members} ezen a list\u00e1n",{num_members:this._listSize}));}});
__d("FriendListMenu",["Event","Arbiter","AsyncRequest","CSS","DOM","HTML","Focus","Input","Keys","Menu","Parent"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('AsyncRequest'),j=b('CSS'),k=b('DOM'),l=b('HTML'),m=b('Focus'),n=b('Input'),o=b('Keys'),p=b('Menu'),q=b('Parent'),r={init:function(s){p.register(s,false);var t=k.find(s,'.FriendListCreateTrigger'),u=k.find(s,'.CreateListInputItem'),v=k.find(u,'.createListInput');p.subscribe('select',function(w,x){if(x.item==t){j.addClass(s,'FriendListMenuCreate');m.set(v);}});g.listen(v,'blur',function(w){if(n.isEmpty(v))j.removeClass(s,'FriendListMenuCreate');});g.listen(v,'keydown',function(w){if(g.getKeyCode(w)==o.RETURN&&/[^\s]/.test(v.value))new i().setURI('/ajax/friends/lists/create.php').setData({name:v.value,id:s.id}).setHandler(function(){n.reset(v);j.removeClass(s,'FriendListMenuCreate');}).send();});h.subscribe('friend-list/new',function(w,x){var y=l(x.new_li).getRootNode();k.insertBefore(t,y);if(x.id===s.id){p.focusItem(y);p.inform('select',{menu:q.byClass(y,'uiMenu'),item:y});}else p.toggleItem(y);});},addToAnotherList:function(s,t){g.listen(s,'click',function(event){var u=q.byClass(s,'FlyoutFriendMenu');j.removeClass(u,'addToListsClosed');j.addClass(u,'addToListsOpen');});},goBack:function(s,t){g.listen(s,'click',function(event){var u=q.byClass(s,'FlyoutFriendMenu');j.removeClass(u,'addToListsOpen');j.addClass(u,'addToListsClosed');});}};e.exports=r;});
__d("FriendListSuggestions",["Event","Arbiter","AsyncRequest","AsyncSignal","Bootloader","CSS","DOM","DynamicFriendListEducation","PageTransitions","Parent","UserAgent","copyProperties","csx","ge"],function(a,b,c,d,e,f){var g=b('Event'),h=b('Arbiter'),i=b('AsyncRequest'),j=b('AsyncSignal'),k=b('Bootloader'),l=b('CSS'),m=b('DOM'),n=b('DynamicFriendListEducation'),o=b('PageTransitions'),p=b('Parent'),q=b('UserAgent'),r=b('copyProperties'),s=b('csx'),t=b('ge');function u(){}r(u.prototype,{init:function(v,w,x,y,z){this._container=v;this._flid=w;this._shouldSave=x;this._context=y;this._source=z;var aa=g.listen(v,'click',function(ca){var da=ca.getTarget();p.byClass(da,'addLink')&&this._handleAdd(da);p.byClass(da,'declineButton')&&this._handleDecline(da);}.bind(this));if(q.ie()<7)k.loadModules(['ExplicitHover'],function(ca){this._explicitHover=new ca(this._container,'friendListSuggestion');}.bind(this));var ba=h.subscribe('FriendListMemberTypeahead/add',function(ca,da){var ea=t('suggestion_'+da.uid);ea&&this._swap(ea);}.bind(this));o.registerHandler(function(){aa.remove();ba.unsubscribe();this._explicitHover&&this._explicitHover.uninstall();}.bind(this));},_handleDecline:function(v){var w=p.byTag(v,'li');this._swap(w);},_handleAdd:function(v){var w=p.byTag(v,'li'),x=this._getUIDFromItem(w),y=function(z){if(z&&z.nux_cancel)return;this._swap(w);if(this._shouldSave)this._save(x,z);var aa=m.scry(w,"img._s0")[0],ba=m.find(w,'td.userSuggestionName');h.inform('FriendListSuggestions/add',{flid:this._flid,uid:x,name:m.getText(ba),photo:aa.src});}.bind(this);n.showContextualDialog(this._flid,x,v,y);},_getUIDFromItem:function(v){return ''+v.id.split('_')[1];},_swap:function(v){m.remove(v);var w=m.scry(this._container,'li.hidden_elem')[0];if(!w)return;l.show(w);var x=this._getUIDFromItem(w),y=''+w.getAttribute('data-coeff-key'),z={tids:[x],key:y};new j('/friends/ajax/log_data.php',z).send();},_save:function(v,w){var x={flid:this._flid,id:v,add:1,source:this._source};x[this.context]=1;if(w)r(x,w);new i().setURI('/friends/ajax/lists.php').setData(x).send();}});e.exports=u;});
__d("legacy:FriendListSuggestions",["FriendListSuggestions"],function(a,b,c,d){a.FriendListSuggestions=b('FriendListSuggestions');},3);
__d("RestrictedFriendListEducation",["Arbiter","AsyncRequest"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('AsyncRequest'),i,j;function k(m,n){if(n.flid==i)if(m=='FriendListHovercard/add'){if(j)return;j=true;new h().setURI('/ajax/friends/lists/restricted_edu.php').setData({target:n.uid,flid:n.flid}).send();}else if(m=='RestrictedListNUX/okay')new h().setURI('/ajax/friends/lists/nux_log.php').setData(n).send();return true;}var l={init:function(m){i=m;g.subscribe(['FriendListHovercard/add','RestrictedListNUX/okay'],k);}};e.exports=l;});
__d("legacy:FriendListRestrictedEducation",["RestrictedFriendListEducation"],function(a,b,c,d){a.RestrictedFriendListEducation=b('RestrictedFriendListEducation');},3);
function FriendListMemberBoxTypeahead(){}copyProperties(FriendListMemberBoxTypeahead.prototype,{init:function(a,b,c){Event.listen(a.getCore().getElement(),'keyup',function(event){CSS.conditionClass(event.getTarget(),'noPadding',Style.get(event.getTarget(),'direction')=='rtl');});a.subscribe('select',function(e,f){var g=function(i){Arbiter.inform('FriendListMemberTypeahead/add',{flid:b,uid:f.selected.uid,name:f.selected.text,path:f.selected.path,photo:f.selected.photo});var j={add:1,search:1,source:c,flid:b,id:f.selected.uid};copyProperties(j,i);new AsyncRequest().setURI('/friends/ajax/lists.php').setData(j).send();};if(f.selected.subscribee||f.selected.type=='page')return g();DynamicFriendListEducation.showDialog(b,f.selected.uid,g);var h=a.getData().getExclusions();h.push(f.selected.uid);a.getData().setExclusions(h);});var d=Arbiter.subscribe('listeditor/friend_lists_changed',function(e,f){if(f.list_info.list_id==b){var g=a.getData().getExclusions();if(f.removed_uid){g.remove(f.removed_uid);}else if(f.added_uid)g.push(f.added_uid);a.getData().setExclusions(g);}},Arbiter.SUBSCRIBE_NEW);PageTransitions.registerHandler(Arbiter.unsubscribe.curry(d));}});
__d("CloseFriendsTypeaheadRenderer",["DOM","SearchTypeaheadRenderer"],function(a,b,c,d,e,f){var g=b('DOM'),h=b('SearchTypeaheadRenderer');function i(j,k){var l=h(j,k),m=g.create('div',{className:'star'});g.appendContent(l,m);return l;}i.className='closefriends';e.exports=i;});
__d("legacy:CloseFriendsTypeaheadRenderer",["CloseFriendsTypeaheadRenderer"],function(a,b,c,d){if(!a.TypeaheadRenderers)a.TypeaheadRenderers={};a.TypeaheadRenderers.closefriends=b('CloseFriendsTypeaheadRenderer');},3);