/*1358153685,178130467*/

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

/** js/deprecated/UIControllerRegistry.js */
__d("legacy:UIControllerRegistry",[],function(a,b,c,d){



a.__UIControllerRegistry=a.__UIControllerRegistry||{};},

3);

/** js/lib/util/pagelet_cache.js */






PageletCache=window.PageletCache||

{init:function(){

try{PageletCache._cache=window.sessionStorage;}catch(
a){




}},





_processBeforeWrite:function(a){

Bootloader.setResourceMap(a.resource_map);
var b=(a.css||[]).concat(a.js||[]);
for(var c in (a.bootloadable||{}))
b.concat(a.bootloadable[c]);

a.resource_map=a.resource_map||{};
for(var d=0;d<b.length;d++){
var e=b[d];

if(!a.resource_map[e])
a.resource_map[e]=
Bootloader.resolveResources([e])[0];}



if(a.cache_type=='overwrite'){


delete a.onload;
delete a.onafterload;
delete a.jscc_map;
delete a.jsmods;}},










write:function(a,b){
if(!PageletCache._cache)
return;









if(a.cacheable){













var c={};
copyProperties(c,a);
delete c.content;
PageletCache._pagelets[c.id]=c;

PageletCache.subscribeToInstantiateController(c,b);}else
if(a.cache_parent)







PageletCache._merge
(PageletCache._pagelets[a.cache_parent],
a);},












_merge:function(a,b){











for(var c in b){
if(typeof b[c]!='object')


continue;


if(!a[c]){
a[c]=b[c];}else
if(c=='jsmods'){



PageletCache._merge(a.jsmods,b.jsmods);}else
if(Array.isArray(b[c])){
a[c]=a[c].concat(b[c]);}else 

copyProperties(a[c],b[c]);}






if(a.provides&&a.requires){
a.requires=a.requires.filter(function(d){
return a.provides.indexOf(d)<0;});


a.requires.length||delete a.requires;}



if(a.display_dependency){
a.display_dependency=
a.display_dependency.filter(function(d){
return d!=a.id;});


a.display_dependency.length||delete a.display_dependency;}



delete a.content;},







updateSnapshot:function(a,b,c){







var d=PageletCache._pagelets[a];
d.content={};
d.content[a]=b.innerHTML;
d.__data=c;

var e=this.getAndParse(d.id);

try{PageletCache._processBeforeWrite(d);

e[d.key]=d;
PageletCache._cache.setItem(d.id,JSON.stringify(e));}catch(
f){
}},



fetchData:function(a){






var b=PageletCache._pagelets[a].__data;
return b?b:{};},


loadFromCache:function(a,b){
var c={};
copyProperties(c,
PageletCache.read(a));
if(is_empty(c))
return a;

c.id=a.id;
c.cache_hit=true;
c.display_dependency=a.display_dependency;
c.phase=a.phase;
c.is_last=a.is_last;

this.subscribeToInstantiateController(c,b);

return c;},


read:function(a){
if(!PageletCache._cache)
return null;


var b=a.id;





if(b.substr(0,6)=='cached')
b=b.substr(7);

var c=this.getAndParse(b);
if(c&&c[a.key]){
PageletCache._pagelets[b]=c[a.key];
PageletCache._cache_hits[b]=true;
return c[a.key];}


if(a.cache_type=='update')



Bootloader.loadComponents(['UIPagelet','uri'],function(){
UIPagelet.loadFromEndpoint
(a.controller_class,
b,
URI.getNextURI().getQueryData(),
{usePipe:true,pageletCacheMiss:a,automatic:true});});



return null;},


getAndParse:function(a){
var b=PageletCache._cache.getItem(a);
if(b)

try{return JSON.parse(b);}catch(
c){
}



return {};},


isCacheHit:function(a){
return !!PageletCache._cache_hits[a];},


cleanup:function(a){








delete PageletCache._cache_hits[a];
delete PageletCache._pagelets[a];},


subscribeToInstantiateController:function(a,b){


var c=b.subscribe('pagelet_event',function(d,e){
if(e.id==a.id&&e.event=='preonload'){
c.unsubscribe();
new window[a.cache_controller]
(a.id,
a.cache_type);}});},





_cache:null,
_pagelets:{},
_cache_hits:{}};

/** js/lib/util/pagelet_cache_controller.js */















































function PageletCacheController(a,b,c){
if(!PageletCache)



return;


if(!a)



return;


this._cacheKey=a;
this._cacheType=b;
this._subscriptions=[];
this._controller=null;
this._registerSnapshot(c);
PageletCacheController._instances[a]=this;}


copyProperties(PageletCacheController,

{registerController:function(a,b){
if(!a||!b)
return null;

var c=PageletCacheController._instances[a];
if(c){
c.setController(b);
c.takeSnapshot();
if(c._cacheType=='update'&&
PageletCache.isCacheHit(a))
onafterloadRegister_DEPRECATED(c.updateAfterload.
bind(c,b));}


return c;},


_instances:{}});



copyProperties(PageletCacheController.prototype,

{registerCleanup:function(a){
this._subscriptions.push
(Arbiter.subscribe(a,this._cleanup.bind(this)));},



setController:function(a){




this._controller=a;

return this;},


loadData:function(){
return PageletCache.fetchData(this._cacheKey);},


takeSnapshot:function(){







var a=$(this._cacheKey).cloneNode(true);
this.handlePageletDOMOnSnapshot(a);

var b=this.getControllerDataOnSnapshot(this._controller);

PageletCache.updateSnapshot(this._cacheKey,a,b);},


getControllerDataOnSnapshot:emptyFunction,

handlePageletDOMOnSnapshot:emptyFunction,

updateAfterload:emptyFunction,

_registerSnapshot:function(a){
for(var b=0;b<a.length;b++)
this._subscriptions.push
(Arbiter.subscribe(a[b],this.takeSnapshot.bind(this)));},




_cleanup:function(){
this._subscriptions.forEach(Arbiter.unsubscribe);
this._subscriptions.length=0;
PageletCache.cleanup(this._cacheKey);
delete PageletCacheController._instances[this._cacheKey];}});

/** js/fbx/navigation_home_cache.js */








function HomeNavigationCache(a,b){
this.parent.construct
(this,
a,
b,
['NavigationMessage.FAVORITES_UPDATED']);}



Class.extend(HomeNavigationCache,'PageletCacheController');

copyProperties(HomeNavigationCache.prototype,
{handlePageletDOMOnSnapshot:function(a){
var b=DOM.scry(a,'li.sideNavItem');
if(b.length===0)
return;



for(var c=0;c<b.length;c++){
var d=b[c];

if(d.id=='navItem_app_4748854339'){
CSS.addClass(d,'selectedItem');}else
if(CSS.hasClass(d,'selectedItem')){
CSS.removeClass(d,'selectedItem');
CSS.removeClass(d,'open');}

CSS.removeClass(d,'loading');}



var e=DOM.scry(a,'.uiFutureSideNav')[0];
if(e)
CSS.addClass(e,'hideNavCounts');}});

/** js/modules/Base64.js */
__d("Base64",[],function(a,b,c,d,e,f){















var g=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
function h(l){
l=(l.charCodeAt(0)<<16)|(l.charCodeAt(1)<<8)|l.charCodeAt(2);
return String.fromCharCode
(g.charCodeAt(l>>>18),g.charCodeAt((l>>>12)&63),
g.charCodeAt((l>>>6)&63),g.charCodeAt(l&63));}





var i=
'>___?456789:;<=_______'+
'\0\1\2\3\4\5\6\7\b\t\n\13\f\r\16\17\20\21\22\23\24\25\26\27\30\31'+
'______\32\33\34\35\36\37 !"#$%&\'()*+,-./0123';
function j(l){
l=(i.charCodeAt(l.charCodeAt(0)-43)<<18)|
(i.charCodeAt(l.charCodeAt(1)-43)<<12)|
(i.charCodeAt(l.charCodeAt(2)-43)<<6)|
i.charCodeAt(l.charCodeAt(3)-43);
return String.fromCharCode(l>>>16,(l>>>8)&255,l&255);}


var k=
{encode:function(l){

l=unescape(encodeURI(l));
var m=(l.length+2)%3;
l=(l+'\0\0'.slice(m)).replace(/[\s\S]{3}/g,h);
return l.slice(0,l.length+m-2)+'=='.slice(m);},

decode:function(l){

l=l.replace(/[^A-Za-z0-9+\/]/g,'');
var m=(l.length+3)&3;
l=(l+'AAA'.slice(m)).replace(/..../g,j);
l=l.slice(0,l.length+m-3);

try{return decodeURIComponent(escape(l));}catch(
n){throw new Error('Not valid UTF-8');}},

encodeObject:function(l){
return k.encode(JSON.stringify(l));},

decodeObject:function(l){
return JSON.parse(k.decode(l));},


encodeNums:function(l){
return String.fromCharCode.apply(String,l.map(function(m){
return g.charCodeAt((m|-(m>63))&-(m>0)&63);}));}};




e.exports=k;});

/** js/lib/string/base64.js */
__d("legacy:base64",["Base64"],function(a,b,c,d){



a.Base64=b('Base64');},


3);

/** js/lib/dom/DOMPosition.js */
__d("legacy:DOMPosition",["DOMPosition"],function(a,b,c,d){





var e=b('DOMPosition');
a.DOMPosition=e;},

3);

/** js/stream/new_highlights.js */





var NewHigh=





{reset:function(){
this.initialized=false;},






ensureInitialized:function(){
if(this.initialized)
return;

this.button=DOM.scry(document.body,'a.stream_header_button')[0];
this.composer=DOM.scry(document.body,'div.UIComposer')[0];
this.buttonArea=DOM.scry(this.composer,'div.UIComposer_ButtonArea')[0];
this.initialized=true;},






showComposer:function(a){
this.ensureInitialized();
if(this.composer){
CSS.show(this.composer);
UIComposer.focusInstance(this.composer.id);
var b=UIComposer.getInstance(this.composer.id);


b&&b.loadAttachment(parseInt(a,10));}

this.button&&CSS.hide(this.button);},






hideComposer:function(a){
this.ensureInitialized();
if(this.composer){
var b=UIComposer.getInstance(this.composer.id);
if(!a){
b&&b.initialized&&b.blur();
CSS.hide(this.composer);
this.button&&CSS.show(this.button);}else{

b&&b.initialized&&b.loadAttachment(0);
CSS.show(this.composer);
this.buttonArea&&CSS.hide(this.buttonArea);}}}};

/** js/stream/UIIntentionalStreamRefresh.js */
__d("UIIntentionalStreamRefresh",["Arbiter","LiveTimer","Run","UIIntentionalStreamMessage","UserActivity","coalesce","copyProperties"],function(a,b,c,d,e,f){



var g=b('Arbiter'),
h=b('LiveTimer'),
i=b('Run'),
j=b('UIIntentionalStreamMessage'),
k=b('UserActivity'),

l=b('coalesce'),
m=b('copyProperties');

function n(o,p){

this.isAutoRefreshing=false;
this.lastRefresh=Date.now();


n.instance=this;

this.setAutoRefreshConfig(o);

this.updateConfigHandler=
g.subscribe(j.UPDATE_AUTOREFRESH_CONFIG,
this.updateAutoRefreshConfig.bind(this));


this.updateRefreshTimeHandler=
g.subscribe(j.UPDATE_LAST_REFRESH_TIME,
this.updateLastRefreshTime.bind(this));

i.onLeave(this.unload.bind(this));


this.userActivity();
this.uaToken=k.subscribe(this.userActivity.bind(this));


this.autoRefreshInterval=setInterval
(this.checkAutoPageRefresh.bind(this),
this.checkAutoRefreshTimeInterval);

this.activeRefreshInterval=setInterval
(this.checkActiveRefresh.bind(this),
this.checkActiveRefreshTimeInterval);

this.enableAutoRefresh(p);

g.subscribe(j.UPDATE_STREAM,
h.loop.bind(h,true));
g.subscribe(j.REFRESH_STREAM,
h.loop.bind(h,true));}


m(n,

{DISABLE_AUTOREFRESH_TIME:4*60*1000,


CHECK_AUTOREFRESH_INTERVAL:5*60*1000,

AUTOREFRESH_INACTIVE_TIME:30*60*1000,

CHECK_ACTIVE_REFRESH_TIME:5*60*1000,

ACTIVE_REFRESH_TIME:30*1000});


m(n.prototype,





{updateAutoRefreshConfig:function(o,p){
if(o==j.UPDATE_AUTOREFRESH_CONFIG)
this.setAutoRefreshConfig(p);},



updateLastRefreshTime:function(o){
if(o==j.UPDATE_LAST_REFRESH_TIME)
this.lastRefresh=Date.now();},



setAutoRefreshConfig:function(o){
o=o||{};



var p=24*60*60*1000;



if(!this.storyInterval)
this.storyInterval=l(o.story_interval,null);


this.allowAutoRefresh=l(o.allow_auto_refresh,false);
this.inactiveThreshold=l(o.inactive_threshold,0);
this.activeRefreshTime=l(o.fast_refresh_rate,p);
this.inactiveRefreshTime=l(o.slow_refresh_rate,p);
this.allowPolling=l(o.allow_polling,false);
this.refreshFactor=l(o.refresh_factor,10);
this.minRefreshInterval=l(o.min_refresh_interval,60*1000);


this.activeRefresh=l(o.active_refresh,false);
this.checkActiveRefreshTimeInterval=l
(o.check_active_refresh_interval,
n.CHECK_ACTIVE_REFRESH_TIME);

this.activeRefreshTimeInterval=l
(o.active_refresh_interval,
n.ACTIVE_REFRESH_TIME);



this.disableAutoRefreshTime=l(o.disable_autorefresh_time,
n.DISABLE_AUTOREFRESH_TIME);
this.checkAutoRefreshTimeInterval=
l(o.check_autorefresh_time_interval,
n.CHECK_AUTOREFRESH_INTERVAL);
this.autoRefreshInactiveTime=l(o.autorefresh_inactive_time,
n.AUTOREFRESH_INACTIVE_TIME);
return this;},


unload:function(){





this.enableAutoRefresh(false);

this.cleanupRefreshInterval();

k.unsubscribe(this.uaToken);
this.updateConfigHandler&&this.updateConfigHandler.unsubscribe();
this.updateRefreshTimeHandler&&
this.updateRefreshTimeHandler.unsubscribe();},






userActivity:function(){
var o=this.isInactive();
this.lastActivity=Date.now();


this.isAutoRefreshing=true;

if(o&&this.canAutoRefresh())
this.runAutoRefresh();

return true;},


isInactive:function(){
return this.getMSSinceLastActivity()>this.inactiveThreshold;},


getMSSinceLastActivity:function(){
return Date.now()-this.lastActivity;},






getMSSinceLastRefresh:function(){
return Date.now()-this.lastRefresh;},


getRefreshInterval:function(){
if(this.isInactive()){
return this.inactiveRefreshTime;}else
if(this.storyInterval!=null){
var o=this.storyInterval*this.refreshFactor;
return Math.max(o,this.activeRefreshTime);}else 

return this.activeRefreshTime;},




canAutoRefresh:function(){
return this.isAutoRefreshing&&this.allowAutoRefresh;},







cancelUpdate:function(){
if(this.updateTask){
clearTimeout(this.updateTask);
this.updateTask=null;}},



runUpdatePoll:function(){
this.updateTask=null;
if(this.canAutoRefresh())
this.runAutoRefresh();},



runAutoRefresh:function(){
var o=50;




if(this.getMSSinceLastRefresh()>=this.minRefreshInterval-o)
g.inform(j.UPDATE_STREAM);



this.schedulePoll(this.getRefreshInterval());},


schedulePoll:function(o){
this.cancelUpdate();
if(this.allowPolling)
this.updateTask=setTimeout(this.runUpdatePoll.bind(this),o);},



enableAutoRefresh:function(o,p){
this.isAutoRefreshing=o;
if(o){
var q=p?0:this.getRefreshInterval();
this.schedulePoll(q);}else 

this.cancelUpdate();},











checkAutoPageRefresh:function(){

if(!this.allowAutoRefresh)
return;




if(this.isAutoRefreshing&&
(this.getMSSinceLastActivity()>this.disableAutoRefreshTime))
this.isAutoRefreshing=false;


if(this.getMSSinceLastRefresh()<this.autoRefreshInactiveTime)
return;

var o=this.getMSSinceLastActivity();

if(o>this.autoRefreshInactiveTime)
g.inform(j.REFRESH_STREAM,{});},



checkActiveRefresh:function(){
if(!this.allowAutoRefresh)
return;



if(this.getMSSinceLastRefresh()<this.activeRefreshTimeInterval)
return;


if(this.getMSSinceLastActivity()<this.activeRefreshTimeInterval)
g.inform(j.UPDATE_STREAM);},




cleanupRefreshInterval:function(){
if(this.autoRefreshInterval){
clearInterval(this.autoRefreshInterval);
this.autoRefreshInterval=null;}

if(this.activeRefreshInterval){
clearInterval(this.activeRefreshInterval);
this.activeRefreshInterval=null;}}});




e.exports=n;});

/** js/stream/UIIntentionalStream.js */
__d("UIIntentionalStream",["Event","Animation","Arbiter","AsyncRequest","AsyncResponse","CSS","DataStore","DOM","DOMScroll","HTML","JSLogger","NavigationMessage","OnVisible","PageTransitions","Run","ScrollAwareDOM","Style","UIIntentionalStreamMessage","UIIntentionalStreamRefresh","UIPagelet","URI","Vector","$","clickRefAction","coalesce","copyProperties","createArrayFrom","ge","isEmpty","merge","reportData","startsWith","userAction"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('Animation'),
i=b('Arbiter'),
j=b('AsyncRequest'),
k=b('AsyncResponse'),
l=b('CSS'),
m=b('DataStore'),
n=b('DOM'),
o=b('DOMScroll'),
p=b('HTML'),
q=b('JSLogger'),
r=b('NavigationMessage'),
s=b('OnVisible'),
t=b('PageTransitions'),
u=b('Run'),
v=b('ScrollAwareDOM'),
w=b('Style'),
x=b('UIIntentionalStreamMessage'),
y=b('UIIntentionalStreamRefresh'),
z=b('UIPagelet'),
aa=b('URI'),
ba=b('Vector'),

ca=b('$'),
da=b('clickRefAction'),
ea=b('coalesce'),
fa=b('copyProperties'),
ga=b('createArrayFrom'),
ha=b('ge'),
ia=b('isEmpty'),
ja=b('merge'),
ka=b('reportData'),
la=b('startsWith'),
ma=b('userAction');







function na(){


i.subscribe(x.SET_AUTO_INSERT,
oa);}



function oa(qa,ra){
if(qa!=x.SET_AUTO_INSERT)
return;

var sa=pa.instance;
if(sa)
sa.pauseAutoInsert=ra.pause;}



function pa(qa,
ra,
sa,
ta,
ua,
va,
wa,
xa,
ya,
za,
ab){
if(!qa)
throw new Error('UIIntentionalStream instantiated with no root.');


var bb={};
this.initPageletCache(bb);

fa(this,
{id:qa.id,
root:qa,
instanceName:ra,
newest:bb.newest||sa,
oldest:ta,
oldestMR:ta,
shouldShowHidden:false,
defaultFilter:ua,
currentFilterKey:za,
sourceType:va,
lastSeenTime:ab,

hasPendingRefresh:false,
pauseAutoInsert:false,

error:n.scry(qa,'div.UIIntentionalStream_Error')[0],
pager:n.scry(qa,'div.uiMorePager')[0],
filterNullState:n.scry(qa,'div.friendListFilterNullState')[0],
streamContent:n.find(qa,'.UIIntentionalStream_Content'),
requestNum:0,
scrollLoadCount:1,
maxScrollLoadCount:1,
scrollPosition:0,
lastViewStateID:0,
cachedScrollQID:0,
jslog:q.create('stream'),
scrollListener:null});


this.addScrollTrace('init',{});
u.onLeave(this.unload.bind(this));

if(!pa.instances)
pa.instances={};

pa.instances[ra]=this;
pa.instance=this;


na();

this.setupSubscriptions();}


fa(pa.prototype,

{initPageletCache:function(qa){
if(window.PageletCacheController){
this._cache=
window.PageletCacheController.registerController
('pagelet_home_stream',
this);


if(this._cache){
fa(qa,this._cache.loadData());
this._cache.registerCleanup(x.UNLOAD);}}},







subscribeToComposerPublish:function(){
this.subscriptions.push
(i.subscribe('composer/publish',function(event,qa){
if(qa.streamStory)

this.addComposerContent(qa.streamStory,500);}.

bind(this)));},





setupSubscriptions:function(){
this.subscriptions=[];


this.subscribeToComposerPublish();


this.subscriptions.push
(i.subscribe(x.UPDATE_STREAM,
this.updateStream.bind(this)));

this.subscriptions.push
(i.subscribe(x.REFRESH_STREAM,
this.refreshStream.bind(this)));

this.scrollListener=
g.listen(window,'scroll',this.checkFirstScroll.bind(this));
this.checkFirstScroll();
u.onLoad(this.checkFirstStory.bind(this));},





tearDownSubscriptions:function(){
if(!this.subscriptions)
return;

this.subscriptions.forEach(i.unsubscribe);
this.subscriptions=null;
if(this.scrollListener){
this.scrollListener.remove();
this.scrollListener=null;}},



unload:function(){
this.addScrollTrace('unload',{});
i.inform(x.UNLOAD);


this.tearDownSubscriptions();


pa.instance=null;
pa.instances[this.instanceName]=null;
this.clearScrollLoader(true);

window.disableScrollLoad=null;


y.instance&&
y.instance.unload();},


_getUpdateInsertType:function(){

return pa.REFRESH_PREPEND;},


updateStream:function(qa){
if(qa!=x.UPDATE_STREAM||
this.hasPendingRefresh||
this.isAutoRefreshPaused())


return;

this.loadNewer({showLoader:false,
ignoreSelf:true,
insertType:this._getUpdateInsertType()});},






clearScrollLoader:function(qa){
if(this.currentScrollListener){
this.currentScrollListener.remove();
this.currentScrollListener=null;}


if(qa||this.scrollLoadCount>=this.maxScrollLoadCount)
window.disableScrollLoad=true;},



loadOlderPosts:function(qa){
var ra=
{filter:this.getCurrentFilterKey(),
oldest:this.oldest,
oldestMR:this.oldestMR,
last_seen_time:this.lastSeenTime,
scroll_count:this.scrollLoadCount,
scroll_position:this.scrollPosition,
last_viewstate_id:this.lastViewStateID,
cached_scroll_qid:this.cachedScrollQID};

ra=ja(ra,qa);

this.loadWithParams(ra);},


loadWithParams:function(qa){
var ra=n.scry
(this.root,
'div.fbStreamPager.hasMorePosts')[
0];
if(ra){
if(l.hasClass(ra,'async_saving'))
return;

l.addClass(ra,'async_saving');}


this.addScrollTrace('loadwithparams',qa);


z.loadFromEndpoint
('MoreStoriesPagelet','home_stream',qa,
{usePipe:true,append:true});},


setScrollLoadCount:function(qa){
this.maxScrollLoadCount=qa;},


loadMoreOnScroll:function(qa,ra){







if(window.disableScrollLoad)
return;


var sa=function(){
if(window.disableScrollLoad)
return;


var va=a.ArbiterMonitor;
if(va){
da('scroll',null,null,
'FORCE',{gt:{ua_id:'stream:scroll:auto'}}).
set_namespace('stream');

var wa=ma('stream').uai('scroll','stream:scroll:auto');
va.initUA(wa);}


var xa=
{delay_load_count:ra};


this.loadOlderPosts(xa);}.
bind(this),

ta=n.scry(this.root,'ul.uiStream li.genericStreamStory');
if(!ta.length)
return;


this.addScrollTrace('loadmoreonscroll',{});

var ua=ta[ta.length-qa-1];
if(ua){
this.currentScrollListener=
new s(ua,sa,null,0);}else 

sa();},



updateTimeRange:function(qa,ra){
if(!this.newest||this.newest<qa){
this.newest=qa;
this.addScrollTrace('update_newest',{newest:this.newest});}

if(!this.oldest||(ra&&(ra<this.oldest))){
this.oldest=ra;
this.addScrollTrace('update_oldest',{oldest:this.oldest});}},



updateOldestMR:function(qa){
if(!this.oldestMR||qa<this.oldestMR){
this.oldestMR=qa;
this.addScrollTrace('update_oldestmr',{oldestmr:this.oldestMR});}},



updateScrollPosition:function(qa){
this.scrollPosition=qa;
this.addScrollTrace('update_scrollposition',
{scrollposition:this.scrollPosition});},


updateLastViewStateID:function(qa){
this.lastViewStateID=qa;
this.addScrollTrace('update_lastviewstateid',
{lastviewstateid:this.lastViewStateID});},


updateCachedScrollQID:function(qa){
this.cachedScrollQID=qa;
this.addScrollTrace('update_cachedscrollqid',{qid:this.cachedScrollQID});},


getID:function(){
return this.id;},







getCurrentFilterKey:function(){

if(this.currentFilterKey)
return this.currentFilterKey;

var qa=aa.getMostRecentURI().getQueryData();
if(qa&&qa.sk){
this.currentFilterKey=qa.sk;}else
if(qa&&qa.filter){
this.currentFilterKey=qa.filter;}else
if(this.defaultFilter)
this.currentFilterKey=this.defaultFilter;

return this.currentFilterKey;},


resetFilterKey:function(qa){
this.currentFilterKey=qa;},




loadOlder:function(qa){
qa=qa||{};
if(!this.oldest)
return;

var ra=this.getCurrentParams();
ra.oldest=this.oldest;
this.refresh(pa.REFRESH_APPEND,ra,qa);
return this;},


loadNewer:function(qa){
if(!this.newest)
return;


qa=qa||{};

var ra=this.getCurrentParams();
ra.newest=this.newest;

if(qa.ignoreSelf)
ra.ignore_self=true;


ra.load_newer=true;

var sa=ea(qa.insertType,pa.REFRESH_PREPEND);

this.refresh(sa,ra,qa);
return this;},


checkFirstStory:function(){
this.logFirstStory('first_story_load');},


checkFirstScroll:function(){
if(this.scrollListener&&ba.getScrollPosition().y>0){
this.scrollListener.remove();
this.scrollListener=null;
this.logFirstStory('first_scrolling');}},



logFirstStory:function(qa){
if(!ha('home_stream')||
!ha('home_stream').childElementCount||
!ha('home_stream').
children[0].getAttribute('data-ft'))
return;

var ra=ha('home_stream').children[0].getAttribute('data-ft'),
sa=JSON.parse(ra);
if(!(("mf_story_key" in sa)&&("qid" in sa)))
return;

var ta={mf_story_key:sa.mf_story_key,
qid:sa.qid};
ka(qa,{ft:ta});},


getCurrentParams:function(){
var qa={},
ra=aa.getMostRecentURI().getQueryData();


ra.filter=this.getCurrentFilterKey();

var sa=this.getValidParams();
if(sa){
sa.forEach(function(ta){
qa[ta]=ra[ta];});}else 


qa=ra;

return qa;},


setHomeFilter:function(qa){
this._homeFilter=qa;},


setHomeFilterLoading:function(qa){
if(this._homeFilter)
this._homeFilter.setLoading(qa);},



refresh:function(qa,ra,sa){
i.inform(x.UPDATE_LAST_REFRESH_TIME);

this.addScrollTrace('refresh',{type:qa,data:ra,kwargs:sa});


this.currentFilterKey=ra.filter;



if(ra.filter==pa.FEED_FILTER_KEY_DUAL_NEWS_FEED){
this.currentFilterKey=this.defaultFilter;}else
if(pa.isHighlightsFilter(ra.filter)||
ra.filter===pa.FEED_FILTER_KEY_NEWS_FEED)

this.defaultFilter=this.currentFilterKey;


sa=sa||{};

var ta=++this.requestNum,

ua=ea(sa.showLoader,true),

va=this.instanceName,










wa=function(ab){
pa.getInstance(va).
handleResponse(ta,qa,ab,sa);},

xa=function(ab){
pa.getInstance(va).
handleError(ta,qa,ab,sa);},

ya=function(ab){
pa.getInstance(va).
handleFinally(qa,ra.filter,ab);};


if(!(ra.request_type=qa))
ra.request_type='none';











if(ra.filter){
sa.show_hidden=ra.show_hidden?ra.show_hidden:false;}else 

sa.show_hidden=this.shouldShowHidden;


ra=fa(this.getCurrentParams(),ra);

this.hasPendingRefresh=true;

var za;
if(qa==pa.REFRESH_APPEND&&ua)
za=this.pager;

new j().
setURI(this.getEndpoint()).
setReadOnly(true).
setOption('retries',0).
setMethod(this.getRefreshMethod()).
setData(ra).
setHandler(wa).
setStatusElement(za).
setErrorHandler(xa).
setFinallyHandler(ya).
send();

if(qa==pa.REFRESH_TRANSITION){
if(this.pager)
this.pager.style.display='none';

this.clearScrollLoader();
this.oldest=this.newest=null;}


if(ua)
this.setHomeFilterLoading(true);},






addComposerContent:function(qa,ra){

if(this.isOnNewsFeedFilter())
l.addClass(qa,'uiStreamBoulderHighlight');


this.addContentPrepend(qa,ra);},


addContentPrepend:function(qa,ra){

if(qa.length){

ga(qa).reverse().forEach(function(xa){
this.addContentPrepend(xa,ra);}.
bind(this));
return;}


var sa,
ta=ba.getScrollPosition().y,
ua=ba.getElementPosition(this.streamContent).y,
va=this.scrollOnPrepend&&ta>=ua;
if(va){
var wa=function(xa){
var ya=n.find(xa,'^li.uiStreamStory');
if(!ya)
return;

m.set(ya,'origHeight',ya.offsetHeight);
g.listen(xa,'load',function(){
var za=m.get(ya,'origHeight');

if(ya.offsetHeight!=za){
window.scrollBy(0,ya.offsetHeight-za);
m.set(ya,'origHeight',ya.offsetHeight);}});};




sa=h.insert.curry(this.streamContent,qa,
(function(xa,ya){
n.prependContent(this.streamContent,ya);
i.inform('reflow');
window.scrollBy(0,ya.offsetHeight);






n.scry(ya,'img').forEach(wa);}).
bind(this));}else 


sa=(function(){
w.set(qa,'opacity',0);
v.prependContent(this.streamContent,qa);
i.inform('reflow');
new h(qa).
from('opacity',0).
to('opacity',1).
duration(400).
ondone(function(){





i.inform(x.UPDATE_HTML_CONTENT);}).

go();}).
bind(this);


if(ra){


l.hide(qa);
n.appendContent(document.body,qa);

setTimeout(function(){
l.show(qa);
sa();},
ra);}else 

sa();},



addContentAppend:function(qa){
n.appendContent(this.streamContent,qa);},


handleResponse:function(qa,ra,sa,ta){
this.addScrollTrace('handle_response',
{requestnum:qa,type:ra,kwargs:ta});

ta=ta||{};
var ua=sa.getPayload();

this.filterNullState&&n.remove(this.filterNullState);

if(ia(ua))
return;




if(ua.autoRefreshConfig)
i.inform(x.UPDATE_AUTOREFRESH_CONFIG,
ua.autoRefreshConfig);


this.setHomeFilterLoading(false);

if(ra==pa.REFRESH_EXPAND){
var va=n.find
(ca(ta.expandStoryID),
'div.UIIntentionalStory_CollapsedStories');

l.hide(va);
l.removeClass(va,'UIIntentionalStory_CollapsedStoriesLoading');}

if(this.error)
this.error.style.display='none';






if(qa!=this.requestNum)
return;


if('show_hidden' in ta)
this.shouldShowHidden=ta.show_hidden;






if('newestStoryTime' in ua&&ua.newestStoryTime>this.newest)
this.newest=ua.newestStoryTime;

if(ra!=pa.REFRESH_PREPEND){
if('oldestStoryTime' in ua&&
(!this.oldest||ua.oldestStoryTime<this.oldest))
this.oldest=ua.oldestStoryTime;

if('scrollPosition' in ua)
this.scrollPosition=ua.scrollPosition;

if('lastViewStateID' in ua)
this.lastViewStateID=ua.lastViewStateID;

if('oldestMRStoryTime' in ua)
this.oldestMR=ua.oldestMRStoryTime;

if('cachedScrollQID' in ua){
this.cachedScrollQID=ua.cachedScrollQID;}else 

this.cachedScrollQID=0;}



if(ua.html){
var wa=p(ua.html).getNodes();

switch(ra){
case pa.REFRESH_PREPEND:
this.addContentPrepend(wa);
break;
case pa.REFRESH_APPEND:
this.addContentAppend(wa);







this.clearScrollLoader(true);
break;
case pa.REFRESH_TRANSITION:
n.setContent(this.streamContent,wa);






this.scrollLoadCount=1;

if(!ta.noScroll)
o.scrollTo
(new ba(0,0,"document"),
false);


break;
case pa.REFRESH_EXPAND:
n.insertAfter(ca(ta.expandStoryID),wa);
break;
case pa.DELAYED_STREAM:
this.addContentAppend(wa);
break;}

i.inform(x.UPDATE_HTML_CONTENT);}},



handleError:function(qa,ra,sa,ta){


if(qa!=this.requestNum)
return;


this.setHomeFilterLoading(false);

var ua=sa.getError();
if(ua==1357001)
k.defaultErrorHandler(sa);


if(ra==pa.REFRESH_EXPAND){
var va=n.find
(ca(ta.expandStoryID),
'div.UIIntentionalStory_CollapsedStories');

l.removeClass(va,'UIIntentionalStory_CollapsedStoriesLoading');}



if(!ta.delayLoadCount&&ra!=pa.REFRESH_PREPEND&&
this.error)

w.set(this.error,'display','block');},



handleFinally:function(qa,ra){
if(qa==pa.REFRESH_TRANSITION){
t.transitionComplete();

i.inform(r.NAVIGATION_COMPLETED);}

this.hasPendingRefresh=false;},


getValidParams:function(){
return pa.VALID_PARAMS;},


getEndpoint:function(){
return pa.ENDPOINT;},


getRefreshMethod:function(){
return pa.REFRESH_METHOD;},





isOnNewHighlights:function(){
var qa=this.getCurrentFilterKey();
return (pa.isHighlightsFilter(qa)||
(qa==pa.FEED_FILTER_KEY_DUAL_NEWS_FEED&&
pa.isHighlightsFilter(this.defaultFilter)));},



isLiveStreamBox:function(){
var qa=this.getCurrentFilterKey();

return qa&&qa.indexOf
(pa.FEED_FILTER_KEY_LIVE_STREAM_BOX)===0;},



isOnNewsFeedFilter:function(){
var qa=this.getCurrentFilterKey();
return (qa==pa.FEED_FILTER_KEY_NEWS_FEED||
pa.isHighlightsFilter(qa)||
qa==pa.FEED_FILTER_KEY_DUAL_NEWS_FEED);},





isAutoRefreshPaused:function(){
if(this.isOnNewHighlights()||this.isLiveStreamBox())
return false;

return this.pauseAutoInsert;},


addScrollTrace:function(qa,ra){
this.jslog.debug(qa,ra);},



refreshStream:function(qa,ra){
if(qa!=x.REFRESH_STREAM)
return;

var sa=this.getCurrentFilterKey(),
ta={filter:sa},
ua={filter:sa};
ra.noScroll&&(ua.noScroll=1);
this.refresh(pa.REFRESH_TRANSITION,ta,ua);},


getNewest:function(){
return this.newest;}});



fa(pa,
{ANIMATION_DURATION:300,
REFRESH_METHOD:'GET',
REFRESH_TRANSITION:1,
REFRESH_PREPEND:2,
REFRESH_APPEND:3,
REFRESH_EXPAND:5,
DELAYED_STREAM:6,

FEED_FILTER_KEY_NEW_HIGHLIGHTS:'h',
FEED_FILTER_KEY_NEWS_FEED:'lf',
FEED_FILTER_KEY_DUAL_NEWS_FEED:'nf',
FEED_FILTER_KEY_LIVE_STREAM_BOX:'pub',






VALID_PARAMS:['filter','show_hidden'],
ENDPOINT:'/ajax/intent.php',

getInstance:function(qa){
return pa.instances[qa];},


isHighlightsFilter:function(qa){
if(!qa)
return false;


return la
(qa,
pa.FEED_FILTER_KEY_NEW_HIGHLIGHTS);},



getStoriesByAssoc:function(qa){
return n.scry(pa.instance.root,'div.aid_'+qa);}});



e.exports=pa;});

/** js/stream/UIIntentionalStream-legacy.js */
__d("legacy:UIIntentionalStream",["UIIntentionalStream"],function(a,b,c,d){



a.UIIntentionalStream=b('UIIntentionalStream');},

3);

/** js/ui/UIPagelet-legacy.js */
__d("legacy:UIPagelet",["UIPagelet"],function(a,b,c,d){



a.UIPagelet=b('UIPagelet');},

3);

/** js/fbx/navigation_home_future.js */

















function FutureHomeSideNav(){
this.parent.construct(this);}


Class.extend(FutureHomeSideNav,'FutureSideNav');

copyProperties(FutureHomeSideNav.prototype,
{init:function(){
this.parent.init.apply(this,arguments);


this.ajaxPipe=true;
this.seeAllEndpoint="/ajax/home/generic.php";
this.typeSections=
{favorites:'pinnedNav',
profiles:'pinnedNav',
apps:'appsNav',
groups:'groupsNav',
pages:'pagesNav',
lists:'listsNav',
interests:'interestsNav',
connect_apps:'connectNav'};



this.switchingFromTitanFixedFrame=false;


this._arbiterSubscriptions.push
(Arbiter.subscribe
('titan_fixed_frame_changed',
this.handleFixedFrameChanged.bind(this)),

Arbiter.subscribe
(NavigationMessage.NAVIGATION_FAVORITE_UPDATE,
this.updateFavorite.bind(this)),

Arbiter.subscribe
(NavigationMessage.NAVIGATION_FIRST_RESPONSE,
this.navigationFirstResponse.bind(this)));



this._ensureHover('homeSideNav');
this._initPageletCache();},


_initPageletCache:function(a){
if(window.PageletCacheController){
this._cache=
PageletCacheController.registerController('pagelet_navigation',this);
if(this._cache){

this._cache.registerCleanup('HomeNav/cleanup');
onleaveRegister(function(){
Arbiter.inform('HomeNav/cleanup');});}}},








initMoreLink:function(a){
this._eventHandlers.push
(Event.listen
(a,
'click',
this._showMoreSections.bind(this,a)));},







_showMoreSections:function(a){
var b=DOM.scry(this.root,'div.belowThreshold');
CSS.hide(a);
b.forEach(function(c){
CSS.removeClass(c,'belowThreshold');});},







handleFixedFrameChanged:function(a,b,c){
if(b){


var d=function(e,f){
var g=DOMPosition.getElementPosition(ge(f)).y;
UIPagelet.loadFromEndpoint
(e,
f,
{fixed_frame:b,selected_key:c,v_pos:g});};


d('PinnedNavigationPagelet','pagelet_pinned_nav');
d('BookmarkNavigationPagelet','pagelet_bookmark_nav');

if(ge('chatFriendsOnline'))
CSS.hide(ge('chatFriendsOnline'));}else 






this.switchingFromTitanFixedFrame=true;},



handlePageTransition:function(a){
if(this.switchingFromTitanFixedFrame){
this.switchingFromTitanFixedFrame=false;
return false;}else 

return this.parent.handlePageTransition(a);},



_initSection:function(a){
var b=this.parent._initSection(a);


for(var c in this.typeSections){
var d=this.typeSections[c];
if(b.id==d){
var e=DOM.scry(b.node,'h4.navHeader')[0];
if(e){
var f='\/bookmarks\/('+c+')(\/)?';
b.seeall=this._initItem
({node:e,
id:b.id,
endpoint:this.seeAllEndpoint,
key:['bookmarks'],
path:[{regex:f}]});}}}




return b;},


_constructItem:function(a,b){
return new FutureHomeSideNavItem(a,b);},


_constructSection:function(a){
return new FutureHomeSideNavSection(a);},


getSection:function(a){
return this.typeSections[a]&&this.sections[this.typeSections[a]];},


_getItemForKey:function(a){

var b=this.parent._getItemForKey("nf");
if(b&&b.matchKey(a)){
return b;}else 

return this.parent._getItemForKey(a);},



_isCurrentPath:function(a){

return ((a.getDomain()===this.uri.getDomain())&&
(a.getPath()==='/'||a.getPath()==='/home.php'));},



_handleMenuClick:function(a,b,c,event){
if(CSS.hasClass(c,'favorite')){
Arbiter.inform(NavigationMessage.NAVIGATION_FAVORITE_UPDATE,
{key:b.numericKey,
favorite:!a.equals(this.getSection("favorites")),
movetop:CSS.hasClass(c,'movetop')});}else 


this.parent._handleMenuClick(a,b,c,event);},






removeItemByKey:function(a){
Arbiter.inform(NavigationMessage.NAVIGATION_ITEM_REMOVED,a);
this.parent.removeItemByKey(a);},





toggleItemByKey:function(a,b){
var c=this.getNodeForKey(a);
if(!b){
Arbiter.inform(NavigationMessage.NAVIGATION_ITEM_HIDDEN,a);
c&&CSS.hide(c);}else 

c&&CSS.show(c);

var d=this._getItemForKey(a);
this.getSection(d.type).refresh();},





removeItem:function(a){
var b=this.getSection(a.type);
this.parent.removeItem(a);
b.refresh();},


updateFavorite:function(a,b){


var c=this._findItem(function(l){
return l.matchKey(b.key)&&l.canFavorite();}),


d=this.getSection("favorites"),
e=emptyFunction,
f=b.favorite?
d.addEndpoint:
d.removeEndpoint;
if(b.movetop)

f=d.editEndpoint;





if(!c&&(b.favorite||b.movetop)){
if(b.movetop)
var g=DOM.scry(this.root,'.expandableSideNav'),
h=
g&&g.length&&CSS.hasClass(g[0],'expandedMode');

e=function(){
UIPagelet.loadFromEndpoint
('PinnedNavigationPagelet',
'pagelet_pinned_nav',
{expanded:h});};}else


if(!c){
e=function(){
UIPagelet.loadFromEndpoint
('BookmarkNavigationPagelet',
'pagelet_bookmark_nav');};}else{



if(b.movetop){
CSS.show(c.node);
this.moveItem(d,c);

var i=Parent.byClass(c.node,'uiSideNav');
if(i&&i.childNodes.length){
var j=
Parent.byClass(DOM.scry(i,'.sortableItem')[0],'sideNavItem');
DOM.insertBefore(j,c.node);
CSS.removeClass(c.node,'hidden');}}else{


var k=this.getSection(c.type);
if(b.favorite){
CSS.show(c.node);
this.moveItem(d,c);
c.showFavorite();}else
if(!k.equals(d)){
this.moveItem(k,c,true);
c.hideFavorite();}else 

this.removeItem(c);

k.refresh();}


d.refresh();


b.key=c.numericKey;
Arbiter.inform('NavigationMessage.FAVORITES_UPDATED');}


new AsyncRequest().
setURI(f).
setData({id:b.key,movetop:b.movetop}).
setHandler(e).
send();},


_doPageTransition:function(a,b){
this._unloadStreams();
var c=this.parent._doPageTransition(a,b);
if(c&&(a.type=='groups'||
a.type=='lists'||
a.type=='interests')){
a.setCount(0);


a.hideUnreadDot();}

return c;},


_unloadStreams:function(){
var a=window.UIIntentionalStream&&UIIntentionalStream.instances,
b=['nile','global','friends','blade'];
a&&b.forEach(function(c){
a[c]&&a[c].unload();});},



navigationFirstResponse:function(){
this.setSelected(this.loading);}});




function FutureHomeSideNavSection(a){
this.parent.construct(this,a);

this.editEndpoint='/ajax/bookmark/edit/';
this.addEndpoint='/ajax/bookmark/add/';
this.removeEndpoint='/ajax/bookmark/delete/';}


Class.extend(FutureHomeSideNavSection,'FutureSideNavSection');

copyProperties(FutureHomeSideNavSection.prototype,
{refresh:function(){


var a=DOM.scry(this.node,'li.sideNavItem'),
b=DOM.scry(this.node,'div.actionLinks'),
c=a.some(CSS.shown);

CSS.conditionShow(DOM.find(this.node,'h4.navHeader'),c);
b.length&&CSS.conditionShow(b[0],c);}});




function FutureHomeSideNavItem(a,b){
this.parent.construct(this,a,b);}


Class.extend(FutureHomeSideNavItem,'FutureSideNavItem');

copyProperties(FutureHomeSideNavItem.prototype,
{canFavorite:function(){
return !!this._getFavoriteLabel();},


showFavorite:function(){
DOM.setContent(this._getFavoriteLabel(),"Remove from Favorites");},


hideFavorite:function(){
DOM.setContent(this._getFavoriteLabel(),"Add to Favorites");},


hideUnreadDot:function(){
var a=DOM.scry(this.node,'img.unreadDot')[0];
a&&CSS.hide(a);},


_getFavoriteLabel:function(){
return DOM.scry(this.node,'li.favorite span.itemLabel')[0];}});

/** js/feed/KeyboardControl.js */
__d("FeedKeyboardController",["Event","$","Arbiter","CSS","DOM","DOMScroll","DOMQuery","Focus","Keys","NavigationMessage","Parent","Run","Vector","ViewportBounds","copyProperties","ge","throttle"],function(a,b,c,d,e,f){



var g=b('Event'),

h=b('$'),
i=b('Arbiter'),
j=b('CSS'),
k=b('DOM'),
l=b('DOMScroll'),
m=b('DOMQuery'),
n=b('Focus'),
o=b('Keys'),
p=b('NavigationMessage'),
q=b('Parent'),
r=b('Run'),
s=b('Vector'),
t=b('ViewportBounds'),

u=b('copyProperties'),
v=b('ge'),
w=b('throttle');

o.J=74;
o.K=75;
o.L=76;
o.C=67;

var x;

function y(aa){
this.root=aa;
this.init();}


function z(){
x=j.hasClass(document.documentElement,'tinyViewport')?
0:h('pagelet_bluebar').offsetTop+h('pagelet_bluebar').offsetHeight;}


z.defer();
g.listen
(window,
'resize',
w(z));


u(y.prototype,

{findTop:function(){
var aa=k.scry(this.root,'li.uiStreamStory');
for(var ba=0;ba<aa.length;ba++)
if(s.getElementPosition(aa[ba]).y>
s.getScrollPosition().y)
return aa[ba];},




onLeave:function(){
this.keydownListener&&this.keydownListener.remove();
this.focusinListener&&this.focusinListener.remove();
this.navigationListener&&i.unsubscribe(this.navigationListener);},


init:function(){
r.onLeave(this.onLeave.bind(this));
this.navigationListener=i.subscribe
(p.NAVIGATION_BEGIN,
this.onLeave.bind(this));

this.keydownListener=g.listen
(document,
'keydown',
function(aa){
var ba=g.getKeyCode(aa);
if(aa.getModifiers().any)
return true;

var ca=this.getParentStory(document.activeElement);
if((ba!=o.J)&&(ba!=o.K)&&!ca)
return true;

if(this.isInteractive(document.activeElement))
return true;

switch(ba){
case o.DOWN:
case o.J:
this.vert(1);
break;
case o.UP:
case o.K:
this.vert(-1);
break;
case o.L:
this.click('.UFILikeLink');
break;
case o.C:
this.click('.comment_link');
break;
case o.RETURN:
if(this.selected.id=='pagelet_composer'){
var da=k.scry(this.selected,'textarea')[0];
da&&n.set(da);}else 

this.click('.comment_link');

break;

default:return;
}
this.hasUsedKeyboard=true;
aa.preventDefault();}.
bind(this));

this.focusinListener=g.listen
(document,
'focusin',
function(aa){
var ba=aa.getTarget(),
ca=this.getParentStory(ba);
if(ca&&(this.selected!=ca)){
this.setSelected(ca);
if(!this.isInteractive(ba))
this.setFocused(ca);}}.


bind(this));},



click:function(aa){
if(this.selected){
var ba=m.scry(this.selected,aa);
if((ba.length==1)&&j.shown(ba[0]))
ba[0].click();}},




vert:function(aa){
if(!this.selected){
this.setSelected(this.findTop());
this.setFocused(this.findTop());
return;}

var ba;
if(this.selected.id=='pagelet_composer'){
ba=aa>0?m.scry(this.root,'li.uiStreamStory')[0]:null;}else 

ba=aa>0?this.selected.nextSibling:
(this.selected.previousSibling||v('pagelet_composer'));

if(!ba){
return;}else
if(!m.isElementNode(ba)){
j.removeClass(this.selected,'selectedStorySimple');
this.selected=ba;
return this.vert(aa);}


var ca=Math.min
(Math.abs
(s.getElementPosition(ba).y-
t.getTop()-
document.body.scrollTop),

400);


this.anim&&this.anim.stop();
var da=(Date.now()-(this.lastScroll||0)>30);
this.anim=l.scrollTo
(ba,
da?ca:0,
false,
s.getViewportDimensions().y-x-10,
this.setFocused.bind(this,ba));

this.setSelected(ba);
this.lastScroll=Date.now();},


setSelected:function(aa){
var ba=m.scry(aa,'.selectedStoryIndicator');
if(!ba.length)
k.prependContent
(aa,
k.create('div',{'class':'selectedStoryIndicator'}));


this.selected&&this.setTabindexOnHeadline(this.selected,"-1");
this.setTabindexOnHeadline(aa,"0");
this.selected&&j.removeClass(this.selected,'selectedStorySimple');
this.selected=aa;
j.addClass(this.selected,'selectedStorySimple');},


getParentStory:function(aa){
return q.byClass(aa,"uiStreamStory");},


getHeadline:function(aa){
return m.scry(aa,'h5.uiStreamHeadline')[0];},


isInteractive:function(aa){
return ((aa.nodeName=="INPUT")||
(aa.nodeName=="TEXTAREA")||
(aa.nodeName=="A")||
q.byAttribute(aa,"contenteditable"));},


setTabindexOnHeadline:function(aa,ba){
if(j.hasClass(aa,"uiStreamStory")){
var ca=this.getHeadline(aa);
if(ca)
ca.tabIndex=ba;}},




setFocused:function(aa){
if(j.hasClass(aa,"uiStreamStory")){
var ba=this.getHeadline(aa);
ba&&n.set(ba);}}});





e.exports=y;});

/** js/feed/feed_tracking_async.js */
__d("FeedTrackingAsync",["Event","collectDataAttributes","copyProperties"],function(a,b,c,d,e,f){





var g=b('Event'),

h=b('collectDataAttributes'),
i=b('copyProperties');

function j(k){
g.listen(k,'AsyncRequest/send',function(event){
var l=event.getTarget(),
m=event.getData().request,
n=m.getData(),
o=h(l,['ft']);
i(n,o);});}



e.exports=
{init:j};});

/** js/home/stream_cache.js */





function StreamPageletCacheController(a,b){







this.parent.construct(this,a,b,[]);}


Class.extend(StreamPageletCacheController,'PageletCacheController');

copyProperties(StreamPageletCacheController.prototype,

{getControllerDataOnSnapshot:function(a){





return {newest:a.getNewest()};},



updateAfterload:function(a){
a.loadNewer();}});

/** js/modules/ViewportTracking.js */
__d("ViewportTracking",["Event","Arbiter","NavigationMessage","Run","Style","UIIntentionalStreamMessage","Vector","clickRefAction","copyProperties","debounce"],function(a,b,c,d,e,f){






























































var g=b('Event'),

h=b('Arbiter'),
i=b('NavigationMessage'),
j=b('Run'),
k=b('Style'),
l=b('UIIntentionalStreamMessage'),
m=b('Vector'),

n=b('clickRefAction'),
o=b('copyProperties'),
p=b('debounce'),

q='vpv';

function r(){}

o(r.prototype,


{init:function(s){
o(this,





{readStoryIDs:{},





minSizeToBeVisible:200,

listeners:[],
arbiterSubscriptions:[]});




this.getDataFromConfig(s);

this.fireTimer();

var t=p(this.fireTimer,this.getTimeout(),this);

this.listeners.push
(g.listen
(window,
'scroll',
t));


this.listeners.push
(g.listen
(window,
'resize',
t));



this.arbiterSubscriptions.push
(h.subscribe
(l.UPDATE_HTML_CONTENT,
t));



j.onLeave(this.cleanup.bind(this));
this.arbiterSubscriptions.push
(h.subscribe
(i.NAVIGATION_BEGIN,
this.cleanup.bind(this)));},







cleanup:function(){
this.listeners.forEach(function(s){
s.remove();});

this.listeners=[];

this.arbiterSubscriptions.forEach(function(s){
s.unsubscribe();});

this.arbiterSubscriptions=[];},






fireTimer:function(){
this.getStoriesInView().forEach(this.markStoryRead.bind(this));},










getStoriesInView:function(){


var s=this.getAllStories(),

t=[],
u=false;
for(var v=0;v<s.length;v++){
var w=s[v],



x=this.getStoryID(w);
if(this.hasBeenVisible(x))
continue;



if(this.isVisible(w)){
t.push(w);
u=true;}else



if(u)
break;}



return t;},






hasBeenVisible:function(s){
return s in this.readStoryIDs;},






isVisible:function(s){
var t=m.getViewportDimensions(),
u=m.getElementPosition(s,'viewport'),
v=m.getElementDimensions(s),

w=Math.max(u.y,0),
x=Math.min(u.y+v.y,t.y),
y=Math.min(v.y,this.minSizeToBeVisible);
return (x-w)>=y;},









markStoryRead:function(s){
var t=this.getStoryID(s);
if(!t)
return;


if(!this.hasBeenVisible(t)){
this.readStoryIDs[t]=true;



var u=this.getDataToLog(s);

n(q,
s,null,'FORCE',u);}}});











e.exports=r;});

/** js/modules/collectSubtreeData.js */
__d("collectSubtreeData",[],function(a,b,c,d,e,f){













function g(i,j,k,l,m){
if(i.offsetWidth===0&&i.offsetHeight===0)

return m;


var n={};
if(i.getAttribute)
for(r=0;r<j.length;r++){
t=j[r];
var o=i.getAttribute(k[t]);
if(o){
n[t]={};
var p=JSON.parse(o);
for(var q in l)
if(p[q]!==undefined){
n[t][q]=true;
if(m[t]===undefined)
m[t]={};

if(m[t][q]===undefined)
m[t][q]=[];

if(l[q].length>0)
m[t][q].push(l[q]);

m[t][q].push('('+p[q]);}}}






for(var r=0;r<i.childNodes.length;r++){
var s=i.childNodes[r];
g(s,j,k,l,m);}


for(var t in n)
for(var u in n[t]){



var v=m[t][u][m[t][u].length-1];
if(v.length>0&&v.charAt(0)=='('){

m[t][u][m[t][u].length-1]=v.substr(1);}else 


m[t][u].push(')');}




return m;}






function h(i,j){
var k={};
for(var l=0;l<j.length;++l)
k[j[l]]='data-'+j[l];


var m={tn:"","tn-debug":","},
n={};
g(i,j,k,m,n);

for(var o in n)
for(var p in n[o])
n[o][p]=n[o][p].join('');


return n;}


e.exports=h;});

/** js/stream/StreamViewportTracking.js */
__d("StreamViewportTracking",["Class","DOM","ViewportTracking","$","collectSubtreeData","copyProperties","ge"],function(a,b,c,d,e,f){














var g=b('Class'),
h=b('DOM'),
i=b('ViewportTracking'),

j=b('$'),
k=b('collectSubtreeData'),
l=b('copyProperties'),
m=b('ge'),

n=51;

function o(){
this.parent.construct(this);}


g.extend(o,i);

l(o.prototype,


{getDataFromConfig:function(p){
this.recordTNTree=p.record_tn_tree;
this.timeout=p.record_delay;},


getTimeout:function(){
return this.timeout;},





getAllStories:function(){
return h.scry(j('home_stream'),'.uiStreamStory');},






getStoryID:function(p){
var q=JSON.parse(p.getAttribute('data-ft'));
return q.mf_story_key;},





getDataToLog:function(p){
var q={evt:n};


if(this.recordTNTree){
var r=k(p,['ft']);
for(var s in r.ft){
q[s+'_tree']=r.ft[s];
if(s==='tn-debug')

p.setAttribute('tn-debug_subtree',r.ft[s]);}



q.evt_value=p.offsetHeight;
var t=m('home_stream');
if(t)
q.offset=Math.max(0,p.offsetTop-t.offsetTop);}


return {ft:q};}});



e.exports.init=function(p){
(new o()).init(p);};});

/** js/stream/UIIntentionalStreamRefresh-legacy.js */
__d("legacy:UIIntentionalStreamRefresh",["UIIntentionalStreamRefresh"],function(a,b,c,d){



a.UIIntentionalStreamRefresh=b('UIIntentionalStreamRefresh');},

3);
