/*!CK:1701438563!*//*1459461033,*/

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

__d("LocalSERPSurfaceRequestParam",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={SINGLE_STATE:"sist",TYPEAHEAD:"tyah",ECHO:"ec",SERP_TO_SERP:"s2s",NEARBY_PLACES:"nepl",FEED_STORY:"fest",PLACES_TAB:"plta",NOTIFICATIONS:"noti",RECENT_SEARCHES:"rese",TODAY:"to"};},null);
__d("SearchAwarenessEventTypes",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={CLICK:"click",IMPRESSION:"impression",DISMISSAL:"dismissal",WEAK_DISMISSAL:"weak_dismissal",SYSTEM_FORCED_DISMISSAL:"system_forced_dismissal"};},null);
__d("SearchAwarenessUserAction",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={LIKE:"like",COMMENT:"comment",ARTICLE_CLICK:"article_click",COMPOSE_PUBLISH:"compose_publish",PAGE_LIKE:"page_like"};},null);
__d("SearchPivotType",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={PHOTO:"photo",PHOTO_EXPERIMENTAL:"photo_experimental",VIDEO:"video",FEED_SEARCH_KEYWORDS:"feed_search_keywords",SEARCH_AWARENESS_KEYWORDS:"search_awareness_keywords",ARTICLE_CLICK_ACTION:"ARTICLE_CLICK_ACTION",STORY_CLICK_ACTION:"STORY_CLICK_ACTION",STORY_LIKE_ACTION:"STORY_LIKE_ACTION",STORY_UNLIKE_ACTION:"STORY_UNLIKE_ACTION",STORY_COMMENT_DELETE_ACTION:"STORY_COMMENT_DELETE_ACTION",COMPOSER_PUBLISH_ACTION:"COMPOSER_PUBLISH_ACTION",FAN_PAGE_ACTION:"FAN_PAGE_ACTION",TRENDING_SERP_LOAD:"TRENDING_SERP_LOAD",PHOTOS_SERP_LOAD:"PHOTOS_SERP_LOAD",STORY_COMMENT_ACTION:"STORY_COMMENT_ACTION",SCROLL_ACTION:"SCROLL_ACTION",NEWS_FEED:"NEWS_FEED",PAGE:"PAGE",GROUP:"GROUP",NEWS_FEED_SECONDARY:"NEWS_FEED_SECONDARY",POST_SEARCH_SERP:"POST_SEARCH_SERP",LEARNING_NUX:"LEARNING_NUX",LEARNING_NUX_SECOND_STEP:"LEARNING_NUX_SECOND_STEP",MOBILE_STORY_LIKE_ACTION:"MOBILE_STORY_LIKE_ACTION",MOBILE_STORY_COMMENT_ACTION:"MOBILE_STORY_COMMENT_ACTION",MOBILE_COMMENT_LIKE_ACTION:"MOBILE_COMMENT_LIKE_ACTION",TIMELINE:"TIMELINE",NEXT_TRENDING:"NEXT_TRENDING",LEARNING_NUX_STANDALONE:"LEARNING_NUX_STANDALONE",TUTORIAL_NUX:"TUTORIAL_NUX",FEED_READ_ACTION:"FEED_READ_ACTION"};},null);
__d("TimelineFilterOptions",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={ALL:"all",REVIEW:"review",TAG_REVIEW:"tagreview",FACE_ALERTS:"facealertsreview",POSTSANDAPPS:"postsandapps",LOCATION:"location",PHOTOS:"photos",TAGGED_PHOTOS:"taggedphotos",OWN_PHOTOS:"ownphotos",LIKES:"likes",LIKED_INTERESTS:"likedinterests",LIKED_POSTS:"likedposts",GROUPS:"groups",GROUP_MEMBERSHIP:"groupmembership",GROUP_POSTS:"groupposts",HIDDEN:"hidden",SPAM:"spam",ALL_APPS:"apps",SEARCH:"search",VIDEO_SEARCH:"videosearch",ADS:"ads",CLUSTER:"cluster",APP:"app",STORIES:"stories",COLLECTION_ITEM:"citem",FITNESS:"fitness",OG_VIDEO:"ogvideo",SAVED_FOR_LATER:"saved",PRIVATE_NOTES:"private_notes",NOW:"now"};},null);
__d("WorkInviteSource",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={RHC_MODULE:"rhc_module",NEWSFEED_NUX:"newsfeed_nux",IOS_APP:"ios_app",ANDROID_APP:"android_app",BULK_UPLOAD:"bulk_upload",GROUP_INVITE_DIALOG:"group_invite_dialog",GROUP_INVITE_TYPEAHEAD:"group_invite_typeahead",SEARCH_RESULT:"search_result",SEARCH_RHC:"search_rhc",SEARCH_TYPEAHEAD:"search_typeahead",SELF_INVITE:"self_invite",SELF_INVITE_VIA_INVITE_LINK:"self_invite_via_invite_link"};},null);
__d('BrowseFacebarHighlighter',['csx','CSS','NodeHighlighter'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={};Object.assign(i,c('NodeHighlighter'),{getHighlightCandidates:function(){return ["._53ad"];},isDiscardNode:function(j){return c('CSS').hasClass(j,'DefaultText');},createSegmentedRegex:function(j){j=this.escapeAndAddBidirectionalCharsToTokens(j);return '(^|\\s|\\b)('+j.join('|')+')';}});f.exports=i;},null);
__d('TypeaheadFacepileX.react',['React','joinClasses'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'TypeaheadFacepile',renderPic:function(i,j){var k='url('+this.props.photos[i]+')';return (c('React').createElement('span',{className:c('joinClasses')('splitpic',j),key:i,style:{backgroundImage:k}}));},renderPics:function(){var i=this.props.size;if(i>=3){return [this.renderPic(0,'leftpic'),this.renderPic(1,'toppic'),this.renderPic(2,'bottompic')];}else return [this.renderPic(0,'leftpic'),this.renderPic(1)];},render:function(){return (c('React').createElement('span',babelHelpers['extends']({},this.props,{className:c('joinClasses')(this.props.className,"splitpics clearfix")}),this.renderPics()));}});f.exports=h;},null);
__d("XSearchAwarenessController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/search\/async\/awareness\/",{origin:{type:"String"},story_id:{type:"String"},actor_id:{type:"String"},global_share_id:{type:"String"},query:{type:"String"},dismiss:{type:"Exists",defaultValue:false},source_object_id:{type:"String"},user_action:{type:"String"}});},null);
__d('SearchAwarenessDismissButton',['Arbiter','AsyncRequest','DOM','EventListener','XSearchAwarenessController'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={init:function(i,j,k,l){var m=c('EventListener').listen(j,'click',function(){c('DOM').remove(i);m.remove();c('Arbiter').inform('SearchAwareness.dismissUnit');h.dismiss(k,l);});},dismiss:function(i,j){var k=c('XSearchAwarenessController').getURIBuilder().setString('origin',i).setString('source_object_id',j).setExists('dismiss',true);new (c('AsyncRequest'))().setURI(k.getURI()).send();}};f.exports=h;},null);
__d('SearchAwarenessDispatcher',['csx','cx','Arbiter','AsyncRequest','AttachmentRelatedShareConstants','Banzai','CSS','DOM','EventListener','NavigationMessage','PageLikeConstants','Run','SearchAwarenessDismissButton','SearchAwarenessEventTypes','SearchAwarenessUserAction','SearchAwarenessWebConfig','SearchPivotType','SubscriptionsHandler','UFIFeedbackTargets','UFIUIEvents','XSearchAwarenessController','getScrollPosition','joinClasses','setTimeoutAcrossTransitions','throttle'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=false,k={},l={},m,n={init:function(){if(!c('SearchAwarenessWebConfig').master_gk)return;if(j)return;m=new (c('SubscriptionsHandler'))();m.addSubscriptions(c('Arbiter').subscribe(c('NavigationMessage').NAVIGATION_BEGIN,n._cleanup.bind(this)),c('Arbiter').subscribe(c('PageLikeConstants').LIKED,n._onFan.bind(this)),c('Arbiter').subscribe('composer/publish',n._onComposerPublish.bind(this)),c('Arbiter').subscribe('LitestandComposer/publish',n._onComposerPublish.bind(this)),c('Arbiter').subscribe(c('AttachmentRelatedShareConstants').ARTICLE_CLICK,n._onArticleClick.bind(this)));c('Run').onLeave(n._cleanup.bind(this));j=true;},_cleanup:function(){m&&m.release();m=null;j=false;var o=c('DOM').scry(document.body,"._18az")[0];if(o==null)return;c('CSS').removeClass(document.body,"_18at");c('CSS').removeClass(document.body,"_18au");c('CSS').removeClass(document.body,"_18aw");c('CSS').removeClass(o,"_18ax");},_onFan:function(o,p){if(!c('SearchAwarenessWebConfig').has_on_fan)return;n._dispatch(p.target,{origin:c('SearchPivotType').FAN_PAGE_ACTION,actor_id:p.profile_id,user_action:c('SearchAwarenessUserAction').PAGE_LIKE});},_onLike:function(o,p){if(!p.ft_id)return;c('UFIFeedbackTargets').getFeedbackTarget(p.ft_id,function(q){var r=q.entidentifier;if(r==null||k[r]!=null)return;k[r]=true;n._dispatch(p.target,{actor_id:q.actorid,story_id:q.entidentifier,origin:p.origin,query:p.query,user_action:c('SearchAwarenessUserAction').LIKE});});},_onPhotoClick:function(o,p){if(!c('SearchAwarenessWebConfig').has_on_photo_click)return;n._dispatch(p.target,{story_id:p.storyid,origin:c('SearchPivotType').STORY_CLICK_ACTION});},_onArticleClick:function(o,p){if(!c('SearchAwarenessWebConfig').has_on_article_click)return;var q=p.global_share_id!=null?String(p.global_share_id):null;n._dispatch(null,{global_share_id:q,story_id:p.share_id,origin:c('SearchPivotType').ARTICLE_CLICK_ACTION,user_action:c('SearchAwarenessUserAction').ARTICLE_CLICK});},initOnComment:function(o,p){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();if(m==null)return;m.addSubscriptions(c('Arbiter').subscribe('UFI/CommentAddedActive',function(q,r){var s={origin:o,query:p,ft_id:r};n._onComment(q,s);}));},_onComment:function(o,p){if(!p.ft_id)return;c('UFIFeedbackTargets').getFeedbackTarget(p.ft_id,function(q){var r=q.entidentifier;if(r==null||l[r]!=null)return;l[r]=true;n._dispatch(p.target,{actor_id:q.actorid,story_id:q.entidentifier,origin:p.origin,query:p.query,user_action:c('SearchAwarenessUserAction').COMMENT});});},_onComposerPublish:function(o,p){if(!c('SearchAwarenessWebConfig').has_on_composer_publish)return;n._dispatch(null,{story_id:p.content_id,origin:c('SearchPivotType').COMPOSER_PUBLISH_ACTION,user_action:c('SearchAwarenessUserAction').COMPOSE_PUBLISH});},initOnLike:function(o,p,q){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();if(m==null)return;m.addSubscriptions(c('Arbiter').subscribe(c('UFIUIEvents').ReactionButtonClicked,function(r,s){s.origin=o;s.query=p;if(q)s.target=null;n._onLike(r,s);}));},onPageLoad:function(o,p,q){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();n._dispatch(null,{query:p,origin:o,actor_id:q});},initProfileScopedSearch:function(){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();if(m==null)return;var o=c('DOM').scry(document.body,"._5ibl")[0];if(o!=null){n._dispatch(o,{origin:c('SearchPivotType').TIMELINE,specified_target:true});}else m.addSubscriptions(c('Arbiter').subscribe('profileSearchBoxLoaded',function(){var p=c('DOM').scry(document.body,"._5ibl")[0];if(p==null)return;n._dispatch(p,{origin:c('SearchPivotType').TIMELINE,specified_target:true});}));},onPhotosSERPLoad:function(o){if(o==null||!c('SearchAwarenessWebConfig').master_gk)return;n._dispatch(null,{query:o,origin:c('SearchPivotType').PHOTOS_SERP_LOAD});},_dispatch:function(o,p,q){if(!p.origin)return true;var r=c('XSearchAwarenessController').getURIBuilder().setString('origin',p.origin);if(p.story_id)r.setString('story_id',p.story_id);if(p.actor_id)r.setString('actor_id',p.actor_id);if(p.global_share_id)r.setString('global_share_id',p.global_share_id.toString());if(p.query)r.setString('query',p.query);if(p.user_action)r.setString('user_action',p.user_action);var s=new (c('AsyncRequest'))().setURI(r.getURI()),t=o;if(o!=null&&!p.specified_target)t=this.findStory(o);if(t==null){var u=c('DOM').scry(document.body,"._585-")[0],v=c('DOM').scry(document.body,"._5ob9")[0];t=u!=null?u:v;}if(t)s.setRelativeTo(t);if(q)s.setHandler(q);if(t||q)s.send();return true;},showAwarenessExperienceNow:function(o,p,q){if(!j)n.init();if(p==null||!j||m==null)return;var r=void 0;m.addSubscriptions(p.subscribe('cancel',function(){r=true;c('SearchAwarenessDismissButton').dismiss(o);}),p.subscribe('hide',function(){if(!r&&q){c('Banzai').post('search_awareness',{origin:o,event_type:c('SearchAwarenessEventTypes').WEAK_DISMISSAL},{signal:true});}else if(!r&&!q)c('Banzai').post('search_awareness',{origin:o,event_type:c('SearchAwarenessEventTypes').SYSTEM_FORCED_DISMISSAL},{signal:true});}),c('Arbiter').subscribe('SearchAwareness.weakDismissUnit',function(){if(p!=null){r=false;p.hide();}}),c('Arbiter').subscribe('SearchAwareness.dismissUnit',function(){if(p!=null){r=true;p.hide();}}));p.show();c('Run').onLeave(function(){p=null;});},findStory:function(o){var p="^div._4-u2",q=c('DOM').scry(o,p);return q.length===1?q[0]:null;},onTrendingSERPLeave:function(o,p){if(!j)n.init();if(o==null||!j)return;c('Run').onLeave(function(){c('setTimeoutAcrossTransitions')(function(){c('Run').onAfterLoad(function(){n._dispatch(null,{query:o,origin:c('SearchPivotType').TRENDING_SERP_LOAD});});},p);});},openBelowBluebarUnit:function(o){if(!j)n.init();var p=c('DOM').scry(document.body,"._18a-")[0];if(p==null)return;var q;switch(o){case c('SearchPivotType').TRENDING_SERP_LOAD:q="_18at";break;case c('SearchPivotType').GROUP:q="_18au";break;case c('SearchPivotType').PAGE:q="_18aw";break;}if(q==null)return;c('CSS').addClass(document.body,q);c('CSS').addClass(p,"_18ay");var r=c('Arbiter').subscribe('SearchAwareness.dismissUnit',function(){c('CSS').removeClass(document.body,q);});m&&m.addSubscriptions(r);},trigger:function(o,p,q,r,s){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();n._dispatch(null,{query:p,origin:o,actor_id:q,story_id:r,global_share_id:s});},triggerLearningNUX:function(o,p,q,r,s){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();n._dispatch(null,{query:p,origin:o,actor_id:q,story_id:r,global_share_id:s},function(t){var u=c('DOM').create('div',{className:c('joinClasses')("_3lik","hidden_elem"),'data-origin':o});c('DOM').appendContent(u,t.payload);c('DOM').appendContent(document.body,u);setTimeout(function(){c('Arbiter').inform('SearchAwareness.triggerLearningNUX',{origin:o});},0);});},onTimelineScroll:function(o,p,q,r){if(!c('SearchAwarenessWebConfig').master_gk)return;if(!j)n.init();var s=false,t=c('EventListener').listen(document,'scroll',c('throttle')(function(event){if(!s&&c('getScrollPosition')(window).y>p){s=true;n.onPageLoad(o,q,r);t.remove();}},500));}};f.exports=n;},null);
__d('FacebarSemanticQuery',['CurrentUser','URI'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='str',i=/\*[\w\-]+\(/g;function j(t){var u={me:c('CurrentUser').getID()};return Object.assign(u,Array.isArray(t.semantic_map)?{}:t.semantic_map);}function k(t,u){var v=j(t);if(typeof v[u]!=='undefined')return String(v[u]);return u;}function l(t){return new (c('URI'))("/profile.php").addQueryData({id:t});}function m(t,u){var v=[u],w=[],x=t.browse_functions,y=t.search_path;while(v.length>0){var z=v.pop();if(!p(z)){w.push(z);continue;}var aa=z.substring(0,z.indexOf('(')),ba=aa,ca=q(z);if(!x[aa]){w=[];break;}var da=x[aa].minNumParams,ea=x[aa].maxNumParams;if(v.length>0)if(x[aa].numParamsUnbounded){if(w.length>0)aa+='-'+ca.length;}else if(ca.length!=1&&ca.length>da||ca.length===0&&da!=ea)aa+='-'+ca.length;v.push(aa);for(var fa=0;fa<ca.length;fa++){if(ca[fa].length===0)continue;if(x[ba].allowsFreeText){v.push(h+'/'+encodeURIComponent(encodeURIComponent(ca[fa])));}else v.push(ca[fa]);}}return new (c('URI'))(y+w.join('/'));}function n(t){return t.replace(/['"\[\]]/g,'');}function o(t,u){var v=JSON.parse(u),w=[];if(v.length>0)w=[v[0]];var x=[],y=t.browse_functions,z=t.search_path;while(w.length>0){var aa=w.pop();if(typeof aa!=='object'){x.push(n(aa));continue;}var ba=Object.keys(aa)[0],ca=ba,da=aa[ba];if(!y[ba]){x=[];break;}var ea=y[ba].minNumParams,fa=y[ba].maxNumParams;if(w.length>0)if(y[ba].numParamsUnbounded){if(x.length>0)ba+='-'+da.length;}else if(da.length!=1&&da.length>ea||da.length===0&&ea!=fa)ba+='-'+da.length;w.push(ba);for(var ga=0;ga<da.length;ga++){if(da[ga].length===0)continue;if(y[ca].allowsFreeText){w.push(h+'/'+encodeURIComponent(da[ga]));}else w.push(da[ga]);}}return new (c('URI'))(z+x.join('/'));}function p(t){return (/^[a-z\-]+\(.*\)$/.test(t));}function q(t){if(!p(t)&&t.indexOf('param_')!==0)return [t];var u=t.substring(t.indexOf('(')+1,t.length-1);if(u.length===0)return [];return r(u);}function r(t){var u=[],v=0,w=0;for(var x=0;x<t.length;++x)if(t[x]==','&&w===0){u.push(t.substring(v,x));v=x+1;}else if(t[x]=='('){w++;}else if(t[x]==')')w--;u.push(t.substring(v,t.length));return u;}function s(t,u,v){'use strict';this.facebarConfig=t;this.unmapped=(u||"").trim();this.mapped=k(t,this.unmapped);this.position=null;this.$FacebarSemanticQuery1=typeof v!=='undefined'?v:false;}s.prototype.isEntity=function(){'use strict';return (/^\d+$/.test(this.mapped));};s.prototype.isShortcut=function(){'use strict';return this.mapped.indexOf('shortcut(')===0;};s.prototype.isImplemented=function(){'use strict';return this.mapped&&!this.mapped.match(i);};s.prototype.isSemanticForest=function(){'use strict';return this.$FacebarSemanticQuery1;};s.prototype.getUnimplemented=function(){'use strict';return (this.mapped.match(i)||[]).map(function(t){return t.substr(1,t.length-2);});};s.prototype.getURI=function(){'use strict';if(this.isEntity()){return l(this.mapped);}else if(this.isShortcut()){return new (c('URI'))(this.mapped.substr(9,this.mapped.length-10));}else if(this.isSemanticForest()){return o(this.facebarConfig,this.unmapped);}else return m(this.facebarConfig,this.unmapped);};f.exports=s;},null);
__d('FacebarURI',['FacebarJSConstants','FacebarSemanticQuery','KeywordsSearchResultConfig','URI','WWWBase','LocalSERPSurfaceRequestParam'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={event:{ref:c('FacebarJSConstants').eventLinkRef},user:{fref:'ts'},page:{fref:'ts'}},i={getSearchRawPrefix:function(){return 'search';},getSearchPath:function(){return '/'+this.getSearchRawPrefix()+'/';},getURI:function(j,k){var l=null,m=!k.song&&!k.isExtendedResult&&k.path;if(m){l=new (c('URI'))(m);if(k.type in h)l.addQueryData(h[k.type]);}else if(c('KeywordsSearchResultConfig').use_seo_urls&&k.type===c('KeywordsSearchResultConfig').result_type&&k.semantic.startsWith('str/')){if(k.keywordType===c('FacebarJSConstants').keywordTypes.local_category){l=new (c('URI'))('/search/places').addQueryData('q',k.keyword?k.keyword:k.text);}else l=new (c('URI'))(c('KeywordsSearchResultConfig').seo_top_url).addQueryData('q',k.keyword?k.keyword:k.text);}else{var n=new (c('FacebarSemanticQuery'))(j,k.semantic);if(n&&n.isImplemented())l=n.getURI();if(k.keywordType===c('FacebarJSConstants').keywordTypes.local)if(k.isSingleState){l.addQueryData('surface',c('LocalSERPSurfaceRequestParam').SINGLE_STATE);}else if(k.isRecent){l.addQueryData('surface',c('LocalSERPSurfaceRequestParam').RECENT_SEARCHES);}else l.addQueryData('surface',c('LocalSERPSurfaceRequestParam').TYPEAHEAD);}return l&&i.getQualifiedURI(l);},getQualifiedURI:function(j){var k=new (c('URI'))(j);if(!k.getDomain()){var l=new (c('URI'))(c('WWWBase').uri);k.setProtocol(l.getProtocol()).setDomain(l.getDomain()).setPort(l.getPort());}return k;}};f.exports=i;},null);
__d('FacebarFindPeopleAndPages',['cx','fbt','FacebarGlobalOptions','FacebarJSConstants','FacebarStructuredText','FacebarURI','URI'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={insertInto:function(k,l,m){k=this._cleanQuery(k);var n=this._getInsertionIndex(k,l);if(n>-1){var o=this._createFindPeopleAndPagesResult(k,m);l.splice(n,0,o);}},_getInsertionIndex:function(k,l){if(!k||!c('FacebarGlobalOptions').findPeopleAndPages)return -1;var m=l.some(this._isUserOrPageSuggestion);if(!m)return -1;var n=-1;for(var o=0;o<l.length;o++)if(this._isEntitySuggestion(l[o]))n=o+1;return n;},_isUserOrPageSuggestion:function(k){return k.type==='user'||k.type==='page';},_isEntitySuggestion:function(k){return k.type!==c('FacebarJSConstants').keywordType&&k.type!==c('FacebarJSConstants').grammarType;},_cleanQuery:function(k){return String(k).trim().replace(/\s+/g,' ').replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,'');},_createFindPeopleAndPagesResult:function(k,l){var m='str/'+k+'/keywords_entities',n=i._("Find all people and pages named \"{query}\"",[i.param('query',k)]);return {type:'grammar',results_set_type:'browse_type_blended',text:k,id:k,uid:k,query_string:k,icon_class:"_207",isSeeMore:true,isPeopleAndPagesSuggestion:true,structure:c('FacebarStructuredText').fromString(n),semantic:m,uri:c('FacebarURI').getQualifiedURI(new (c('URI'))('/search/'+m)),fromCache:l,tags:{displayedSeeMore:true}};}};f.exports=j;},null);
__d('FacebarKeywordSearchUtils',['FacebarURI','FacebarStructuredText','FacebarJSConstants','KeywordsSearchResultConfig','URI','LocalSERPSurfaceRequestParam'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=function(j){var k=0;while(k<j.length)if(j[k].exactMatchKeyword){j.splice(k,1);}else ++k;},i={addExactMatch:function(j,k,l){if(!k.length)return;var m,n;for(var o=0,p=k.length;o<p;o++){n=k[o];if(n.type==='grammar')continue;m=true;break;}if(!m)return;var q=this.getExactMatchKeywordResult(j);if(!q)return;var r=Math.min(k.length,l),s=r;for(o=0;o<r;o++){n=k[o];if(n.exactMatchKeyword)return;if(n.cost>c('KeywordsSearchResultConfig').default_cost)--s;if(n.type!==c('KeywordsSearchResultConfig').result_type)continue;q.backendCost=n.cost+c('KeywordsSearchResultConfig').exact_match_cost_delta_from_best;q.cost=n.backendCost;h(k);k.splice(o,0,q);return;}h(k);k.splice(Math.min(Math.min(r,l-1),s),0,q);},getExactMatchKeywordResult:function(j){if(!j||j.is_empty||!j.raw_text)return;var k=j.raw_text.toLowerCase().replace(/\s{2,}/g,' ').trim(),l=c('KeywordsSearchResultConfig').query_prefix_blacklist;for(var m=0;m<l.length;m++)if(k.startsWith(l[m]))return;var n=this.makeFacebarEntry(k);return this._makeFacebarResult(n,j.cache_id.length);},makeFacebarEntryForLocalPage:function(j){var k=j.getFragment(0).getUID(),l=j.getFragment(0).getText(),m=k+'/local_search',n=c('FacebarURI').getQualifiedURI(new (c('URI'))('/search/'+m).addQueryData('surface',c('LocalSERPSurfaceRequestParam').SINGLE_STATE));return {semantic:m,text:l,type:c('KeywordsSearchResultConfig').result_type,resultsSetType:c('KeywordsSearchResultConfig').result_set_type,uid:c('KeywordsSearchResultConfig').uid_prefix+l,iconClass:c('KeywordsSearchResultConfig').icon_class,keywordType:c('FacebarJSConstants').keywordTypes.local,uri:n,structure:c('FacebarStructuredText').fromString(l)};},makeFacebarEntry:function(j){var k=null,l=null;if(c('KeywordsSearchResultConfig').gsv2_results_page){l='str/'+encodeURIComponent(j).replace(/%20/g,'+')+'/'+c('KeywordsSearchResultConfig').gsv2_browse_edge;k=c('FacebarURI').getQualifiedURI(new (c('URI'))('/search/'+l));}else{k=c('FacebarURI').getQualifiedURI(new (c('URI'))(c('KeywordsSearchResultConfig').results_page_url).addQueryData('q',j));l=c('KeywordsSearchResultConfig').shortcut+'('+k.toString()+')';}if(c('KeywordsSearchResultConfig').use_seo_urls)k=c('FacebarURI').getQualifiedURI(new (c('URI'))(c('KeywordsSearchResultConfig').seo_top_url).addQueryData('q',j));return {semantic:l,text:j,type:c('KeywordsSearchResultConfig').result_type,resultsSetType:c('KeywordsSearchResultConfig').result_set_type,uid:c('KeywordsSearchResultConfig').uid_prefix+j,iconClass:c('KeywordsSearchResultConfig').icon_class,uri:k,structure:c('FacebarStructuredText').fromString(j)};},_makeFacebarResult:function(j,k){var l={semantic:j.semantic,structure:[{type:'grammar',text:j.text,uid:j.semantic}],type:j.type,resultsSetType:j.resultsSetType,cost:c('KeywordsSearchResultConfig').default_cost,cache_id_length:k,parse:{display:[{type:'grammar',uid:c('KeywordsSearchResultConfig').uid_prefix+j.text}],remTokens:[],suffix:''},iconClass:j.iconClass,exactMatchKeyword:true};l.tuid=JSON.stringify({semantic:l.semantic,structure:l.structure});return l;}};f.exports=i;},null);
__d('FacebarGSv2Echo',['cx','fbt','CurrentCommunity','CurrentUser','FacebarGlobalOptions','FacebarJSConstants','FacebarKeywordSearchUtils','FacebarStructuredText','FacebarURI','URI'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={insertInto:function(k,l,m,n,o,p,q){var r=j.normalizeValue(k);if(!this._shouldInsert(k,l))return;var s=l.findIndex(function(w){return w.isSpecialIntent&&this._isKeywordSuggestion(w)&&r===j.normalizeValue(w.text);}.bind(this),this),t=c('FacebarGlobalOptions').showEcho&&(!c('FacebarGlobalOptions').renderKeywordSnippets||s<0);if(!t)return;var u=this._removeExactMatchAndReturnSubtext(k,l),v=this._createEchoResult(k,m,u,n,o,p);if(n){if(c('FacebarGlobalOptions').singleStateClientInjections&&!o){l.unshift(this._createSingleStateResult(i._("{fullName} videos",[i.param('fullName',r)]),{isVideos:true}));l.unshift(this._createSingleStateResult(i._("{fullName} photos",[i.param('fullName',r)]),{isPhotos:true}));if(c('FacebarGlobalOptions').enablePersonSERP&&q&&k instanceof c('FacebarStructuredText'))l.unshift(this._createSingleStateResult(i._("{fullName}",[i.param('fullName',r)]),{isPersonSERP:true},k.getFragment(0).getUID()));}if(v!==null)l.unshift(v);}else if(v!==null)l.push(v);},_shouldInsert:function(k,l){k=j.normalizeValue(k);if(!k||!c('FacebarGlobalOptions').graphSearchV2)return false;for(var m=0;m<l.length;m++){var n=l[m];if(n.type===c('FacebarJSConstants').keywordType&&k===j.normalizeValue(n.text))return false;}return true;},_isKeywordSuggestion:function(k){return k.type===c('FacebarJSConstants').keywordType||k.type===c('FacebarJSConstants').grammarType;},_removeExactMatchAndReturnSubtext:function(k,l){var m='';k=j.normalizeValue(k);for(var n=0;n<l.length;n++){var o=l[n];if(this._isKeywordSuggestion(o)&&k===j.normalizeValue(o.text)){if(o.subtext)m=o.subtext;l.splice(n,1);return m;}}return m;},normalizeValue:function(k){return String(k).trim().replace(/\s+/g,' ').replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,'').toLowerCase();},_createEchoResult:function(k,l,m,n,o,p){var q=j.normalizeValue(k),r=null;if(o&&k){r=c('FacebarKeywordSearchUtils').makeFacebarEntryForLocalPage(k);}else r=c('FacebarKeywordSearchUtils').makeFacebarEntry(q);var s={};if(c('FacebarGlobalOptions').renderKeywordSnippets)if(n&&c('FacebarGlobalOptions').singleStateClientInjections){if(!o){s.boldedSubtext=m||i._("Posts");}else if(c('FacebarGlobalOptions').showLocalPageEcho){s.subtext=m||i._("See photos, posts and info about this place");if(p!==null)s.boldedSubtext=i._("{categoryName}",[i.param('categoryName',p)]);}else return null;}else if(c('CurrentUser').isWorkUser()){s.subtext=m||i._("Search {communityName}",[i.param('communityName',c('CurrentCommunity').getName())]);}else s.subtext=m||i._("Search Facebook");return babelHelpers['extends']({type:c('FacebarJSConstants').keywordType,results_set_type:c('FacebarJSConstants').browseTypes.keyword,text:k,id:q,uid:q,query_string:q,icon_class:"_5b1w",isSingleState:n,isLocal:o,exactMatchKeyword:true,structure:c('FacebarStructuredText').fromString(String(k)),semantic:r.semantic,uri:r.uri,keywordType:r.keywordType,fromCache:l,tags:{}},s);},_createSingleStateResult:function(k,l,m){k=j.normalizeValue(k);var n=void 0,o=c('FacebarKeywordSearchUtils').makeFacebarEntry(k),p=void 0,q=o.semantic,r=o.uri;if(c('FacebarGlobalOptions').renderKeywordSnippets)if(l.isPhotos){n=i._("Photos");}else if(l.isVideos){n=i._("Videos");}else if(l.isPersonSERP){if(m){q=m+'/'+c('FacebarJSConstants').browseEdges.keywords_person_serp;r=c('FacebarURI').getQualifiedURI(new (c('URI'))('/search/'+q));}n=i._("Overview");p=i._("Get an overview from public posts");}else n=i._("Posts");return babelHelpers['extends']({type:c('FacebarJSConstants').keywordType,results_set_type:c('FacebarJSConstants').browseTypes.keyword,text:k,id:k,uid:k,query_string:k,icon_class:"_5b1w",exactMatchKeyword:l.isPhotos==null&&l.isVideos==null&&l.isPersonSERP==null,structure:c('FacebarStructuredText').fromString(k),semantic:q,uri:r,boldedSubtext:n,subtext:p,tags:{},isSingleState:true},l);}};f.exports=j;},null);
__d("XAtWorkInvitesSearchDialogController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/work\/invite\/search_typeahead_dialog\/",{source:{type:"String",required:true},__asyncDialog:{type:"Int"}});},null);
__d('FacebarInviteCoworkers',['cx','fbt','WorkInviteSource','FacebarGlobalOptions','FacebarStructuredText','XAtWorkInvitesSearchDialogController'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={insertInto:function(k,l,m){k=this._cleanQuery(k);var n=this._getInsertionIndex(k,l);if(n>-1){var o=this._createInviteCoworkersResult(k,m);l.splice(n,0,o);}},_getInsertionIndex:function(k,l){if(!k||!c('FacebarGlobalOptions').inviteCoworkers)return -1;return l.length;},_cleanQuery:function(k){return String(k).trim().replace(/\s+/g,' ').replace(/[\u200E|\u200F|\u202a|\u202b|\u202c]/g,'');},_createInviteCoworkersResult:function(k,l){var m=i._("Invite \"{query}\" to Facebook at Work",[i.param('query',k)]),n=c('XAtWorkInvitesSearchDialogController').getURIBuilder().setString('source',c('WorkInviteSource').SEARCH_TYPEAHEAD).getURI();return {uid:k,icon_class:"_5yiv",isSeeMore:true,isAsync:true,structure:c('FacebarStructuredText').fromString(m),asyncURI:n,fromCache:l};}};f.exports=j;},null);
__d('FacebarNoFlickerResults',['cx','fbt','FacebarGSv2Echo','FacebarGlobalOptions','FacebarJSConstants','FacebarKeywordSearchUtils','FacebarStructuredText'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=[],k={},l=void 0,m={insertInto:function(n,o,p,q){o.forEach(function(ba){ba.isInvalidated=false;});n=c('FacebarGSv2Echo').normalizeValue(n);var r=n.length===0,s=o.filter(function(ba){return ba.type===c('FacebarJSConstants').keywordType&&!ba.exactMatchKeyword;}),t=s.filter(function(ba){return !ba.exactMatchKeyword;}),u=s.length;if(t.length>1)if(r){j=[];}else j=t.slice(0,2);if(k[n]||p===true&&q===false||u>=c('FacebarGlobalOptions').default_num_top_results_to_show){k[n]=true;if(r){j=[];}else j=t.slice(0,2);return;}if(q===false)return;var v=function(){if(x){if(y>=w.length)return 'break';z=w[y++];}else{y=w.next();if(y.done)return 'break';z=y.value;}var ba=z;if(!o.some(function(ca){return ca.text===ba.text;})){ba.isInvalidated=true;o.push(ba);}};for(var w=j,x=Array.isArray(w),y=0,w=x?w:w[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var z,aa=v();if(aa==='break')break;}if(n.length<2||l==null)l=o.filter(function(ba){return ba.type!=='keyword';})[0];if(l==null)return;o.push(this._createResult(i._("{fullName} photos",[i.param('fullName',l.text.toLowerCase())])));o.push(this._createResult(i._("{fullName} posts",[i.param('fullName',l.text.toLowerCase())])));},_createResult:function(n){n=c('FacebarGSv2Echo').normalizeValue(n);var o=c('FacebarKeywordSearchUtils').makeFacebarEntry(n),p=void 0;if(c('FacebarGlobalOptions').renderKeywordSnippets)p=i._("Search Facebook");return {type:c('FacebarJSConstants').keywordType,results_set_type:c('FacebarJSConstants').browseTypes.keyword,text:n,id:n,uid:n,query_string:n,icon_class:"_5b1w",exactMatchKeyword:true,structure:c('FacebarStructuredText').fromString(String(n)),semantic:o.semantic,uri:o.uri,subtext:p,isInvalidated:true,tags:{}};}};f.exports=m;},null);
__d('FacebarResultStore',['cx','fbt','Arbiter','FacebarGlobalOptions','FacebarJSConstants','FacebarKeywordSearchUtils','FacebarResultStoreUtils','FacebarStructuredText','KeywordsSearchResultConfig','TokenizeUtil','SearchI18nMatch','SearchPivotType','concatMap'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=3;function k(l,m,n,o){'use strict';this.facebarConfig=l;this.facebarConfig.grammar_stop_words_penalty=this.facebarConfig.grammar_stop_words_penalty||2;this.facebarConfig.grammar_stop_words=this.facebarConfig.grammar_stop_words||{};this.facebarConfig.options=o;this.injectedSuggestionCount=0;this.tokenize=m;this.getEntry=n;this.typeaheadTypeMap=this.facebarConfig.mapped_types;this.facebarConfig.typeahead_types.forEach(function(p){this.typeaheadTypeMap[p]=p;},this);this.unicodeMatch=new (c('SearchI18nMatch'))({prefix_hangul_conjoining_jamo:true});this.resetCaches();}k.prototype.transformStructured=function(l){'use strict';var m=[],n=[],o='',p='';l.forEach(function(s,t){if(s.isType('text')){o+=s.getText();p=p==null?null:p+s.getText();}else{var u=o.match(/\"/g);if(u&&u.length%2)o=o.replace(/\s+$/,'')+'"';if(o.length){Array.prototype.push.apply(m,this.tokenize(o));n.push(o);o='';}m.push(s.toStruct());n.push({uid:String(s.getUID()),type:this._getFBObjectType(s.getTypePart(1)),text:s.getText()});p=null;}},this);if(o.length){if(o[o.length-1]=='\'')o=o.substr(0,o.length-1);Array.prototype.push.apply(m,this.tokenize(o));n.push(o);if(o[o.length-1]==' ')m.push('');}var q=JSON.stringify(n),r=q.replace(/\]$/,'').replace(/\"$/,'');r=r.replace(/\s{2,}/g,' ');return {tokens:m,text_form:q,is_empty:!!q.match(/^\[(\"\s*\")?\]$/),raw_text:p,cache_id:r};};k.prototype.resetCaches=function(){'use strict';this.resetBootstrapCache();this.resetQueryCache();};k.prototype.resetBootstrapCache=function(){'use strict';this.bootstrapCache={};};k.prototype.resetQueryCache=function(){'use strict';this.queryCache={'':{tokens:[],results:[]}};};k.prototype.setNullState=function(l){'use strict';this.facebarConfig.null_state=l.map(this._extractStructure,this);};k.prototype.addEntryToNullState=function(l){'use strict';if(this.facebarConfig.null_state){var m=this.facebarConfig.entity_cost+l.grammar_costs['{'+l.type+'}'],n=c('FacebarResultStoreUtils').processEntityResult(l.type,l.uid,l.text,m);this.facebarConfig.null_state.unshift(n);}};k.prototype.addRecentEntryToNullState=function(l){'use strict';if(!this.facebarConfig.null_state)return;this.removeDuplicateInNullstateIfAvailable(l);var m=babelHelpers['extends']({},l,{isRecent:true,isNullState:true,type:c('FacebarJSConstants').keywordType,structure:c('FacebarStructuredText').fromString(l.text),tuid:JSON.stringify({semantic:l.semantic,structure:l.structure}),keyword_type:l.keywordType});if(l.icon_class)m.iconClass=l.icon_class;if(l.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.recent){m.iconClass="_5b1w";delete m.keywordBootstrapType;}if(l.results_set_type)m.resultsSetType=l.results_set_type;m.isInjectedSuggestion=false;this.insertEntryIntoRightPosition(m,true);};k.prototype.addSuggestionEntryToNullState=function(l,m){'use strict';if(!this.facebarConfig.null_state||this.injectedSuggestionCount===j)return;var n=this.removeDuplicateInNullstateIfAvailable(l);switch(m){case c('SearchPivotType').STORY_LIKE_ACTION:this.category=i._("Based on posts you liked");break;case c('SearchPivotType').STORY_COMMENT_ACTION:this.category=i._("Based on posts you commented on");break;default:this.category=i._("Based on posts you interacted with");}var o=babelHelpers['extends']({},l,{isRecent:false,isSuggestion:true,isTrending:false,isNullState:true,type:c('FacebarJSConstants').keywordType,structure:[{text:l.text,type:'keyword'}],tuid:JSON.stringify({semantic:l.semantic,structure:l.text}),isInjectedSuggestion:true,category:this.category});if(!c('FacebarGlobalOptions').hasRecentOnTopNullState)o.null_state_position='top';this.insertEntryIntoRightPosition(o,false);if(!n){c('Arbiter').inform('FacebarTypeahead.injectedSuggestion');++this.injectedSuggestionCount;}};k.prototype.removeDuplicateInNullstateIfAvailable=function(l){'use strict';var m,n=false;if(l.isInjectedSuggestion){m=l.semantic;}else m=decodeURIComponent(l.semantic);for(var o=0;o<this.facebarConfig.null_state.length;o++){var p=this.facebarConfig.null_state[o];if(p.semantic===m){this.facebarConfig.null_state.splice(o,1);n=true;break;}}return n;};k.prototype.clearRecentSearches=function(){'use strict';if(!this.facebarConfig.null_state)return;this.facebarConfig.null_state=this.facebarConfig.null_state.filter(function(l){return !l.isRecent;});};k.prototype.insertEntryIntoRightPosition=function(l,m){'use strict';var n=m?this.facebarConfig.null_state.findIndex(function(p){return p.isRecent;}):this.facebarConfig.null_state.findIndex(function(p){return p.isSuggestion;}),o=m?c('FacebarGlobalOptions').hasRecentOnTopNullState:!c('FacebarGlobalOptions').hasRecentOnTopNullState;if(n<0){if(o){this.facebarConfig.null_state.unshift(l);}else{if(this.facebarConfig.null_state.length>=c('FacebarGlobalOptions').maxResultCount)this.facebarConfig.null_state.shift();this.facebarConfig.null_state.push(l);}return;}this.facebarConfig.null_state.splice(n,0,l);};k.prototype.setSortFunction=function(l){'use strict';this._sortFunction=l;};k.prototype.addBootstrap=function(l){'use strict';var m=this.bootstrapCache;l.forEach(function(n){var o=this.getEntry(n);o.bootstrapped=true;var p=this.tokenize(o.textToIndex,true);if(o.tokens)Array.prototype.push.apply(p,o.tokens.split(' '));Array.prototype.push.apply(p,this.getExtraTokensToIndex(o));p.forEach(function(q){if(!m.hasOwnProperty(q))m[q]={};m[q][n]=true;});},this);};k.prototype.getExtraTokensToIndex=function(l){'use strict';var m=[];if(l.alias!=null)m.push(l.alias.toLowerCase());return m;};k.prototype.addNullStateToQueryCache=function(l,m){'use strict';this.saveResults(this.facebarConfig.null_state,l,true);if(c('FacebarGlobalOptions').includeInitialTypeNamedX)this.saveResults(m,l,true);};k.prototype.extendResult=function(l,m){'use strict';var n=l.cache_id.substr(m.cache_id_length);if((n.indexOf("\"")>=0||m.tokens.length===0)&&!m.isTypeNamedXBootstrap)return null;var o;if(!!m.isTypeNamedXBootstrap){if(l.raw_text!==null){o=m.ext_text+n;}else if(l.tokens.length!==0&&l.tokens[0].text){o=l.tokens[0].text;}else return null;}else if(m.tokens[m.tokens.length-1].length!==0){o=m.ext_text+n;}else o=m.ext_text+" "+n;if(o.length===0)return null;m.ext_node.text=o;m.parse.entTokens=[o];m.parse.suffix="";this._extractStructure(m);if(!this._punctRegexp)this._punctRegexp=new RegExp(c('TokenizeUtil').getPunctuation(),'g');m.semantic=m.ext_semantic.replace('(ext_string)','('+o.replace(this._punctRegexp,"")+')');m.isExtendedResult=true;return m;};k.prototype.getResults=function(l,m){'use strict';if(l.tokens.length===0||l.tokens.length==1&&l.tokens[0]==='')return {results:this.facebarConfig.null_state||[],null_state:true};var n=this._getBestQueryCache(l.cache_id),o=n.results.filter(function(ia){return !ia.isRecent;}),p={},q=this._getBootstrapMatchByType(l.tokens,p),r=this._addMatchingBootstrapResults(l,q[0]||{},p);if(c('FacebarGlobalOptions').limitBootstrapResult)r=r.slice(0,c('FacebarGlobalOptions').limitBootstrapResultNum);var s=[],t=[];if(c('FacebarGlobalOptions').hasKeywordBootstrap&&c('FacebarGlobalOptions').useKeywordBootstrapScores){s=r.filter(function(ia){return ia.type===c('FacebarJSConstants').keywordType&&this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);}.bind(this));s.sort(function(ia,ja){return ja.popularSearchScore-ia.popularSearchScore;});t=r.filter(function(ia){return ia.type!==c('FacebarJSConstants').keywordType;});t.sort(this._sortFunction);r=t.concat(s);}else if(c('FacebarGlobalOptions').hasKeywordBootstrap){s=r.filter(function(ia){return ia.type===c('FacebarJSConstants').keywordType;});var u=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.recent;});if(c('FacebarGlobalOptions').onlyPrefixMatching)u=u.filter(function(ia){return this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);},this);u.sort(function(ia,ja){return ia.structure[0].text.length-ja.structure[0].text.length;});var v=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.trending&&this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);}.bind(this));v.sort(function(ia,ja){return ia.structure[0].text.length-ja.structure[0].text.length;});var w=[];for(var x=0;x<v.length;x++){var y=v[x].trendingTopicID;if(!y)continue;if(w[y]){v.splice(x--,1);}else w[y]=y;}var z=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.serp_first&&this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);},this),aa=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.popular&&this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);},this),ba=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.null_state&&this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]);},this),ca=r.filter(function(ia){return ia.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.awareness&&(!c('FacebarGlobalOptions').searchAwarenessBootstrapJustPrefix||this.unicodeMatch.prefixMatch(ia.structure[0].text,l.tokens[0]));},this),da=aa.concat(z).concat(ba);da.sort(function(ia,ja){ja.popularSearchScore-ia.popularSearchScore;});s=u.concat(ca).concat(v).concat(da);t=r.filter(function(ia){return ia.type!==c('FacebarJSConstants').keywordType;});t.sort(this._sortFunction);r=t.concat(s);}Array.prototype.push.apply(r,c('concatMap')(this._getResultsFromCache.bind(this,q,l),o));if(!c('FacebarGlobalOptions').hasKeywordBootstrap){r.sort(this._sortFunction);if(!c('FacebarGlobalOptions').graphSearchV2&&c('FacebarGlobalOptions').keywordSearchEnabled)c('FacebarKeywordSearchUtils').addExactMatch(l,r,m);}var ea={},fa=[],ga=false,ha=0;r.forEach(function(ia){var ja=c('FacebarStructuredText').fromStruct(ia.structure);if(ja.hasType('blank')){fa.push(ia);return;}ia.semantic=ia.semantic.toLowerCase();if(!ia.termMatches)ia.termMatches=p[ia.semantic];var ka=k.getUniqueSemantic(ia.semantic),la=k.getUniqueSemantic(ia.alternateSemantic);if(!ka)return;var ma=ea[ka]||la&&ea[la];if(ma){if(ia.isJSBootstrapMatch){ma.isJSBootstrapMatch=true;ma.bootstrapCost=ia.bootstrapCost;}else if(ma.isJSBootstrapMatch&&ia.backendCost!==undefined&&ma.backendCost===undefined)ma.backendCost=ia.backendCost;if(!!ia.tags)Object.assign(ma.tags||{},ia.tags);return;}if(ga&&ia.blankFilled)return;if(ia.type.indexOf('browse_type')>=0){ha+=1;if(this.facebarConfig.maxGrammarResults!==undefined&&ha>this.facebarConfig.maxGrammarResults)return;}ga=ga||!!ia.blankFilled;ea[ka]=ia;if(la)ea[la]=ia;fa.push(ia);},this);return {results:fa};};k.prototype.saveResults=function(l,m,n,o,p){'use strict';l=l.map(this._processBackendResult,this);var q=[],r={},s={};l.forEach(function(u){s[u.semantic]=true;});var t=this._getBestQueryCache(m.cache_id);t.results.forEach(function(u){if(u.type==='websuggestion')return;if(u.exactMatchKeyword)return;if(u.isExtendedResult)return;if(u.semantic in r)return;var v=this._getDifferenceArrayTokens(u.tokens,m.tokens),w=this._getNumTokensMatching(v,u);w=this._tryMatchingFinalInsertedEntity(v,w,u);if(w>0&&w==v.length||(u.type==="shortcut"&&u.termMatches.indexOf(m.tokens[m.tokens.length-1]))>=0){u.cacheOnlyResult=!s[u.semantic];q.push(u);}},this);if(c('FacebarGlobalOptions').limitCacheResult)q=q.slice(0,c('FacebarGlobalOptions').limitCacheResultNum);l.forEach(function(u){u.tokens=m.tokens;u.cache_id_length=m.cache_id.length;if(!!u.isTypeNamedXBootstrap)++u.cache_id_length;q.push(u);},this);if(p)Array.prototype.push.apply(q,p);if(this.queryCache[m.cache_id]===undefined)this.queryCache[m.cache_id]={};Object.assign(this.queryCache[m.cache_id],{tokens:m.tokens,results:q,incomplete:n},o);};k.prototype.alreadyKnown=function(l){'use strict';return !!this.queryCache[l]&&!this.queryCache[l].incomplete;};k.prototype.stripBrackets=function(l){'use strict';return l.replace(/^[\[\{]/,'').replace(/[\]\}]$/,'');};k.prototype._extractStructure=function(l){'use strict';function m(p,q,r,s,t,u){return {type:p==='ent:extend_string'?'text':p,text:q,uid:r||null,isLocal:s?s:false,categoryName:t?t:null,isPersonSERP:u?u:false};}function n(p,q){p.split(' ').forEach(function(r){if(r!==''){if(q)l.chunks.push(l.structure.length);l.structure.push(m('text',r));}l.structure.push(m('text',' '));});l.structure.pop();}function o(p){if(l.structure.length!==0||c('FacebarJSConstants').nonGrammarTypes[l.type])return p;return p.charAt(0).toUpperCase()+p.substr(1);}l.structure=[];l.chunks=[];l.parse.display.forEach(function(p){if(typeof p==='string'){n(o(p),true);}else if(p.type==='ent:extend_string'){n(p.text,true);}else if(p.uid){var q=this.getEntry(p.uid,p.fetchType);l.chunks.push(l.structure.length);if(q==null)throw new Error('No entry found for uid \"'+p.uid+'\", type \"'+p.fetchType+'\" and piece text \"'+p.text+'\"');if(q.grammar_like){n(o(q.text),false);}else{var r=p.type;if(p.fetchType)r+=':'+p.fetchType;l.structure.push(m(r,q.text,p.uid,l.isLocal,l.categoryName,l.isPersonSERP));}}else if(p.type=='blank'){l.chunks.push(l.structure.length);l.structure.push(m(p.type,'...'));}},this);return l;};k.prototype._getDifferenceArrayTokens=function(l,m){'use strict';if(!l.length)return [''].concat(m);var n=l.length-1,o=l[n];if(o==='')o=l[--n];var p='';if(typeof o=='string'&&n<m.length)p=m[n].substr(o.length);if(p===''&&n+1<m.length&&m[n+1]==='')return [''];return [p].concat(m.slice(n+1));};k.prototype._processBackendResult=function(l){'use strict';if(l.isTypeNamedXBootstrap&&l.cache_id_length)return l;if(l.semantic==null)throw new Error('Facebar can\'t process empty semantic '+JSON.stringify(l));l.semantic=l.semantic.toString();l.backendCost=l.cost;this._extractStructure(l);if(l.type.match(/^\{.*\}$/))l.useExtendedIndex=true;if(l.alternateSemantic)l.alternateSemantic=l.alternateSemantic.toLowerCase().replace(/\[(\d*)\]/g,'$1');if(l.parse.extendable){var m=null;l.parse.display.forEach(function(s){if(s.type!=="ent:extend_string")return;m=s;},this);if(!m||l.semantic.match(/\[.*\]/).length!==1){l.parse.extendable=false;}else{l.ext_node=m;l.ext_semantic=l.semantic.replace(/\[(.*)\]/g,'ext_string');l.ext_text=m.text;}}if(l.semantic.match(/\[\d*\]/)){var n=l.parse,o=n.pos;if(o===undefined){l.semantic=l.semantic.replace(/\[(\d*)\]/g,'$1');}else{var p=n.remTokens[n.remTokens.length-1];if(n.remTokens.length&&l.structure[l.chunks[p]]&&l.structure[l.chunks[p]].uid){o=n.remTokens[n.remTokens.length-1];l.completed=true;}var q=l.structure[l.chunks[o]].uid;if(q===null){l.semantic=l.semantic.replace(/\[(\d*)\]/g,'$1');}else{var r=new RegExp('\\['+q+'\\]','g');l.unsubstituted_semantic=l.semantic;l.semantic=l.semantic.replace(r,q);if(n&&n.disambiguation&&n.disambiguation.length>0){n.disambiguation=n.disambiguation.filter(function(s){return s.indexOf('['+q+']')!==-1;});n.unsubstituted_disambiguation=n.disambiguation.splice(0);n.disambiguation=n.disambiguation.map(function(s){return s.replace(r,q);});}}}}l.semantic=l.semantic.replace(/\[(.*)\]/g,'$1');l.tuid=JSON.stringify({semantic:l.semantic,structure:l.structure});return l;};k.prototype._sortFunction=function(l,m){'use strict';return (l.cost||0)-(m.cost||0);};k.prototype._getResultsFromCache=function(l,m,n){'use strict';var o=m.tokens,p=this._getDifferenceArrayTokens(n.tokens,o),q=[],r=this._getNumTokensMatching(p,n),s=this._tryMatchingFinalInsertedEntity(p,r,n);if(n.parse.extendable||n.isExtendedResult){var t=this.extendResult(m,n);if(t)q.push(t);if(n.isExtendedResult)return q;}if(s>0&&s==p.length&&!(n.type===c('KeywordsSearchResultConfig').result_type&&p.length===1&&p[0]==='"'))q.push(n);if(n.type==="shortcut"&&n.termMatches.indexOf(m.tokens[o-1])>=0)q.push(n);return q;};k.prototype._addMatchingBootstrapResults=function(l,m,n){'use strict';var o=l.tokens;return c('concatMap')(function(p){var q=m[p];if(q===undefined)return [];var r=[],s=c('FacebarResultStoreUtils').getQueryFeatures(l);q.forEach(function(t){var u=this.getEntry(t,p);if(!this._isTitleTermMatch(o,u)&&!this._isAliasMatch(l.raw_text,u))return;var v=this._isExactNameMatch(o,u)||this._isAliasMatch(l.raw_text,u),w=v?0:this.facebarConfig.non_title_term_match_penalty,x=this._isNonGrammarTermMatch(o,u),y=u.grammar_costs?u.grammar_costs['{'+p+'}']:0,z=y+w+this.facebarConfig.entity_cost+this.facebarConfig.grammar_stop_words_penalty*!x,aa=c('FacebarResultStoreUtils').processEntityResult(p,t,u.text,z,l,s,n,v,!x);aa.bootstrapCost=z;aa.isJSBootstrapMatch=true;if(p===c('FacebarJSConstants').keywordType){aa.iconClass=u.iconClass;aa.keywordBootstrapType=u.keywordBootstrapType;aa.parse=u.parse;aa.subtext=u.subtext;aa.boldedSubtext=u.boldedSubtext;aa.semantic=u.semantic;aa.popularSearchScore=u.popularSearchScore;aa.trendingTopicID=u.trendingTopicID;aa.photo=u.photo;}r.push(aa);},this);return r;}.bind(this),this.facebarConfig.bootstrap_types);};k.prototype._isTitleTermMatch=function(l,m){'use strict';var n=l[0]||{};if(typeof n=='object')return false;var o=m.titleToIndex;return l.length===1?this._isTokenizePrefixMatch(n,o):c('TokenizeUtil').isExactMatch(n,o);};k.prototype._isExactNameMatch=function(l,m){'use strict';var n=l[0]||{};if(typeof n=='object')return false;var o=m.text;for(var p=0;p<l.length-1;++p)if(l[p]!==''&&!c('TokenizeUtil').isExactMatch(l[p],o))return false;return l.length>0&&this._isTokenizePrefixMatch(l[l.length-1],o);};k.prototype._isAliasMatch=function(l,m){'use strict';return m.alias!=null&&l!=null&&c('TokenizeUtil').isExactMatch(m.alias,l);};k.prototype._isNonGrammarTermMatch=function(l,m){'use strict';var n=c('TokenizeUtil').parse(m.titleToIndex.toLowerCase()),o=n.tokens.filter(function(r){return r!==''&&!this.facebarConfig.grammar_stop_words[r];},this);o=o.join(' ');for(var p=0;p<l.length;++p){if(typeof l[p]=='object')return true;var q=p===l.length-1?this._isTokenizePrefixMatch(l[p],o):c('TokenizeUtil').isQueryMatch(l[p],o);if(q)return true;}return false;};k.prototype._getBootstrapMatchByType=function(l,m){'use strict';if(l.length===0)return [];var n=l.map(function(){return {};}),o=l[l.length-1]==='',p={},q,r=o?l.length-1:l.length,s=l[r-1];if(r&&s.uid){this._pushBootstrapEntryAtPosition(n,r-1,s.uid);return n;}for(var t in this.bootstrapCache)if(r&&this.unicodeMatch.prefixMatch(t,s)&&(!o||t===s))for(q in this.bootstrapCache[t])if(!p[q]){p[q]=1;this._addMatchedTerm(q,t,m);this._pushBootstrapEntryAtPosition(n,r-1,q);}for(var u=r-2;u>=0;u--){if(typeof l[u]=='object')break;if(l[u].length&&l[u][0]=='"')break;for(q in this.bootstrapCache[l[u]]){if(!p[q])p[q]=0;if(p[q]+u==r-1){++p[q];this._addMatchedTerm(q,l[u],m);this._pushBootstrapEntryAtPosition(n,u,q);}}}return n;};k.prototype._addMatchedTerm=function(l,m,n){'use strict';(n[l]=n[l]||[]).push(m);return n;};k.prototype._pushBootstrapEntryAtPosition=function(l,m,n){'use strict';var o=this.getEntry(n);if(!o)return;var p=[];if(o.grammar_costs){p=Object.keys(o.grammar_costs).map(function(s){return this.stripBrackets(s);},this);}else p=[o.type];for(var q=0;q<p.length;q++){var r=p[q];if(l[m][r]===undefined)l[m][r]=[];l[m][r].push(n);}};k.prototype._getNumTokensMatching=function(l,m){'use strict';var n=0,o=m.parse,p=l.length,q=null,r=null;if(o.pos!==undefined){var s=m.structure[m.chunks[o.pos]];if(s){q=s.uid;r=s.type.split(':')[2];}}m.outputTokensUsed=[];m.termMatches=[];if(q){n=this._prefixMatchEntity(l,o,q,m.outputTokensUsed,r,!!m.useExtendedIndex,m.termMatches);if(n===0||n===p)return n;}else if(o.suffix&&p==1&&o.suffix.indexOf(l[0])===0){return p;}else if(o.suffix==l[0]){++n;}else return 0;var t=[];o.remTokens=o.remTokens||[];for(var u=0;u<o.remTokens.length;u++){if(typeof l[n]!='string'||m.chunks.length<=o.remTokens[u]||m.structure.length<=m.chunks[o.remTokens[u]]||m.structure[m.chunks[o.remTokens[u]]].uid)break;var v=m.structure[m.chunks[o.remTokens[u]]].text;t.push(v.toLowerCase());}n=this._greedyMatchText(t,l,n,o.remTokens,m.outputTokensUsed,m.isNullState);if(n==p-1&&l[n]==='')return p;return n;};k.prototype._prefixMatchEntity=function(l,m,n,o,p,q,r){'use strict';m.entTokens=m.entTokens||[];if(m.entTokens.length===0){if(l[0]!=='')return 0;if(m.possessive&&l.length>1&&l[1]=='\'s'){o.push([m.pos+1]);return 2;}else return 1;}var s=false,t=this.getEntry(n,p);if(typeof p!=='undefined'&&p!==t.fetchType)return 0;var u=this.tokenize(q?t.textToIndex:t.text,true),v=[];for(var w=0;w<l.length+m.entTokens.length-1;w++)if(w<m.entTokens.length-1){v.push(m.entTokens[w]);}else if(w==m.entTokens.length-1){v.push(m.entTokens[w]+l[0]);}else v.push(l[w-m.entTokens.length+1]);var x=-m.entTokens.length+1;for(var y=0;y<v.length;++y){var z=v[y];if(typeof z!='string')break;if(z===''){x++;continue;}var aa=false;for(var ba=0;ba<u.length;ba++)if(u[ba]==z||y===v.length-1&&u[ba].indexOf(z)===0){if(r)r.push(u[ba]);u[ba]='';aa=true;++x;break;}if(aa)continue;if(!m.possessive||z.length<=2||z.substr(z.length-2)!='\'s')break;var ca=z.substr(0,z.length-2);for(ba=0;ba<u.length;ba++)if(u[ba]==ca){++x;if(o)s=true;break;}break;}if(x>0){if(s)o.push([m.pos+1]);return x;}if(o===undefined)return 0;var da=l[0],ea=da;if(m.possessive&&da.length>=2&&da.substr(da.length-2)=='\'s')ea=da.substr(0,da.length-2);m.suffix=m.suffix||'';if(l.length==1&&m.suffix.indexOf(da)===0||m.suffix==ea||m.suffix==da){if(ea!=da&&m.suffix==ea)o.push([m.pos+1]);return 1;}return 0;};k.prototype._tryMatchingFinalInsertedEntity=function(l,m,n){'use strict';if(!n.completed||m<0)return m;var o=n.parse,p=o.remTokens[o.remTokens.length-1],q=n.structure[n.chunks[p]],r=this.getEntry(q.uid,q.type),s=this.tokenize(r.text,true);m=this._greedyMatchText(s,l,m);if(m==l.length-1&&l[m]==='')return l.length;return m;};k.prototype._greedyMatchText=function(l,m,n,o,p,q){'use strict';for(var r=0;r<l.length;r++){var s=l[r];if(s==m[n]){if(p!==undefined)p.push(o[r]);++n;continue;}if(n===m.length-1&&s.indexOf(m[n])===0){if(p!==undefined)if(s==m[n]){p.push([o[r]]);}else p.push([o[r],m[n].length]);return m.length;}if(q)break;}return n;};k.prototype._getBestQueryCache=function(l){'use strict';for(var m=l.length;m>=0;m--){var n=this.queryCache[l.slice(0,m)];if(n)return n;}};k.prototype._getFBObjectType=function(l){'use strict';if(this.typeaheadTypeMap[l]){return this.typeaheadTypeMap[l];}else return 'page';};k.prototype._isTokenizePrefixMatch=function(l,m){'use strict';return c('TokenizeUtil').isPrefixMatch(this.unicodeMatch.prefixMatchPrepare(l),this.unicodeMatch.prefixMatchPrepare(m));};k.EPSILON=1e-05;k.getUniqueSemantic=function(l){if(!l)return;var m=[],n=[],o=[];l='('+l+')';var p=l,q=false;l.replace(/[\(\),]/g,function(r,s){var t;switch(r){case ',':var u=o.length-1;t=p.substr(o[u],s-o[u]);m[u].push(t);o[u]=s+1;break;case '(':o.push(s+1);m.push([]);n.push(s+1);break;case ')':if(o.length===0)throw l+' is not a valid semantic string';var v=o.pop();t=p.substr(v,s-v);t=decodeURI(t.replace(/%/g,'%25').replace(/\s/g,'+').trim());var w=m.pop();w.push(t);var x=w.sort();for(var y=1;y<x.length;y++)if(x[y]==x[y-1])q=true;var z=x.join(',');p=p.substr(0,n.pop())+z+p.substr(s);break;}return r;});if(q)return '';return p.replace(/\((.*)\)/,'$1');};f.exports=k;},null);
__d("FacebarTimerUtils",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={getTimestamp:function(){return Date.now();}};f.exports=h;},null);
__d("FacebarTokenizer",["TokenizeUtil"],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h="[^\"]",i=["\\s's","'s","\""+h+"*\"?"],j=[[/\s+$/,''],[/\"\s+/,'"'],[/\s+\"/,'"'],[/\"\"/,''],[/^\"$/,''],[/\s+/,' ']],k={tokenize:function(l,m){var n=[],o=0;l=l.replace(/\s/g,' ').toLowerCase();l.replace(new RegExp(i.join('|'),'g'),function(q,r){if(r>o){var s=l.substr(o,r-o);Array.prototype.push.apply(n,c("TokenizeUtil").parse(s).tokens.slice(0));}var t=q;for(var u=0;u<j.length;u++){var v=j[u];t=t.replace(v[0],v[1]);}if(n.length&&t=='\'s'){n[n.length-1]+=t;}else if(t!=='')n.push(t);if(m)Array.prototype.push.apply(n,c("TokenizeUtil").parse(q).tokens);o=r+q.length;});if(o<l.length){var p=l.substr(o,l.length-o);Array.prototype.push.apply(n,c("TokenizeUtil").parse(p).tokens.slice(0));}return n;}};f.exports=k;},null);
__d('FacebarTypeaheadL2Terms',['FacebarJSConstants'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=3,i={addL2Terms:function(j,k,l,m){if(!m.suggestBackendL2Terms)return j;var n=[],o=[];j.forEach(function(q){if(q.exactMatchKeyword){q.tags.l2_suggestion=true;n.push(q);}else if(q.isKeywordL2){q.tags.l2_suggestion=true;q.type='l2suggestion';n.push(q);}else if(q.type!=='keywords')o.push(q);});var p=0;return o.map(function(q){if(c('FacebarJSConstants').entityTypes[q.type])if(p<h){p++;}else if(n.length)return n.pop();return q;});}};f.exports=i;},null);
__d('FacebarTypeaheadTypeNamedX',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={browse_type_user:'user',browse_type_page:'page',browse_type_place:'place',browse_type_group:'group',browse_type_application:'app'},i=1,j=2;k.addTypeNamedX=function(l,m,n,o){'use strict';var p=new k(),q=[],r=[];l.forEach(function(w){if(w.tags!=null)delete w.tags.hiddenSeeMore;if(w.isSeeMore){q.push(w);}else r.push(w);});if(!o.showTypeNamedX){q.forEach(function(w){if(w.tags!=null)w.tags.hiddenSeeMore=true;});return r;}var s=p.buildTypeNamedXBuckets(r,q,n,o),t=s[0],u=s[1];t.forEach(function(w){if(w.tags!=null)w.tags.displayedSeeMore=true;});var v=p.replaceResults(r,m,t);Array.prototype.push.apply(v,u);v.forEach(function(w){if(w.tags!=null)w.tags.hiddenSeeMore=true;});return r;};k.prototype.buildTypeNamedXBuckets=function(l,m,n,o){'use strict';var p={};o=o||{};l.forEach(function(t,u){var v=t.render_type||t.type;if(p[v]===undefined)p[v]={index:u,matchCount:0};if(!o.alwaysDisplayTypeNamedX&&t.text.toLowerCase().indexOf(n.toLowerCase())<0)return;p[v].matchCount++;});var q=[],r=[];m.forEach(function(t){var u=h[t.results_set_type];if(p[u]!==undefined&&p[u].matchCount>=i){q.push([t,p[u].index]);}else r.push(t);});q.sort(function(t,u){return t[1]-u[1];});var s=q.map(function(t){return t[0];});Array.prototype.push.apply(r,s.slice(j));s.length=Math.min(s.length,j);return [s,r];};k.prototype.replaceResults=function(l,m,n){'use strict';var o=[],p=Math.min(0,l.length-m)+n.length;for(var q=0;q<p;++q){var r=-1;for(var s=0;s<Math.min(m-q,l.length);++s){var t=l[s];if(!t.exactMatchKeyword&&t.type!=='websuggestion')r=s;}if(r>=0){o.push(l[r]);l.splice(r,1);}}Array.prototype.unshift.apply(l,n);return o;};function k(){'use strict';}f.exports=k;},null);
__d('ResultsBucketizer',['FacebarJSConstants','FacebarGlobalOptions'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j){'use strict';this.$ResultsBucketizer1=i;this.$ResultsBucketizer2=j;}h.trimResults=function(i,j,k){'use strict';var l=[];i.forEach(function(m,n){if(m.indexBeforeBuckets>j)l.push({index:n,originalIndex:m.indexBeforeBuckets});});l.sort(function(m,n){return m.originalIndex-n.originalIndex;}).slice(k).sort(function(m,n){return n.index-m.index;}).forEach(function(m){i.splice(m.index,1);});};h.mergeBuckets=function(i,j){'use strict';var k=[];for(var l in j)if(!j[l].rule.hidden&&(!j[l].rule.xor||!j[j[l].rule.xor]))k.push(j[l]);k.sort(function(m,n){var o=(m.rule.position||0)-(n.rule.position||0);if(o!==0)return o;return m.results[0].indexBeforeBuckets-n.results[0].indexBeforeBuckets;});i.length=0;k.forEach(function(m,n){if(m.rule.maxPromotions!=null&&n<k.length-1)h.trimResults(m.results,k[n+1].results[0].indexBeforeBuckets,m.rule.maxPromotions);Array.prototype.push.apply(i,m.results);}.bind(this));};h.prototype.$ResultsBucketizer3=function(i,j){'use strict';if(j.propertyName==null)return j.bucketName||'default';var k=this.$ResultsBucketizer2(i,j.propertyName);if(k==null||j.propertyValue!=null&&''+k!==j.propertyValue)return false;return j.bucketName||j.propertyName+'.'+k;};h.prototype.$ResultsBucketizer4=function(i,j,k){'use strict';var l={},m=false;if(c('FacebarGlobalOptions').renderKeywordsFirst){m=true;}else m=i[0]!=null&&i[0].type===c('FacebarJSConstants').keywordType;if(m&&k==null)k=c('FacebarGlobalOptions').default_num_top_results_to_show;i.forEach(function(n,o){j.some(function(p){var q=this.$ResultsBucketizer3(n,p);if(q===false)return false;if(l[q]==null)l[q]={results:[],rule:p};if(m&&q===c('FacebarJSConstants').keywordType&&l[q].results.length>=k)return true;if(!!p.maxResults&&l[q].results.length>=p.maxResults)return true;n.bucketLineage.push({bucketName:q,bucketIndex:l[q].results.length});l[q].results.push(n);return true;}.bind(this));}.bind(this));return l;};h.prototype.$ResultsBucketizer5=function(i,j,k){'use strict';var l=this.$ResultsBucketizer1[j];if(!l)return {};var m=this.$ResultsBucketizer4(i,l,k);for(var n in m){var o=m[n].rule.subBucketRules;if(!!o)this.$ResultsBucketizer5(m[n].results,o,k);}h.mergeBuckets(i,m);return m;};h.prototype.$ResultsBucketizer6=function(i,j,k){'use strict';if(j.length<=k)return j.slice();var l=j.map(function(n){return n.indexBeforeBuckets;}),m=l.sort(function(n,o){return n-o;})[k];if(m==null)return j;return j.filter(function(n){return n.indexBeforeBuckets<m;});};h.prototype.bucketize=function(i,j,k,l){'use strict';i.forEach(function(n,o){n.bucketLineage=[];n.indexBeforeBuckets=o;});k=k||{};Object.assign(k,this.$ResultsBucketizer5(i,'main',l));var m=this.$ResultsBucketizer6(k,i,j);return m;};f.exports=h;},null);
__d('FacebarDataSource',['invariant','Arbiter','AsyncRequest','FacebarFindPeopleAndPages','FacebarGSv2Echo','FacebarNoFlickerResults','FacebarGlobalOptions','FacebarInviteCoworkers','FacebarJSConstants','FacebarResultStore','FacebarResultStoreUtils','FacebarKeywordSearchUtils','FacebarStructuredText','FacebarTimerUtils','FacebarTokenizer','FacebarTypeNamedXBootstrap','FacebarTypeNamedXTokenOptions','FacebarTypeaheadL2Terms','FacebarTypeaheadTypeNamedX','FacebarURI','ResultsBucketizer','ResultsBucketizerConfig','SearchDataSource','Vector','ViewportBounds','queryThenMutateDOM','setTimeoutAcrossTransitions','throttle'],function a(b,c,d,e,f,g,h){var i,j;if(c.__markCompiled)c.__markCompiled();var k=50,l={};i=babelHelpers.inherits(m,c('SearchDataSource'));j=i&&i.prototype;function m(n){'use strict';j.constructor.call(this,n);this._fetched_null_state=null;this._initialQueryData=null;this._curQueryId=-1;this._maxRemoteQueryId=-1;this._single_state=false;this._is_person_serp=false;this._is_local=false;this._categoryName=null;this._waitingQueries=0;this.mixGrammarAndEntity=n.mixGrammarAndEntity!==undefined?n.mixGrammarAndEntity:true;this._num_topresults_to_show=null;this._isInjectedSuggestionFlow=false;this.grammarVersion=n.grammarVersion||'';if(!n.grammarOptions)n.grammarOptions={};this.recordingRoute='banzai_vital';this._maxGrammarResults=n.grammarOptions.maxGrammarResults;this.nullStateEndpoint=n.nullStateEndpoint||'/ajax/browse/null_state.php';this.setNullStateData(n.nullStateData||{},true);this._minQueryLength=n.minQueryLength||-1;this._performShortQuery=n.performShortQuery||false;this._fixProcessLean=n.grammarOptions.fixProcessLean||false;this.hasGSPreload=c('FacebarGlobalOptions').hasGSPreload;this.gsPreloadOptions=c('FacebarGlobalOptions').gsPreloadParams;this.throttleExecuteQuery();this.throttleSendRemoteQuery();this.throttleRenderResults();this.resultStoreOptions=n.grammarOptions||{};this.resultStoreOptions.useNewExactNameMatch=n.grammarOptions.useNewExactNameMatch==="true";this.defaultQuery=null;this._bypassBucketizer=false;this._resultsBucketizer=new (c('ResultsBucketizer'))(c('ResultsBucketizerConfig').rules,function(o,p){switch(p){case 'isSeeMore':return o.isSeeMore;case 'objectType':return o.type;case 'resultSetType':return o.results_set_type;case 'renderType':return o.render_type||o.type;case 'cacheOnlyResult':return o.cacheOnlyResult;case 'closeEntity':return o.bootstrapped||(!!o.tags?o.tags[p]:undefined);default:return !!o.tags?o.tags[p]:undefined;}});this.fetchNullState();this.initWithConfig(c('FacebarGlobalOptions').grammarConfig);c('Arbiter').subscribe('FacebarTypeahead.injectSuggestion',function(o,p){return this.addSearchSuggestionToNullState(p);}.bind(this));}m.prototype.addSearchSuggestionToNullState=function(n){'use strict';if(!n.query)return;var o=c('FacebarKeywordSearchUtils').makeFacebarEntry(n.query);this.resultStore.addSuggestionEntryToNullState(o,n.interaction);this._isInjectedSuggestionFlow=true;this.inform('reloadNullstate',true);this._isInjectedSuggestionFlow=false;};m.prototype.initWithConfig=function(n){'use strict';this.facebarConfig=n;this.createResultStore();this.blockees={};if(this._fetched_null_state){this.setNullState(this._fetched_null_state);this._fetched_null_state=null;}};m.prototype.throttleExecuteQuery=function(){'use strict';var n=c('FacebarGlobalOptions').executeQueryThrottleTime;this.executeQueryThrottled=c('throttle').withBlocking(this.executeQuery,n,this);};m.prototype.throttleSendRemoteQuery=function(){'use strict';var n=c('FacebarGlobalOptions').sendRemoteQueryThrottleTime;if(n===0){this.sendRemoteQueryThrottled=this.sendRemoteQuery;}else if(c('FacebarGlobalOptions').lazyThrottleRemoteQuery){var o=Date.now(),p=c('FacebarGlobalOptions').enableSendRemoteQueryDelay,q=c('FacebarGlobalOptions').sendRemoteQueryDelayTime;this.sendRemoteQueryThrottled=function(){for(var r=arguments.length,s=Array(r),t=0;t<r;t++)s[t]=arguments[t];var u=Date.now();if(o+n<u){o=u;if(p){c('setTimeoutAcrossTransitions')(function(){this.sendRemoteQuery.apply(this,s);}.bind(this),q);}else this.sendRemoteQuery.apply(this,s);}}.bind(this);}else this.sendRemoteQueryThrottled=c('throttle').withBlocking(this.sendRemoteQuery,n,this);};m.prototype.throttleRenderResults=function(){'use strict';var n=c('FacebarGlobalOptions').renderThrottleTime;if(n===0){this.renderResultsThrottled=this.renderResults;return;}var o=Date.now();this.renderResultsThrottled=function(p,q,r,s,t){var u=Date.now();if(r||o+n<u){o=u;this.renderResults(p,q,r,s,t);}}.bind(this);};m.prototype.createResultStore=function(){'use strict';this.facebarConfig.maxGrammarResults=this._maxGrammarResults;this.resultStore=new (c('FacebarResultStore'))(this.facebarConfig,c('FacebarTokenizer').tokenize,this.getEntry.bind(this),this.resultStoreOptions);if(this._fixProcessLean)this._processLean();this.subscribe('setSortFunction',function(n,o){this.resultStore.setSortFunction(o);}.bind(this));};m.prototype.dirty=function(){'use strict';this._nullStateFetched=false;this.resultStore.resetCaches();j.dirty.call(this);};m.prototype.addEntries=function(n){'use strict';this.resultStore.addBootstrap(this.processEntries(n));};m.prototype._processLean=function(){'use strict';if(this._fixProcessLean){if(this._leanPayload&&this.resultStore){var n,o=this._leanPayload.entries;for(var p in o){n=this.getEntry(p);if(!n)continue;for(var q in o[p]){if(!n.grammar_costs)n.grammar_costs={};n.grammar_costs['{'+q+'}']=o[p][q];}}this.setExclusions(this._leanPayload.blocked);this._leanPayload=null;}}else j._processLean.call(this);};m.prototype.setNullStateData=function(n,o){'use strict';if(o)this.nullStateData={grammar_version:this.grammarVersion};Object.assign(this.nullStateData,n);return this;};m.prototype.setNullState=function(n){'use strict';this._null_state=n;this.processEntries(this._null_state.entities);this.resultStore.setNullState(this._null_state.queries);var o=c('FacebarTypeNamedXBootstrap').typeNamedX;o.forEach(function(p){p.parse.extendable=true;p.qid=this._curQueryId;p.isTypeNamedXBootstrap=true;},this);this.resultStore.addNullStateToQueryCache(this.getRawStructure(c('FacebarStructuredText').fromString('')),o);this._typeNamedXResults={};o.forEach(function(p){this._typeNamedXResults[c('FacebarJSConstants').grammarToEntityTypes[p.resultsSetType]]=p;},this);};m.prototype.getNullStateTrending=function(){'use strict';return this._null_state.trending;};m.prototype.setSingleState=function(n){'use strict';this._single_state=n;};m.prototype.getSingleState=function(){'use strict';return this._single_state;};m.prototype.setIsPersonSERP=function(n){'use strict';this._is_person_serp=n;};m.prototype.setLocal=function(n){'use strict';this._is_local=n;};m.prototype.setCategoryName=function(n){'use strict';this._categoryName=n;};m.prototype.overrideNullState=function(n){'use strict';!(this._null_state!=null)?h(0):void 0;this._original_null_state=this._original_null_state||this._null_state;this.setNullState(n);};m.prototype.restoreNullState=function(){'use strict';if(this._original_null_state)this.setNullState(this._original_null_state);};m.prototype.fetchNullState=function(){'use strict';if(this._nullStateFetched){this.activityStart();setTimeout(this.activityEnd.bind(this),0);return;}var n=new (c('AsyncRequest'))().setURI(this.nullStateEndpoint).setData(this.nullStateData).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(o){if(this.resultStore){this.setNullState(o.payload);this.inform('nullstateReady',true);}else this._fetched_null_state=o.payload;this._nullStateFetched=true;}.bind(this)).setFinallyHandler(this.activityEnd.bind(this));this.activityStart();n.send();};m.prototype.fetchNUXResults=function(n){'use strict';if(!c('FacebarGlobalOptions').allowGrammar)return;n=n||{};var o=new (c('AsyncRequest'))().setURI(n.URI).setData(this.nullStateData).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(p){if(this.resultStore){this.overrideNullState(p.payload);n.success&&n.success();}}.bind(this)).setFinallyHandler(this.activityEnd.bind(this));this.activityStart();o.send();};m.prototype.toTypeaheadEntryUid=function(n){'use strict';var o,p=c('FacebarStructuredText').fromStruct(n.structure),q=p.getFragment(0);if(p.getCount()==1&&q.isType('ent')){var r=q.getType().split(':')[2];o=this.getEntry(q.getUID(),r);o.type=this.resultStore.stripBrackets(n.type);}else{o=this.getEntry(n.tuid);if(!o){o={dynamic_cost:n.dynamic_cost,extra_uri_params:n.extra_uri_params,memcache:n.fromMemcache,photo:n.photo,results_set_type:n.resultsSetType,tuid:n.tuid,type:n.type,uid:n.tuid,tags:n.tags};this.processEntries([o]);o=this.getEntry(n.tuid);}o.icon_class=n.iconClass;o.unseen_posts=n.unseen_posts;if(c('FacebarGlobalOptions').renderKeywordSnippets){o.category=n.category;o.subtext=n.subtext;o.boldedSubtext=n.boldedSubtext;}}o.error_info=n.errorInfo;o.logInfo=n.logInfo;o.structure=p;o.text=o.structure.toString();o.queryTypeText=n.queryTypeText;o.semantic=!!n.isSingleState&&n.singleStateSemantic?n.singleStateSemantic:n.semantic;o.alternateSemantic=n.alternateSemantic;o.tree=n.tree;o.cost=n.cost;o.isSeeMore=!!n.isSeeMore;o.isNullState=!!n.isNullState;o.isSingleState=!!n.isSingleState;o.keywordSource=n.keywordSource;o.keyword=n.keyword;var s=n.keyword_type;o.keywordType=s;o.isTrending=!!n.isTrending||n.keywordBootstrapType===c('FacebarJSConstants').keywordBootstrapTypes.trending||s===c('FacebarJSConstants').keywordTypes.trending;o.isCelebrity=s===c('FacebarJSConstants').keywordTypes.celebrity;o.isFootball=s===c('FacebarJSConstants').keywordTypes.football;o.isPhotos=s===c('FacebarJSConstants').keywordTypes.photos;o.isVideos=s===c('FacebarJSConstants').keywordTypes.videos;o.isHashtag=s===c('FacebarJSConstants').keywordTypes.hashtag;o.isLocal=s===c('FacebarJSConstants').keywordTypes.local||s===c('FacebarJSConstants').keywordTypes.local_category;o.isCompany=s===c('FacebarJSConstants').keywordTypes.company;o.isMovie=s===c('FacebarJSConstants').keywordTypes.movie;o.isHappeningNow=s===c('FacebarJSConstants').keywordTypes.happeningNow;o.isSpecialIntentGeneric=s===c('FacebarJSConstants').keywordTypes.specialIntentGeneric;o.isLink=s===c('FacebarJSConstants').keywordTypes.link;c('FacebarJSConstants').intentKeys.map(function(t){o.isSpecialIntent=o.isSpecialIntent||o[t];});o.isRecent=!!n.isRecent;o.isPrefetched=!!n.isPrefetched;o.isSuggestion=!!n.isSuggestion;o.isInjectedSuggestion=!!n.isInjectedSuggestion;o.isFromGSEF=!!n.isFromGSEF;o.entityInfo=n.entityInfo;o.cacheOnlyResult=n.cacheOnlyResult||false;o.isExtendedResult=n.isExtendedResult||false;if(n.isExtendedResult){o.uri=c('FacebarURI').getURI(this.facebarConfig,o);}else o.uri=o.uri||c('FacebarURI').getURI(this.facebarConfig,o);o.parse=n.parse;o.tags=n.tags||{};o.isKeywordL2=n.isKeywordL2||false;o.exactMatchKeyword=n.exactMatchKeyword||false;o.qid=n.qid;o.templateID=n.templateID;if(n.isJSBootstrapMatch){o.isJSBootstrapMatch=n.isJSBootstrapMatch;o.backendCost=n.backendCost;o.bootstrapCost=n.bootstrapCost;}this._replaceCategoryWithTermMatches(o,n);return o.tuid;};m.prototype._replaceCategoryWithTermMatches=function(n,o){'use strict';if(n.type!=="user"||!n.term_to_subtitle||!o.termMatches)return;var p=[];o.termMatches.forEach(function(r){if(n.term_to_subtitle[r])p.push(n.term_to_subtitle[r]);},this);if(n.category===undefined)n.category="";var q=n.category.split(" \xB7 ");q.unshift.apply(q,p);q=q.filter(function(r,s,t){return s==t.indexOf(r);});n.category=q.splice(0,2).join(" \xB7 ");};m.prototype.getRawStructure=function(n){'use strict';if(typeof n=='string')n=c('FacebarStructuredText').fromString(n);if(this.resultStore)return this.resultStore.transformStructured(n.toArray());};m.prototype.saveResult=function(n){'use strict';this._initialQueryData=this.getUID(n.uid,n.fetchType);};m.prototype.isDefaultKeywordQuery=function(n){'use strict';return n.type===c('FacebarJSConstants').keywordType&&c('FacebarResultStoreUtils').getTextFromResult(n).toLowerCase()===this.value.getHash().trim().toLowerCase();};m.prototype.buildUids=function(n){'use strict';if(!n||!this.resultStore)return [];if(typeof n==='string')n=c('FacebarStructuredText').fromString(n);var o=this.getRawStructure(n),p=this.resultStore.getResults(o,this.getMaxResults()),q=p.results;if(typeof q==='undefined')return [];var r=p.null_state===true,s=0;q=q.filter(function(w,x){if(!c('FacebarGlobalOptions').allowGrammar&&w.type=='grammar')return false;return w.semantic!='<blank>'&&(w.type!='unimplemented'||s++===0);},this);var t=[],u=[],v=[];q.forEach(function(w){if(w.forcedPosition>0){v.push(w);}else if(w.isSeeMore){t.push(w);}else u.push(w);});if(r){q=this.orderNullState(q,c('FacebarGlobalOptions').maxNullstateResultCount?c('FacebarGlobalOptions').maxNullstateResultCount:this.getMaxResults());}else q=u;if(v.length>0){v.sort(function(w,x){return w.forcedPosition-x.forcedPosition;});v.forEach(function(w){q.splice(w.forcedPosition,0,w);});}if(t.length>0)q.push.apply(q,t);return q.map(this.toTypeaheadEntryUid,this);};m.prototype.orderNullState=function(n,o){'use strict';var p={top:[],bottom:[],middle:[]},q=function(t){var u=t.null_state_position;return p.hasOwnProperty(u)?u:'middle';},r=function(t,u){return t.original_cost-u.original_cost;};n&&n.forEach(function(t){p[q(t)].push(t);},this);for(var s in p){p[s]=p[s].sort(r).slice(0,o);o-=p[s].length;}return [].concat(p.top,p.middle,p.bottom);};m.prototype.isEntity=function(n){'use strict';if(!n)return false;return (/^\d+$/.test(n));};m.prototype.handleResponse=function(n,o){'use strict';if(!(n.payload.errors)){this.processEntries(n.payload.entities);if(n.payload.blockees)n.payload.blockees.forEach(function(p){if(!this.blockees.hasOwnProperty(p))this.blockees[p.toLocaleLowerCase()]=p;}.bind(this));n.payload.results.forEach(function(p){p.qid=n.queryId;if(!p.parse)p.parse={};p.parse.entTokens=p.parse.entTokens||[];p.parse.remTokens=p.parse.remTokens||[];p.parse.suffix=p.parse.suffix||'';if(this.isEntity(p.semantic))p=this._buildCommonEntityFields(p,o.tokens);}.bind(this));this.saveResults(n,o);}};m.prototype.saveResults=function(n,o){'use strict';var p=[];if(n.payload.seemore&&this._typeNamedXResults)n.payload.seemore.forEach(function(q){p.push(this._typeNamedXResults[q]);},this);if(n.payload.prefetched)this.processPrefetched(n.payload.prefetched);this.resultStore.saveResults(n.payload.results,o,n.payload.incomplete,{},p);};m.prototype.processPrefetched=function(n){'use strict';for(var o in n){var p=c('FacebarStructuredText').fromString(o),q=this.getRawStructure(p),r=n[o];this.processEntries(r.entities);r.results.forEach(function(s){if(this.isEntity(s.semantic))s=this._buildCommonEntityFields(s,q.tokens);}.bind(this));this.resultStore.saveResults(r.results,q,r.incomplete);}};m.prototype.processEntries=function(n){'use strict';return n.map(function(o,p){var q=o.uid=o.uid+'';o.textToIndex=this.getTitleTerms(o);o.titleToIndex=this.getTitleTerms(o);q=this.getUID(q,o.fetchType);var r=this.getEntry(q);if(!r){this.setEntry(q,{});r=this.getEntry(q);}else{delete o.photo;if(!c('FacebarGlobalOptions').facebarUpdateSnippets){delete o.category;delete o.subtext;}}Object.assign(r,o);r.tuid=q;r.index===undefined&&(r.index=p);return q;},this);};m.prototype.getUID=function(n,o){'use strict';n=n+'';if(o!==undefined){o=/([^:]+:)?([^:]+)(:.*)?/.exec(o)[2];return JSON.stringify([n,o]);}return n;};m.prototype.getEntry=function(n,o){'use strict';var p;n=''+n;p=o!=null?j.getEntry.call(this,this.getUID(n,o))||j.getEntry.call(this,n):j.getEntry.call(this,n);return p;};m.prototype.getEntryForFragment=function(n){'use strict';return this.getEntry(n.getUID(),n.getTypePart(2));};m.prototype.getMaxResults=function(){'use strict';return this._numResults.max;};m.prototype.query=function(n,o,p){'use strict';this.executeQueryThrottled(n,this._initialQueryData,{keyPress:c('FacebarTimerUtils').getTimestamp()});this._initialQueryData=null;};m.prototype.executeQuery=function(n,o,p){'use strict';this._curQueryId++;p.queryId=this._curQueryId;p.startCacheQuery=c('FacebarTimerUtils').getTimestamp();var q=this.getMaxResults()+c('FacebarTypeNamedXTokenOptions').additionalResultsToFetch;this.setQueryData({qid:this._curQueryId,max_results:q});this.inform('beforeQuery',{value:n,queryId:this._curQueryId});this.value=n;var r=this.buildUids(n,[]);p.endCacheQuery=c('FacebarTimerUtils').getTimestamp();if(o&&r.length===0)r.push(o);if(c('FacebarGlobalOptions').sendExistingIDs){var s=[];r.forEach(function(t){var u=this.getEntry(t);if(u&&u.type in c('FacebarJSConstants').entityTypes)s.push(u.uid);},this);if(s.length>0)this.setQueryData({qid:this._curQueryID,existing_ids:JSON.stringify(s),max_results:q});}this.inform('query',{value:n,results:r,queryId:this._curQueryId});if(this.resultStore)this.respond(n,r,false,false,p);};m.prototype.shouldFetchMore=function(n,o){'use strict';if(!n.is_empty&&c('FacebarGlobalOptions').fetchMoreKeywords){var p=o.filter(function(q){return q.type===c('FacebarJSConstants').keywordType;}).length;if(p<c('FacebarGlobalOptions').default_num_top_results_to_show)return true;}if(n.is_empty)return false;if(this.resultStore.alreadyKnown(n.cache_id))return false;if(n.raw_text&&this._isQueryTooShort(n.raw_text))return false;if(c('FacebarGlobalOptions').alwaysFetchMore)return true;if(o.length<this.getMaxResults()||this._performShortQuery)return true;return this.countValidResults(o)<this.getMaxResults()||this._performShortQuery;};m.prototype.countValidResults=function(n){'use strict';var o=0;n.forEach(function(p){if(p&&!p.isNullState&&!p.isSeeMore)o++;},this);return o;};m.prototype.sendRemoteQuery=function(n,o,p,q,r){'use strict';var s=this.getQueryData(n.text_form);s.gs_prefetch_mode=q;if(r)s.max_results=r;var t=new (c('AsyncRequest'))().setURI(this.queryEndpoint).setData(s).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true).setHandler(function(u,v){if(q&&v.payload.is_user)return;var w=v.payload;v.queryId=u;v.inputQuery=n.text_form;if(w.results!=null)w.results.forEach(function(y){y.isSingleState=this._single_state;y.isFromGSEF=q;}.bind(this));p.endRemoteQuery=c('FacebarTimerUtils').getTimestamp();this.inform('response_received',v);this.handleResponse(v,n);var x=[];if(w.abandon_cache)x=w.results.map(this.toTypeaheadEntryUid,this);this.respond(o,x,true,w&&(!w.results||w.results.length===0),p,w.num_topresults_to_show);this.inform('backend_response',v);if(c('FacebarGlobalOptions').disable_snowballing){this.resultStore.resetQueryCache();this.saveResults(v,n);}}.bind(this,p.queryId)).setFinallyHandler(function(){this.activityEnd();}.bind(this));this.inform('sending_request',t);this._maxRemoteQueryId=p.queryId;p.waitingQueries=this._waitingQueries;p.inflightRequests=c('AsyncRequest').getInflightCount();p.startRemoteQuery=c('FacebarTimerUtils').getTimestamp();t.send();this.activityStart();};m.prototype.activityStart=function(){'use strict';if(!this._waitingQueries)this.inform('activity',{activity:true},c('Arbiter').BEHAVIOR_STATE);this._waitingQueries++;};m.prototype.activityEnd=function(){'use strict';this._waitingQueries--;if(!this._waitingQueries)this.inform('activity',{activity:false},c('Arbiter').BEHAVIOR_STATE);};m.prototype._bucketizeResults=function(n,o,p){'use strict';o=this._tagKeywordsSuggestions(o);o=c('FacebarTypeaheadL2Terms').addL2Terms(o,this.getMaxResults(),n.toString(),c('FacebarGlobalOptions'));o=c('FacebarTypeaheadTypeNamedX').addTypeNamedX(o,this.getMaxResults(),n.toString(),c('FacebarGlobalOptions'));return this._resultsBucketizer.bucketize(o,k,null,p);};m.prototype._tagKeywordsSuggestions=function(n){'use strict';if(!n||n.length===0)return n;var o=n[0];if(o.bootstrapped)return n;if(o.type==='grammar'||o.cost<c('FacebarGlobalOptions').closeEntityThreshold&&o.type==='user')return n;return n.map(function(p){if(p.type!==c('FacebarJSConstants').keywordType)return p;p=babelHelpers['extends']({},p);p.tags.topBucket=true;return p;});};m.prototype._buildCommonEntityFields=function(n,o){'use strict';if(n.queryTypeText)return n;if(c('FacebarGlobalOptions').unbreakParseDisplay){n.parse.display=[{type:'ent:'+n.type,uid:n.semantic}];}else n.parse.display=[{type:'ent:'+n.type,uid:parseInt(n.semantic,10)}];if(n.parse.fetchType)n.parse.display[0].fetchType=n.parse.fetchType;n.parse.entTokens=o;n.parse.pos=0;n.resultsSetType='{'+n.type+'}';n.queryTypeText=c('FacebarJSConstants').defaultQueryTypeText;return n;};m.prototype.setBypassBucketizer=function(n){'use strict';this._bypassBucketizer=n;};m.prototype.respond=function(n,o,p,q,r,s){'use strict';if(p&&this.value){if(typeof this.value==='string')this.value=c('FacebarStructuredText').fromString(this.value);this.inform('remote_query_match',{isMatch:this.value.matches(n),queryId:r?r.queryId:0});n=this.value;if(!o||o.length===0)o=this.buildUids(n);}this.inform('reorderResults',o);this.inform('respondValidUids',o);var t=o.map(this.getEntry,this);t.forEach(function(v,w){v.fromCache=!p;v.isSingleState=this._single_state;},this);if(!p&&(n.getHash().length<512||n.getHash().startsWith('http://')||n.getHash().startsWith('https://'))){var u=this.getRawStructure(n);if(this.shouldFetchMore(u,t)){if(r!=null)r.dispatchRemoteQuery=c('FacebarTimerUtils').getTimestamp();if(this.hasGSPreload){this.sendRemoteQueryThrottled(u,n,r,true,this.gsPreloadOptions.max_entities_to_fetch);this.sendRemoteQueryThrottled(u,n,r);}else this.sendRemoteQueryThrottled(u,n,r);}}if(!p||!r||r.queryId===this._maxRemoteQueryId)this.renderResultsThrottled(n,t,p,q,s);if(r!=null)this.logLatencies(p,r);};m.prototype.renderResults=function(n,o,p,q,r){'use strict';if(r!=null){l[String(n)]=r;}else r=l[String(n)];c('FacebarGSv2Echo').insertInto(n,o,!p,this._single_state,this._is_local,this._categoryName,this._is_person_serp);if(c('FacebarGlobalOptions').graphSearchV2&&c('FacebarGlobalOptions').renderKeywordsFirst&&c('FacebarGlobalOptions').hasFlickerFix&&n!=null&&this._single_state!==true)c('FacebarNoFlickerResults').insertInto(n,o,p,this._waitingQueries!==0);if(!!n&&n instanceof c('FacebarStructuredText')&&!n.isEmptyOrWhitespace()&&!this._bypassBucketizer)o=this._bucketizeResults(n,o,r);o.length=Math.min(o.length,this.getMaxResults());this.injectExtraResults(n,o);q=p&&o.length===0;this.inform('respond',{value:n,results:o,isAsync:!!p,isEmptyResults:q});};m.prototype.injectExtraResults=function(n,o,p){'use strict';c('FacebarFindPeopleAndPages').insertInto(n,o,!p,this._single_state);c('FacebarInviteCoworkers').insertInto(n,o,!p,this._single_state);};m.prototype.logLatencies=function(n,o){'use strict';var p=c('FacebarTimerUtils').getTimestamp();if(n){this.inform('remote_query_latency',{queryId:o.queryId,latencies:{queryStart:Math.max(o.startRemoteQuery-o.dispatchRemoteQuery,0),queryEnd:Math.max(o.endRemoteQuery-o.startRemoteQuery,0),keyPressToQueryDispatch:Math.max(o.dispatchRemoteQuery-o.keyPress,0),keyPressToQueryStart:Math.max(o.startRemoteQuery-o.keyPress,0),keyPressToQueryEnd:Math.max(o.endRemoteQuery-o.keyPress,0),render:Math.max(p-o.endRemoteQuery,0),inflightRequests:o.inflightRequests,waitingQueries:o.waitingQueries,keyPressToRender:Math.max(p-o.keyPress,0)}});}else this.inform('cache_query_latency',{queryId:o.queryId,latencies:{queryStart:Math.max(o.startCacheQuery-o.keyPress,0),queryEnd:Math.max(o.endCacheQuery-o.startCacheQuery,0),keyPressToQueryEnd:Math.max(o.endCacheQuery-o.keyPress,0),render:Math.max(p-o.endCacheQuery,0),keyPressToRender:Math.max(p-o.keyPress,0)}});};m.prototype._updateMaxResults=function(){'use strict';c('queryThenMutateDOM')(function(){var n=c('Vector').getViewportDimensions().y,o=c('ViewportBounds').getTop()||42,p=56,q=48,r=n-o-q-25;this._maxResults=Math.max(this._numResults.min,Math.min(this._numResults.max,Math.floor(r/p)-1));this.value&&this.query(this.value);}.bind(this));};m.prototype.getCurQueryId=function(){'use strict';return this._curQueryId;};m.prototype.setTypenamedXOption=function(n){'use strict';c('FacebarGlobalOptions').showTypeNamedX=n;};m.prototype.setMinQueryLength=function(n){'use strict';this._minQueryLength=n;};m.prototype.setGrammarOption=function(n){'use strict';c('FacebarGlobalOptions').allowGrammar=n;};Object.assign(m.prototype,{events:['query','respond','bootstrapped','activity','ready']});f.exports=m;},null);
__d('FacebarTypeaheadDebugPane.react',['Banzai','Image.react','LeftRight.react','React'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'FacebarTypeaheadDebugPane',propTypes:{result:h.object.isRequired},getInitialState:function(){return {feedbackSent:false};},componentWillReceiveProps:function(j){if(j.result!==this.props.result)this.setState({feedbackSent:false});},sendFeedback:function(j){var k=this.props.result;if(k.decoration.entity===k)k.decoration.entity='';var l=JSON.stringify(k),m=JSON.stringify(k.debug.allResults),n={result:l,query:k.debug.query,position:k.debug.position,sid:k.debug.sid,allResults:m,isOK:j};c('Banzai').post('facebar_feedback',n,{delay:0});this.setState({feedbackSent:true});this.setState({feedbackOK:j});return false;},renderDebugText:function(j){return c('React').createElement('div',{key:j},j);},render:function(){var j=this.sendFeedback.bind(this,true),k=this.sendFeedback.bind(this,false),l=this.state.feedbackSent,m=l&&this.state.feedbackOK,n=l&&!this.state.feedbackOK;return (c('React').createElement('div',{className:'fsm pam'},c('React').createElement(c('LeftRight.react'),null,c('React').createElement('div',null,this.props.result.debug.map(this.renderDebugText)),c('React').createElement('div',null,c('React').createElement('div',{className:m?'':'hidden_elem'},c('React').createElement('strong',null,'Feedback sent'),c('React').createElement(c('Image.react'),{className:'mls',src:'/images/green_up.gif'})),c('React').createElement('div',{className:n?'':'hidden_elem'},c('React').createElement('strong',null,'Feedback sent'),c('React').createElement(c('Image.react'),{className:'mls',src:'/images/red_down.gif'})),c('React').createElement('div',{className:l?'hidden_elem':''},c('React').createElement('a',{href:'#',onClick:j},c('React').createElement(c('Image.react'),{src:'/images/green_up.gif'})),c('React').createElement('a',{href:'#',onClick:k},c('React').createElement(c('Image.react'),{className:'mls',src:'/images/red_down.gif'})))))));}});f.exports=i;},null);
__d('FacebarTypeaheadDiffText.react',['cx','React'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'FacebarTypeaheadDiffText',propTypes:{prefix:i.string,text:i.string},renderDiff:function(k,l){return (c('React').createElement('span',{className:"diffNode _5td3",key:l},k));},renderParts:function(){var k=this.props.prefix,l=this.props.text;if(k==null)return this.renderDiff(l,0);var m=l.toLowerCase().indexOf(k.toLowerCase());k=k.trim();if(m===0)l=l.slice(k.length);var n=l.split(/\b/).map(this.renderDiff);if(m===0)n.unshift(k);return n;},render:function(){return (c('React').createElement('span',this.props,this.renderParts()));}});j.generatePrefixes=function(k,l){var m=[],n,o;for(var p=0,q=l.length;p<q;p++){o=l[p].getText();n=k.slice(0,Math.min(k.length,o.length));if(n==='')return m;if(o.toLowerCase().indexOf(n.toLowerCase())===0){m.push(n);k=k.slice(n.length);}else m.push('');}return m;};f.exports=j;},null);
__d('FacebarTypeaheadHighlightedText.react',['BrowseFacebarHighlighter','React'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'FacebarTypeaheadHighlightedText',propTypes:{text:h.string,tokens:h.array},renderHighlight:function(j,k){if((k+1)%3===0){return c('React').createElement('span',{className:'highlightNode',key:k},j);}else if(j)return j;},renderParts:function(){var j=this.props.text,k=this.props.tokens;if(k&&j){var l=c('BrowseFacebarHighlighter').createRegex(k),m=j.split(l);return m.map(this.renderHighlight);}else return j;},render:function(){return (c('React').createElement('span',this.props,this.renderParts()));}});f.exports=i;},null);
__d('FacebarTypeaheadItem.react',['cx','Badge.react','Image.react','React','FacebarGlobalOptions','FacebarTypeaheadDebugPane.react','FacebarTypeaheadDiffText.react','FacebarTypeaheadHighlightedText.react','TimelineFilterOptions','URI','XUICloseButton.react','TypeaheadCanvasConfig','FacebarJSConstants','joinClasses','DOM','DOMContainer.react'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes;function j(l){var m=l.getTypePart(0);return m?'fragment'+m.charAt(0).toUpperCase()+m.substr(1):'fragment';}var k=c('React').createClass({displayName:'FacebarTypeaheadItem',propTypes:{result:i.object.isRequired,className:i.string,icon:i.object,token:i.object,highlight:i.array,prefix:i.string,message:i.object,valign:i.bool,recentSearchItem:i.bool},getDefaultProps:function(){return {valign:true};},renderHighlightedFragment:function(l,m){return (c('React').createElement(c('FacebarTypeaheadHighlightedText.react'),{className:j(l),key:m,text:l.getText(),tokens:this.props.highlight}));},renderDiffedFragment:function(l,m,n){return (c('React').createElement(c('FacebarTypeaheadDiffText.react'),{className:j(l),key:n,prefix:m,text:l.getText()}));},renderText:function(){var l=this.props.result,m=l.isLocal,n=l.displayStructure!=null?l.displayStructure.toArray():l.structure.toArray(),o=this.props.prefix;if(c('FacebarGlobalOptions').graphSearchV2&&!l.isSeeMore&&o!=null&&o.trim()!==''){var p=c('FacebarTypeaheadDiffText.react').generatePrefixes(o,n);if(m)p=[];return n.map(function(q,r){if(!p[r])p[r]='';return this.renderDiffedFragment(q,p[r],r);}.bind(this));}else return n.map(this.renderHighlightedFragment);},renderBadge:function(){if(this.props.result.photo&&this.props.showSecondaryIcon&&!this.props.result.isTrending)return (c('React').createElement('span',{className:"_34my"}));if(this.props.result.category&&this.props.result.category.toString().toLowerCase()===c('TypeaheadCanvasConfig').category_games.toLowerCase()&&c('TypeaheadCanvasConfig').in_games_v1){return (c('React').createElement(c('Badge.react'),{type:'game_blue',size:'medium'}));}else if(this.props.result.is_verified){return (c('React').createElement(c('Badge.react'),{type:'verified',size:'medium'}));}else if(this.props.result.is_work_user){return (c('React').createElement(c('Badge.react'),{type:'work',size:'medium'}));}else if(this.props.result.pages_verified_badge===1)return (c('React').createElement(c('Badge.react'),{type:'page_gray_check',size:'medium'}));},renderIcon:function(){var l=this.props.result,m=l.icon_class;if(m){return (c('React').createElement('span',{className:"_k83"},c('React').createElement('span',{className:m})));}else if(l.photo)return (c('React').createElement(c('Image.react'),{className:"_20h",alt:'',src:l.photo}));},renderSecondaryIcon:function(){var l=this.props.result;if(l.photo&&this.props.showSecondaryIcon){return (c('React').createElement('div',{className:"_20h"},c('React').createElement(c('Image.react'),{alt:'',src:l.photo})));}else if(!l.isRecent&&l.isInjectedSuggestion)return (c('React').createElement('span',{className:"_3kxl"}));},renderUnseenPosts:function(){if(this.props.recentSearchItem&&this.props.result.unseen_posts){var l=c('React').createElement(c('DOMContainer.react'),null,c('DOM').create('span',{className:''},' \xB7 ')),m=c('React').createElement(c('DOMContainer.react'),null,c('DOM').create('span',{className:''},this.props.result.unseen_posts.markup));return c('React').createElement('span',{className:"_2tb-"},l,m);}},renderLabel:function(){var l=' \u00B7 ',m=this.props.result,n="_53ad"+(this.props.valign&&this.props.token&&this.props.token.props&&this.props.token.props.text.length>0?' '+"_55y-":'')+(!m.category&&!m.subtext?' '+"_2vzo":'')+(!m.category&&!!m.subtext||m.category&&m.category.toString().indexOf(l)<0&&!m.subtext?' '+"_2vzp":'')+(m.category&&!!m.subtext||m.category&&m.category.toString().indexOf(l)>0?' '+"_2vzq":''),o=this.renderUnseenPosts(),p=c('React').createElement('span',{className:n},this.renderText(),this.renderBadge(),o,this.props.token),q="_7gk"+(this.props.message?' '+"_5byz":'');return (c('React').createElement('span',{className:q},p,this.props.message));},renderMain:function(){var l=c('React').createElement('a',{className:"_6i1",href:this.props.result.uri},c('React').createElement('span',null,this.props.icon||this.renderIcon(),this.renderLabel(),this.renderSecondaryIcon()));if(this.props.result.isAsync)l=c('React').createElement('a',{className:"_6i1",href:'#',ajaxify:this.props.result.asyncURI,rel:'async'},c('React').createElement('span',null,this.props.icon||this.renderIcon(),this.renderLabel(),this.renderSecondaryIcon()));return (c('React').createElement('span',{className:"_205",rel:'ignore'},this.renderActivityLogXButton(),l));},renderActivityLogXButton:function(){if(this.props.result.keywordBootstrapType!==c('FacebarJSConstants').keywordBootstrapTypes.recent)return null;var l=new (c('URI'))('/me/allactivity');l.setQueryData({privacy_source:'activity_log',log_filter:c('TimelineFilterOptions').SEARCH});return (c('React').createElement(c('XUICloseButton.react'),{size:'medium',className:"_2d9t",href:l}));},renderDebug:function(){return this.props.result.debug?c('React').createElement(c('FacebarTypeaheadDebugPane.react'),{result:this.props.result}):null;},render:function(){var l="_202"+(' '+"_5bl2")+(' '+"_6_k")+(c('FacebarGlobalOptions').graphSearchV2?' '+"_1et7":'')+(c('FacebarGlobalOptions').renderKeywordSnippets?' '+"_28vg":'')+(this.props.result.isCelebrity?' '+"_5g-n":'')+(this.props.result.isSeeMore?' '+"_qbs":'')+(this.props.result.isInjectedSuggestion?' '+"_3kxm":'')+(this.props.result.isTrending?' '+"_5g-o":'')+(this.props.result.isRecent?' '+"_jsd":'')+(this.props.result.isLocal?' '+"_1821":'')+(this.props.result.isFootball?' '+"_1822":'')+(this.props.result.isHashtag?' '+"_4z1b":'')+(this.props.result.isPersonSERP?' '+"_4xfx":'')+(this.props.result.isPhotos?' '+"_4z1c":'')+(this.props.result.isVideos?' '+"_4z1d":'')+(this.props.result.isInvalidated?' '+"_44vm":'');return (c('React').createElement('li',{className:c('joinClasses')(l,this.props.className),onClick:this.props.onClick,onMouseDown:this.props.onMouseDown,onMouseEnter:this.props.onMouseEnter,role:'option'},this.renderMain(),this.renderDebug()));}});f.exports=k;},null);
__d('FacebarTypeaheadToken.react',['cx','FacebarTypeaheadHighlightedText.react','React'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=' \u00B7 ',k=c('React').createClass({displayName:'FacebarTypeaheadToken',propTypes:{text:i.array.isRequired,highlight:i.array,limit:i.number,mainClass:i.string,innerClass:i.string,leadingMiddot:i.bool,savedContext:i.string,category:i.string},render:function(){var l=null;if(this.props.savedContext)l=c('React').createElement('span',{className:"_10j2"},this.props.savedContext);var m=this.props.text;if(this.props.limit)m.splice(this.props.limit);m.forEach(function(q,r){if(r!==0||this.props.leadingMiddot||l)m[r]=j+q;}.bind(this));var n=c('React').createElement(c('FacebarTypeaheadHighlightedText.react'),{className:this.props.mainClass,tokens:this.props.highlight,text:m.shift()}),o=m.length?c('React').createElement(c('FacebarTypeaheadHighlightedText.react'),{tokens:this.props.highlight,className:"_53ab",text:m.join('')}):null,p=this.props.innerClass||"_53aa";return (c('React').createElement('span',{className:"_53a9"},c('React').createElement('span',{className:p},l,n,o)));}});f.exports=k;},null);
__d('FacebarTypeaheadTokenText',['HTML','FbtResult','getElementText'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='\u00B7';function i(m){if(m instanceof c('FbtResult')){return m.toString();}else if(typeof m==='object'){return c('getElementText')(c('HTML')(m).getRootNode());}else return m||'';}function j(m){return i(m).split(h).map(function(n){return n.trim();});}function k(m){var n={};return m.filter(function(o){var p=!n[o];n[o]=true;return p&&o;});}var l={textForEntity:function(m,n){var o=m.category||n[m.type]||'',p=m.subtext||'',q=m.boldedSubtext||'',r=j(o).concat(j(q)).concat(j(p));return k(r);},text:function(m){return k(j(m));}};f.exports=l;},null);
__d('FacebarTypeaheadEntityItem.react',['cx','FacebarGlobalOptions','FacebarTypeaheadItem.react','FacebarTypeaheadToken.react','FacebarTypeaheadTokenText','Image.react','React','TypeaheadFacepileX.react','joinClasses'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'FacebarTypeaheadEntityItem',renderToken:function(){return (c('React').createElement(c('FacebarTypeaheadToken.react'),{highlight:this.getHighlightTokens(),text:c('FacebarTypeaheadTokenText').textForEntity(this.props.result,{}),category:this.props.result.category,savedContext:this.props.result.saved_context}));},renderIcon:function(){if(this.props.result.isNullState){var j=this.props.result.icon_class?c('React').createElement('span',{className:this.props.result.icon_class}):c('React').createElement(c('Image.react'),{className:"_20h",src:this.props.result.photo});return (c('React').createElement('span',{className:!c('FacebarGlobalOptions').renderKeywordSnippets?"_k83":''},j));}if(this.props.result.size>1&&this.props.result.photos){return (c('React').createElement(c('TypeaheadFacepileX.react'),{className:"_51l_",photos:this.props.result.photos,size:this.props.result.size}));}else if(this.props.result.photo)return (c('React').createElement(c('Image.react'),{className:"_20h",alt:'',src:this.props.result.photo}));},getHighlightTokens:function(){if(this.props.result.original_query){var j=this.props.result.original_query.toString().trim(),k=j.split(' '),l=k.length>1?[j].concat(k):[j];return l.filter(function(m){return m!=='';});}},render:function(){var j=this.props.className;if(this.props.result.isNullState)j=c('joinClasses')(this.props.className,!c('FacebarGlobalOptions').renderKeywordSnippets?"_207":'');return (c('React').createElement(c('FacebarTypeaheadItem.react'),babelHelpers['extends']({},this.props,{className:j,icon:this.renderIcon(),token:this.renderToken(),highlight:this.getHighlightTokens(),valign:true})));}});f.exports=i;},null);
__d('FacebarDisambiguationDialog',['cx','fbt','Event','BrowseLogger','CSS','Dialog','DOM','FacebarStructuredText','FacebarTypeaheadEntityItem.react','React','ReactDOM'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=650;function k(l,m,n,o,p){'use strict';this._sets=l;this._path=m;this._ondone=n;this._oncancel=o;this._selection=[];this._typeaheadSID=p;}k.prototype.show=function(){'use strict';new (c('Dialog'))().setTitle(i._("Which of these did you mean?")).setBody(this._createBody()).setContentWidth(j).setModal(true).setButtons([c('Dialog').CONFIRM,c('Dialog').CANCEL]).setHandler(this._handleDone.bind(this)).setCancelHandler(this._handleCancel.bind(this)).show();this._sets.forEach(function(l){var m=[];l.forEach(function(o){m.push(o.uid);});var n=l[0];c('BrowseLogger').logDisambiguationImpression(n.text,n.type,this._path,m.join(','),this._typeaheadSID);}.bind(this));};k.prototype._createBody=function(){'use strict';var l=[];this._sets.forEach(function(m,n){l.length&&l.push(c('DOM').create('li',{className:"_200"}));m.forEach(function(o){var p=this._createItem(o,n);this._selection[n]||this._selectItem(p);l.push(p.root);}.bind(this));}.bind(this));return c('DOM').create('ul',{className:'viewList disambiguationList'},l);};k.prototype._createItem=function(l,m){'use strict';var n={uri:null,subtext:l.subtext,category:l.category,photo:l.photo,type:l.type,structure:c('FacebarStructuredText').fromStruct([{text:l.text,type:'ent:'+l.type,uid:l.uid}])},o=c('DOM').create('div',{className:"_201"}),p=c('React').createElement(c('FacebarTypeaheadEntityItem.react'),{result:n}),q=c('DOM').create('div');c('ReactDOM').render(p,q);var r=q.firstChild;c('CSS').addClass(r,"_6i3");c('DOM').appendContent(r,c('CSS').hide(o));var s={setId:m,result:l,root:r,check:o};c('Event').listen(r,'mouseover',this._toggleHover.bind(this,s,true));c('Event').listen(r,'mouseout',this._toggleHover.bind(this,s,false));c('Event').listen(r,'click',function(event){this._selectItem(s);return event.kill();}.bind(this));return s;};k.prototype._toggleHover=function(l,m){'use strict';c('CSS').conditionClass(l.root,'selected',m);};k.prototype._toggleCheck=function(l,m){'use strict';c('CSS').conditionShow(l.check,m);};k.prototype._selectItem=function(l){'use strict';var m=this._selection[l.setId];this._selection[l.setId]=l;m&&this._toggleCheck(m,false);this._toggleCheck(l,true);};k.prototype._handleDone=function(l){'use strict';this._ondone(l==c('Dialog').CONFIRM?this._selection.map(function(m){var n=m.result;c('BrowseLogger').logDisambiguationClick(n.text,n.type,this._path,n.index,n.uid,this._typeaheadSID);return n;}.bind(this)):null);};k.prototype._handleCancel=function(){'use strict';this._oncancel();};f.exports=k;},null);
__d('FacebarTypeahead',['Arbiter','Typeahead','emptyFunction'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('Typeahead'));i=h&&h.prototype;function j(k,l,m,n,o,p){'use strict';i.constructor.call(this,k,l,m,n);this.getCore();this.proxyEvents();this.initBehaviors(o||[]);var q=this.core.subscribe('focus',function(){if(p)p.init(this);this.core.unsubscribe(q);this.data.bootstrap(false);this.core.input.focus();}.bind(this));this.data.bootstrap(true);this.inform('init',this,c('Arbiter').BEHAVIOR_PERSISTENT);c('Arbiter').inform('Facebar/init',this,c('Arbiter').BEHAVIOR_PERSISTENT);}j.prototype.proxyEvents=function(){'use strict';var k,l=[],m=null,n=function(){while(k=l.shift())this.inform(k[0],k[1]);m=null;}.bind(this);[this.data,this.view,this.core].forEach(function(o){o.subscribe(o.events,function(p,q){l.push([p,q]);m=m||setTimeout(n,0);}.bind(this));},this);};Object.assign(j.prototype,{init:c('emptyFunction')});f.exports=j;},null);
__d('StructuredInputDOM',['cx','createArrayFromMixed','CSS','DOM','FacebarGlobalOptions','getElementText','isElementNode','isTextNode'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=function(){return c('FacebarGlobalOptions').graphSearchV2?"_4v1s":"_586o";},j={ENTITY_CLASS:i(),encodeText:function(k){return k.replace(/ /g,'\u00a0');},decodeText:function(k){return k.replace(/\u00a0/g,' ');},createIconNode:function(k){if(k&&typeof k=='object'){var l=c('DOM').create('i',{className:k.className,style:k.uri&&{backgroundImage:'url("'+k.uri+'")'}});l.setAttribute('data-select','ignore');return l;}},createTextNode:function(k){return c('DOM').create('span',{'data-si':true},j.encodeText(k||""));},createEntityNode:function(k,l){var m=j.encodeText(k.text),n=j.createIconNode(l.icon),o=c('DOM').create('span',{},n?[n,m]:m),p=(l.className||'').split(/\s+/);p.push(j.ENTITY_CLASS);p.forEach(c('CSS').addClass.bind(c('CSS'),o));var q={si:true,uid:k.uid,type:k.type,text:m,'is-local':k.isLocal,'category-name':k.categoryName,fulltext:m,group:l.group,select:l.select,icon:JSON.stringify(l.icon||null)};for(var r in q)if(q[r]!=null)o.setAttribute('data-'+r,q[r]);return o;},convertToTextNode:function(k){k.className='';k.setAttribute('data-type','text');k.removeAttribute('data-group');k.removeAttribute('data-select');k.removeAttribute('data-icon');k.removeAttribute('data-uid');k.removeAttribute('data-is-local');k.removeAttribute('data-category-name');for(var l=k.firstChild;l;l=l.nextSibling)if(!c('isTextNode')(l))c('DOM').remove(l);},isEntityNode:function(k){return c('isElementNode')(k)&&c('CSS').hasClass(k,j.ENTITY_CLASS);},containsOnlyText:function(k,l){l=c('createArrayFromMixed')(l);for(var m=k.firstChild;m;m=m.nextSibling)if(!(c('isTextNode')(m)||k.nodeName in l))return false;return true;},getText:function(k){return c('getElementText')(k).replace(/ /g,'\u00a0');},getDecodedText:function(k){return j.decodeText(c('getElementText')(k));},getLength:function(k){return c('getElementText')(k).length;},getMarker:function(k,l,m){var n=k.firstChild;while(n){var o=j.getLength(n);if(o>l||!n.nextSibling){if(c('isTextNode')(n)||!m){return {node:n,offset:Math.min(l,o)};}else return j.getMarker(n,l);}else l-=o;n=n.nextSibling;}}};f.exports=j;},null);
__d('StructuredInputUtil',['StructuredInputDOM'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(n,o,p){var q=n.substr(0,o).lastIndexOf(p);return q!==-1?q+1:0;}function i(n,o,p){var q=n.indexOf(p,o);return q!==-1?q:n.length;}function j(n,o,p){return (o===0||o===n.length||n.substr(o,p.length)==p);}function k(n,o,p,q){switch(o){case 'none':return p;case 'all':return q?n.length:0;case 'word':if(j(n,p,'\u00a0')){return p;}else if(q){return i(n,p,'\u00a0');}else return h(n,p,'\u00a0');}}function l(n,o){return o&&c('StructuredInputDOM').isEntityNode(n)&&!c('StructuredInputDOM').isEntityNode(o);}var m={getMarkerAtOffset:function(n,o){var p=n.firstChild,q=0,r=0;while(p){q+=r;r=c('StructuredInputDOM').getLength(p);if(q+r>o){break;}else p=p.nextSibling;}return {node:p||n.lastChild,offset:o-q};},validateEntityText:function(n){var o=c('StructuredInputDOM').getText(n),p=n.getAttribute('data-fulltext'),q=n.getAttribute('data-group');if(q=='hashtag'){var r=o.match(/#[^\s]+/);p=r&&r[0];}var s=o.indexOf(p),t={prefix:null,entity:null,suffix:null};switch(q){case 'none':t.entity=o;break;case 'hashtag':case 'all':if(s!=-1){t.prefix=o.substr(0,s);t.entity=o.substr(s,p.length);t.suffix=o.substr(s+p.length);}else t.suffix=o;break;case 'word':if(s!=-1){t.prefix=o.substr(0,s);o=o.substr(s);}var u=0,v=0;while(u<p.length){v=i(p,u+1,'\u00a0');if(o.substr(0,v)!=p.substr(0,v)){break;}else u=v;}t.entity=o.substr(0,u)||null;t.suffix=o.substr(u)||null;}return t;},getGrouping:function(n,o){var p=n.getAttribute('data-group'),q=n.getAttribute('data-select');if(o=='select'){return q=='group'?p:'none';}else return p;},snapMarkerToText:function(n,o){var p=n.node;if(c('StructuredInputDOM').isEntityNode(p)){var q=n.offset,r=m.getGrouping(p,o);if(r!='none')if(q===0){var s=p.previousSibling;if(l(p,s))return {node:s,offset:c('StructuredInputDOM').getLength(s)};}else if(q==c('StructuredInputDOM').getLength(p)){var t=p.nextSibling;if(l(p,t))return {node:t,offset:0};}}return n;},nextMarkerBoundary:function(n,o,p){var q=n.node;if(c('StructuredInputDOM').isEntityNode(q)&&(!o||n.offset!==0)){var r=m.getGrouping(q,p);if(r!='none')return {node:n.node,offset:k(c('StructuredInputDOM').getText(q),r,n.offset,o)};}return n;}};f.exports=m;},null);
__d('StructuredInputCleaner',['DOM','StructuredInputDOM','StructuredInputUtil','UserAgent_DEPRECATED','createArrayFromMixed','getElementText','isTextNode'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j,k){'use strict';this._node=i;this._selection=j;this._wrapText=k;}h.prototype._cleanEntityNode=function(i){'use strict';var j=i.getAttribute('data-text'),k=c('StructuredInputDOM').getText(i);i.style.cssText='';if(j==k&&c('StructuredInputDOM').containsOnlyText(i,{I:true}))return null;var l=[],m=c('StructuredInputUtil').validateEntityText(i),n=c('StructuredInputDOM').createIconNode(JSON.parse(i.getAttribute('data-icon')));if(!m.entity&&(m.suffix&&!m.prefix||m.prefix&&!m.suffix)){c('StructuredInputDOM').convertToTextNode(i);i.setAttribute('data-text',k);return null;}if(m.prefix)l.push(this._createTextNode(m.prefix));if(m.entity){if(this._selection&&c('getElementText')(i)!==m.entity)this._selection.markDirty(i);c('DOM').setContent(i,n?[n,m.entity]:m.entity);i.setAttribute('data-text',m.entity);l.push(i);}if(m.suffix)l.push(this._createTextNode(m.suffix));return l;};h.prototype._removeSpecialNodes=function(){'use strict';var i=c('createArrayFromMixed')(this._node.getElementsByTagName('script')),j=c('createArrayFromMixed')(this._node.getElementsByTagName('style'));i.forEach(c('DOM').remove);j.forEach(c('DOM').remove);};h.prototype._collapseNodes=function(){'use strict';for(var i,j=this._node.firstChild;j;j=i){i=j.nextSibling;if(!c('isTextNode')(j)&&!c('StructuredInputDOM').isEntityNode(j)&&!c('StructuredInputDOM').containsOnlyText(j))for(var k=j.lastChild;k;k=j.lastChild){this._node.insertBefore(k,i);i=k;}}};h.prototype._createTextNode=function(i){'use strict';if(this._wrapText){return c('StructuredInputDOM').createTextNode(i);}else return document.createTextNode(i);};h.prototype.replaceNodes=function(i,j){'use strict';if(j==null)return;var k=i.length?i[i.length-1].nextSibling:null;i.forEach(function(l){if(j.indexOf(l)===-1)c('DOM').remove(l);},this);j.reverse().forEach(function(l){if(i.indexOf(l)===-1)this._node.insertBefore(l,k);k=l;},this);};h.prototype.clean=function(){'use strict';this._removeSpecialNodes();this._collapseNodes();var i=[],j=function(){if(i.length){this.replaceNodes(i,this._cleanTextNodes(i));i.length=0;}}.bind(this);Array.from(this._node.childNodes).forEach(function(k){if(c('StructuredInputDOM').isEntityNode(k)){this.replaceNodes([k],this._cleanEntityNode(k));j(i);}else i.push(k);}.bind(this));j();if(!this._node.firstChild&&c('UserAgent_DEPRECATED').firefox())this._node.appendChild(this._createTextNode());};h.prototype.endOnText=function(){'use strict';var i=function(j,k){if(c('StructuredInputDOM').isEntityNode(j))this._node.insertBefore(this._createTextNode(),k?j:null);}.bind(this);i(this._node.firstChild,true);i(this._node.lastChild,false);};Object.assign(h.prototype,{_cleanTextNodes:function(){var i=function(k){return (k.nodeName==='BR'||k.nodeName==='SPAN'&&j(k));},j=function(k){return k.getAttribute('data-si')&&c('StructuredInputDOM').containsOnlyText(k)&&c('StructuredInputDOM').getLength(k)>0;};return function(k){if(k.length!=1||!i(k[0])){var l=k.map(c('StructuredInputDOM').getText).join('').replace(/\s+/g,' ');return l?[this._createTextNode(l)]:[];}else{k[0].style.cssText='';return;}};}()});f.exports=h;},null);
__d("DOMSelection",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();(function(){var h=this,i={isPreceding:function(o,p){return p.compareDocumentPosition(o)&2;},contains:function(o,p){if(o.compareDocumentPosition!=null){return o.compareDocumentPosition(p)&16;}else return o.contains(p);},isCursorPreceding:function(o,p,q,r){if(o===q)return p<=r;if(i.isText(o)&&i.isText(q))return i.isPreceding(o,q);if(i.isText(o)&&!i.isText(q))return !i.isCursorPreceding(q,r,o,p);if(!i.contains(o,q))return i.isPreceding(o,q);if(o.childNodes.length<=p)return false;if(o.childNodes[p]===q)return 0<=r;return i.isPreceding(o.childNodes[p],q);},isText:function(o){return (o!=null?o.nodeType==3:false);},getChildIndex:function(o){var p=0;while(o=o.previousSibling)p++;return p;}},j=h.Selection=(function(){function o(p){this.win=p;}o.prototype.hasSelection=function(){return o.hasSelection(this.win);};o.prototype.isBidirectional=function(){return o.isBidirectional(this.win);};o.prototype.getOrigin=function(){return o.getOrigin(this.win);};o.prototype.getFocus=function(){return o.getFocus(this.win);};o.prototype.getStart=function(){return o.getStart(this.win);};o.prototype.getEnd=function(){return o.getEnd(this.win);};o.prototype.trySelection=function(p,q,r,s){return o.trySelection(this.win,p,q,r,s);};o.prototype.setSelection=function(p,q,r,s){return o.setSelection(this.win,p,q,r,s);};o.prototype.clearSelection=function(){return o.clearSelection(this.win);};return o;})();function k(){if(h.document.selection&&/MSIE 9\./.test(navigator.userAgent)){return false;}else return !!h.getSelection;}if(k()){j.supported=true;j.hasSelection=function(o){var p;return (p=o.getSelection())&&(p.focusNode!=null)&&(p.anchorNode!=null);};j.isBidirectional=function(o){return true;};j.getOrigin=function(o){var p;if(!((p=o.getSelection())&&(p.anchorNode!=null)))return null;return [p.anchorNode,p.anchorOffset];};j.getFocus=function(o){var p;if(!((p=o.getSelection())&&(p.focusNode!=null)))return null;return [p.focusNode,p.focusOffset];};j.getStart=function(o){var p,q,r,s,t,u;if(!j.hasSelection(o))return null;t=j.getOrigin(o),p=t[0],r=t[1];u=j.getFocus(o),q=u[0],s=u[1];if(i.isCursorPreceding(p,r,q,s))return [p,r];return [q,s];};j.getEnd=function(o){var p,q,r,s,t,u;if(!j.hasSelection(o))return null;t=j.getOrigin(o),p=t[0],r=t[1];u=j.getFocus(o),q=u[0],s=u[1];if(i.isCursorPreceding(p,r,q,s))return [q,s];return [p,r];};var l=function(o,p,q,s,t,u){var v=p.getSelection();if(!v)return;if(t==null)t=q;if(u==null)u=s;if(v.collapse&&v.extend){v.collapse(q,s);v.extend(t,u);}else{r=p.document.createRange();r.setStart(q,s);r.setEnd(t,u);if(o||!j.hasSelection(p)||(r.endContainer===t&&r.endOffset===u&&r.startContainer===q&&r.startOffset===s)){try{v.removeAllRanges();}catch(w){}v.addRange(r);}}};j.setSelection=l.bind(j,true);j.trySelection=l.bind(j,false);j.clearSelection=function(o){try{var q=o.getSelection();if(!q)return;q.removeAllRanges();}catch(p){}};j.getText=function(o){var p=o.getSelection();if(!p)return;return p.toString();};}else if(h.document.selection){var m=function(o,p,q){var r,s,t,u,v;s=o.createElement('a');r=p.duplicate();r.collapse(q);v=r.parentElement();while(true){v.insertBefore(s,s.previousSibling);r.moveToElementText(s);if(!(r.compareEndPoints((q?'StartToStart':'StartToEnd'),p)>0&&(s.previousSibling!=null)))break;}if(r.compareEndPoints((q?'StartToStart':'StartToEnd'),p)===-1&&s.nextSibling){r.setEndPoint((q?'EndToStart':'EndToEnd'),p);t=s.nextSibling;u=r.text.length;}else{t=s.parentNode;u=i.getChildIndex(s);}s.parentNode.removeChild(s);return [t,u];},n=function(o,p,q,r,s){var t,u,v,w,x;x=0;t=i.isText(r)?r:r.childNodes[s];u=i.isText(r)?r.parentNode:r;if(i.isText(r))x=s;w=o.createElement('a');u.insertBefore(w,t||null);v=o.body.createTextRange();v.moveToElementText(w);w.parentNode.removeChild(w);p.setEndPoint((q?'StartToStart':'EndToEnd'),v);return p[q?'moveStart':'moveEnd']('character',x);};j.supported=true;j.hasSelection=function(o){var p;if(!o.document.selection)return false;p=o.document.selection.createRange();return p&&p.parentElement().document===o.document;};j.getStart=function(o){var p;if(!j.hasSelection(o))return null;p=o.document.selection.createRange();return m(o.document,p,true);};j.getEnd=function(o){var p;if(!j.hasSelection(o))return null;p=o.document.selection.createRange();return m(o.document,p,false);};j.isBidirectional=function(o){return false;};j.getOrigin=function(o){return j.getStart(o);};j.getFocus=function(o){return j.getEnd(o);};var l=function(o,p,q,r,s,t){if(s==null)s=q;if(t==null)t=r;var u=p.document.body.createTextRange();n(p.document,u,false,s,t);n(p.document,u,true,q,r);return u.select();};j.setSelection=l.bind(j,true);j.trySelection=l.bind(j,false);j.clearSelection=function(o){return o.document.selection.empty();};j.getText=function(o){if(!j.hasSelection(o))return null;var p=o.document.selection.createRange();return p&&p.text;};}else j.supported=false;}).call(this);f.exports=Selection;},null);
__d('StructuredInputSelection',['DOM','DOMSelection','Scroll','Vector','StructuredInputUtil','StructuredInputDOM'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(j){'use strict';var k=j.ownerDocument;this.window=k.defaultView||k.parentWindow;this.root=j;this.selection=false;this.start=new i(this,[]);this.end=new i(this,[]);this.update();}h.prototype.isSupported=function(){'use strict';return !!(c('DOMSelection')&&c('DOMSelection').hasSelection);};h.prototype.update=function(){'use strict';this.selection=false;if(this.isSupported()&&this.root==document.activeElement)if(c('DOMSelection').hasSelection(this.window)){var j=c('DOMSelection').getStart(this.window),k=c('DOMSelection').getEnd(this.window),l=c('DOMSelection').getFocus(this.window);this.start=this.makeMarker(j);this.end=this.makeMarker(k);this.backward=j[0]==l[0]&&j[1]==l[1];this.selection=this.start.node&&this.end.node;}};h.prototype.makeMarker=function(j){'use strict';if(j[0]===this.root){return new i(this,[this.root.childNodes[j[1]],0]);}else return new i(this,j);};h.prototype.getFocus=function(){'use strict';return this.backward?this.start:this.end;};h.prototype.getOrigin=function(){'use strict';return this.backward?this.end:this.start;};h.prototype.move=function(j){'use strict';if(this.selection){this.start.move(j);this.start.snap();this.end.setPosition(this.start);return this.apply();}};h.prototype.expand=function(j){'use strict';if(this.selection){if(c('DOMSelection').isBidirectional()){this.start.move(!j);this.start.snap();this.end.move(j);this.end.snap();}return this.apply();}};h.prototype.getText=function(){'use strict';if(this.selection&&this.isSupported()){var j=c('DOMSelection').getText(this.window);return j;}};h.prototype.getOffset=function(){'use strict';if(this.selection)return this.start.rootOffset;};h.prototype.getLength=function(){'use strict';return (this.getText()||"").length;};h.prototype.setPosition=function(j,k){'use strict';this.backward=false;this.selection=true;this.start.setPosition(c('StructuredInputUtil').getMarkerAtOffset(this.root,j));this.start.snap();if(k>0){this.end.setPosition(c('StructuredInputUtil').getMarkerAtOffset(this.root,j+k));this.end.snap();}else this.end.setPosition(this.start);return this.apply();};h.prototype.hasRange=function(){'use strict';return this.selection&&(this.start.node!=this.end.node||this.start.offset!=this.end.offset);};h.prototype.scrollToFocus=function(){'use strict';var j=5,k=this.getFocus();if(k.node){var l=c('Vector').getElementDimensions(this.root).x,m=c('Scroll').getLeft(this.root),n=k.node.offsetLeft+k.node.offsetWidth;if(n-m<j){c('Scroll').setLeft(this.root,n-j);}else if(n-m>l-j)c('Scroll').setLeft(this.root,n-l+j);}};h.prototype.apply=function(){'use strict';if(this.start.hasChanged()||this.end.hasChanged()){var j=this.getOrigin().getMarker(true),k=this.getFocus().getMarker(true);this.selection=this.selection&&j&&j.node&&k&&k.node;if(this.selection&&this.isSupported()){this.start.changed=false;this.end.changed=false;c('DOMSelection').trySelection(this.window,j.node,j.offset,k.node,k.offset);return true;}}};h.prototype.markDirty=function(j){'use strict';if(c('DOM').contains(j,this.start.node,j))this.start.changed=true;if(c('DOM').contains(j,this.end.node,j))this.end.changed=true;};function i(j,k){'use strict';this.selection=j;this.node=k[0];this.offset=k[1];this.rootOffset=this.getRootOffset(k[0],k[1]);this.sibling=this.node&&this.node.previousSibling;this.changed=false;}i.prototype.hasChanged=function(){'use strict';return this.changed||!this.isNodeValid();};i.prototype.isNodeValid=function(){'use strict';if(c('StructuredInputDOM').getLength(this.node)>this.offset){var j=this.node;while(j=j.parentNode)if(j==this.selection.root)return true;}};i.prototype.getMarker=function(j){'use strict';if(this.isNodeValid()&&(j&&!this.node.firstChild||!j&&this.node.parentNode==this.selection.root)){return this;}else return c('StructuredInputDOM').getMarker(this.selection.root,this.rootOffset,j);};i.prototype.move=function(j){'use strict';this.node&&this.setPosition(c('StructuredInputUtil').nextMarkerBoundary(this.getMarker(false),j,'select'));};i.prototype.snap=function(){'use strict';this.node&&this.setPosition(c('StructuredInputUtil').snapMarkerToText(this.getMarker(false),'select'));};i.prototype.setPosition=function(j){'use strict';if(j.offset!=this.offset||j.node!=this.node){this.changed=true;this.node=j.node;this.offset=j.offset;this.rootOffset=this.getRootOffset(this.node,this.offset);}};i.prototype.getRootOffset=function(j,k){'use strict';var l=0,m=5;while(j&&l++<m)if(j===this.selection.root){return k;}else{var n=j;while(n=n.previousSibling)k+=c('StructuredInputDOM').getLength(n);j=j.parentNode;}};f.exports=h;},null);
__d('StructuredInput',['csx','cx','fbt','Arbiter','ArbiterMixin','CSS','DataStore','DOM','Event','Input','InputSelection','JSLogger','Keys','Locale','Parent','Scroll','StructuredInputCleaner','StructuredInputDOM','StructuredInputSelection','StructuredInputUtil','Style','UserAgent_DEPRECATED','createArrayFromMixed','createObjectFrom','emptyFunction','getActiveElement','isElementNode','isTextNode','mixin','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g,h,i,j){var k,l;if(c.__markCompiled)c.__markCompiled();var m=229,n=c('createObjectFrom')([c('Keys').UP,c('Keys').DOWN,c('Keys').LEFT,c('Keys').RIGHT,c('Keys').HOME,c('Keys').END]),o=c('createObjectFrom')([c('Keys').BACKSPACE,c('Keys').DELETE]),p=c('createObjectFrom')([c('Keys').SPACE,c('Keys').RETURN]),q=c('createObjectFrom')('IUB'.split('').map(function(v){return v.charCodeAt(0);})),r=c('UserAgent_DEPRECATED').firefox(),s=c('UserAgent_DEPRECATED').ie(),t=c('UserAgent_DEPRECATED').webkit();k=babelHelpers.inherits(u,c('mixin')(c('ArbiterMixin')));l=k&&k.prototype;function u(v){'use strict';l.constructor.call(this);c('DataStore').set(v,'StructuredInput',this);this._root=v;this._richInput=c('DOM').find(v,"._586i");this._textInput=c('DOM').find(v,"._586f");this._placeholderText=c('DOM').scry(v,"._586j")[0];this._hintText=c('DOM').find(v,"._586k");this._contentWidth=null;this._richWidth=null;this._hintNodes=[];c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(w,x){x.structuredInputState={initInputsFinished:!!this._initInputsFinished,initEventsFinished:!!this._initEventsFinished,cleanInputPreTogglesFinished:!!this._cleanInputPreTogglesFinished,cleanInputFinished:!!this._cleanInputFinished,elements:{richInput:!!this._richInput,textInput:!!this._textInput,placeholderText:!!this._placeholderText,hintText:!!this._hintText}};}.bind(this));this.init();}u.prototype.init=function(){'use strict';this.init=c('emptyFunction');this._initSelection();this._initCleaner();this._initInputs();this._initInputsFinished=true;this._initEvents();this._initEventsFinished=true;this._scheduledCleanInput=false;this._richChanged=false;this._textChanged=false;this._selectionChanged=false;this._selectionIgnore=false;this._imeMode=false;this.cleanInput();this.inform('init',null,c('Arbiter').BEHAVIOR_PERSISTENT);};u.prototype._initInputs=function(){'use strict';this._richInput.contentEditable=true;this._richInput.spellcheck=false;this._richInput.tabIndex=0;this._richInput.setAttribute('aria-label',j._("Search Facebook"));this._textInput.tabIndex=-1;this._multiline=this._textInput.nodeName=='TEXTAREA';if(!c('CSS').shown(this._richInput)){var v=c('InputSelection').get(this._textInput),w=c('getActiveElement')()===this._textInput;c('DOM').setContent(this._richInput,c('StructuredInputDOM').encodeText(c('Input').getValue(this._textInput)));c('CSS').hide(this._textInput);c('CSS').show(this._richInput);this.cleanInput();if(w){this._richInput.focus();this.setSelection({offset:v.start,length:v.end-v.start});}}this.togglePlaceholder();this._toggleHint();};u.prototype._initEvents=function(){'use strict';var v=null,w=false,x=function(){this._richChanged=true;w||this.scheduleCleanInput(true);}.bind(this),y=function(){this._textChanged=true;w||this.scheduleCleanInput(false);}.bind(this),z=function(){this._selectionChanged=true;this.scheduleCleanInput(false);}.bind(this),aa=function(){this._imeMode=true;this._placeholderText&&c('CSS').hide(this._placeholderText);c('CSS').hide(this._hintText);}.bind(this),ba=function(){this._imeMode=false;this._richChanged=true;this.cleanInput();}.bind(this);c('Event').listen(this._richInput,'keydown',function(ca){v=ca.keyCode;if(ca.ctrlKey&&ca.keyCode in q){return ca.kill();}else if(ca.keyCode in n){z();}else if(ca.keyCode===c('Keys').BACKSPACE&&this._deleteTrailingChunk()){this._richChanged=true;this.cleanInput();return ca.kill();}else if(ca.keyCode in o){x();}else if(ca.keyCode==m)aa();}.bind(this));c('Event').listen(this._richInput,'keypress',function(ca){if(ca.keyCode==c('Keys').RETURN){this._multiline&&this._insertText("\n");return ca.kill();}else if(!this._selectionChanged&&this._selectionIsText()){y();}else x();}.bind(this));if(!w){c('Event').listen(this._richInput,'keyup',function(ca){if((this._imeMode||ca.keyCode!=v)&&ca.keyCode in p){ba();return ca.kill();}else if(this._imeMode){this._textChanged=true;this.cleanInput();}}.bind(this));if(r)c('Event').listen(this._richInput,'input',function(){this._textChanged=true;this.cleanInput();}.bind(this));}else{c('Event').listen(this._richInput,'compositionstart',aa);c('Event').listen(this._richInput,'compositionend',function(){setTimeout(ba,0);});c('Event').listen(this._richInput,'input',function(){this._textChanged=true;if(!this._imeMode)if(!this._richChanged){this.cleanInput();}else this.scheduleCleanInput();}.bind(this));}c('Event').listen(document,'selectionchange',function(){if(this._selectionIgnore){this._selectionIgnore=false;}else this._selectionChanged=true;}.bind(this));c('Event').listen(this._richInput,'mousedown',function(){this._selectionChanged=true;this._selectionLength=0;this._selectionOffset=0;}.bind(this));c('Event').listen(this._richInput,'mouseup',function(){this._selectionChanged=true;this.scheduleCleanInput();}.bind(this));c('Event').listen(this._richInput,'cut',function(){this._richChanged=true;this.scheduleCleanInput(false);}.bind(this));c('Event').listen(this._richInput,'paste',function(ca){this._richChanged=true;this.scheduleCleanInput(true);}.bind(this));c('Event').listen(this._richInput,'drop',function(ca){this.focus();this.selectAll();this._insertClipboard(ca&&ca.dataTransfer);return ca.kill();}.bind(this));c('Event').listen(this._richInput,'dragover',function(ca){ca.dataTransfer.dropEffect='move';ca.dataTransfer.effectAllowed='move';return ca.kill();});c('Event').listen(this._richInput,'focus',function(ca){this._toggleHint();this.inform('focus');}.bind(this));c('Event').listen(this._richInput,'blur',function(ca){c('CSS').hide(this._hintText);this._imeMode=false;this._richChanged=true;this.scheduleCleanInput(false);this.inform('blur');}.bind(this));};u.prototype._initCleaner=function(){'use strict';this._cleaner=new (c('StructuredInputCleaner'))(this._richInput,this._selection,true);};u.prototype._initSelection=function(){'use strict';this._selection=new (c('StructuredInputSelection'))(this._richInput);this._selectionLength=0;this._selectionOffset=0;};u.prototype._insertClipboard=function(v){'use strict';if(v&&typeof v.getData==='function'){var w=v.getData('Text');this._insertText(w);}};u.prototype._deleteTrailingChunk=function(v){'use strict';var w=this.getSelection();if(w.length>0||w.offset===0)return false;var x=this.getSelection().offset-1,y=c('StructuredInputUtil').getMarkerAtOffset(this._richInput,x);if(y&&c('StructuredInputDOM').isEntityNode(y.node)&&c('StructuredInputUtil').getGrouping(y.node,'select')!=='none'){c('DOM').remove(y.node);return true;}return false;};u.prototype._selectionIsText=function(){'use strict';var v=this._selection.start.node,w=this._selection.end.node;return v&&v===w&&!c('StructuredInputDOM').isEntityNode(v)&&!c('StructuredInputDOM').isEntityNode(v.parentNode);};u.prototype._insertText=function(v){'use strict';if(v){var w=c('DOM').create('div',{},v);return this._insertNodes(w);}};u.prototype._insertHTML=function(v){'use strict';if(v){var w=c('DOM').create('div'),x=new (c('StructuredInputCleaner'))(w,null,false);w.innerHTML=v;x.clean();return this._insertNodes(w);}};u.prototype._insertNodes=function(v){'use strict';if(document.selection){document.selection.createRange().pasteHTML(v.innerHTML);}else document.execCommand('insertHTML',false,v.innerHTML);this._richChanged=true;this.cleanInput();};u.prototype.togglePlaceholder=function(v){'use strict';if(!this._placeholderText)return;var w=c('StructuredInputDOM').getLength(this._richInput)===0;if(v&&w){c('CSS').show(this._placeholderText);}else c('CSS').conditionShow(this._placeholderText,w&&!this._imeMode);};u.prototype._toggleHint=function(){'use strict';var v=c('createArrayFromMixed')(this._hintNodes),w=null,x='',y=c('StructuredInputDOM').getText(this._richInput).toLowerCase();if(!this.hasFocus())return;if(this._contentOverflows()){c('CSS').hide(this._hintText);return;}while(v.length&&x.length<y.length){w=v.shift();x+=c('StructuredInputDOM').getText(w);}if(y.length&&x.substr(0,y.length).toLowerCase()==y.toLowerCase()){c('DOM').setContent(this._hintText,Array.from(this._richInput.cloneNode(true).childNodes).filter(function(aa){return aa.tagName!=='BR';}));var z=c('StructuredInputDOM').createTextNode(x.substr(y.length));v.unshift(z);c('DOM').appendContent(this._hintText,c('DOM').create('span',{className:"_586h"},v));c('CSS').show(this._hintText);c('CSS').hide(this._placeholderText);}else c('CSS').hide(this._hintText);};u.prototype._contentOverflows=function(){'use strict';if(this._richWidth===null)this._richWidth=this._richInput.clientWidth;if(this._contentWidth===null){var v=this._richInput.lastChild;this._contentWidth=c('isElementNode')(v)?v.offsetLeft+v.offsetWidth:0;}return this._contentWidth>this._richWidth;};u.prototype._forceTop=function(){'use strict';if(!this._multiline)c('Scroll').setTop(this._richInput,0);c('Scroll').setTop(this._root,0);};u.prototype._createStructureNodes=function(v){'use strict';return v.map(function(w){return w.uid||w.type&&w.type!='text'?c('StructuredInputDOM').createEntityNode(w,w.display||{}):c('StructuredInputDOM').createTextNode(w.text);}.bind(this));};u.prototype._suppressInput=function(){'use strict';if(r||s){if(this._richClean)return;this._richClean=this._richInput.cloneNode(true);this._richClean.contentEditable=false;this._root.insertBefore(this._richClean,this._richInput.nextSibling);c('Scroll').setLeft(this._richClean,c('Scroll').getLeft(this._richInput));c('Style').set(this._richInput,'padding',0);c('Style').set(this._richInput,'height',0);}};u.prototype._revealInput=function(){'use strict';if(!this._richClean)return;c('Style').set(this._richInput,'height','');c('Style').set(this._richInput,'padding','');this._root.removeChild(this._richClean);this.focus();this._richClean=null;};u.prototype._cleanInput=function(){'use strict';var v;if(this._textChanged&&!this._richChanged){this._selection.update();v='change';}else if(this._richChanged||this._selectionChanged){this._selection.update();if(this._richChanged){this._contentWidth=null;this._cleaner.clean();this._cleaner.endOnText();this._selection.apply();v='change';}if(this._selectionChanged){this._cleanSelection();if(this._selectionLength||!this._richChanged)v='select';}}this._revealInput();this._forceTop();this._cleanInputPreTogglesFinished=true;if(this._richChanged||this._textChanged){this.togglePlaceholder();this._toggleHint();}this._selectionIgnore=true;this._selectionChanged=false;this._richChanged=false;this._textChanged=false;this._cleanInputFinished=true;v&&this.inform(v);};u.prototype._cleanSelection=function(){'use strict';var v=this._selection.getLength(),w=this._selection.getOffset();if(v){this._selection.expand(v>=this._selectionLength);v=this._selection.getLength();w=this._selection.getOffset();}this._selectionLength=v;this._selectionOffset=w;};u.prototype.cleanInput=function(){'use strict';this._scheduledCleanInput||this._cleanInput();};u.prototype.scheduleCleanInput=function(v){'use strict';v&&this._suppressInput();if(!this._scheduledCleanInput){this._scheduledCleanInput=true;c('setTimeoutAcrossTransitions')(function(){this._cleanInput();this._scheduledCleanInput=false;}.bind(this),0);}};u.prototype.setEnabled=function(v){'use strict';this._textInput.disabled=!v;this._richInput.contentEditable=v;};u.prototype.getRoot=function(){'use strict';return this._root;};u.prototype.getRichInput=function(){'use strict';return this._richInput;};u.prototype.getEnabled=function(){'use strict';return !this._textInput.disabled;};u.prototype.getText=function(){'use strict';return c('StructuredInputDOM').getDecodedText(this._richInput);};u.prototype.setText=function(v){'use strict';c('DOM').setContent(this._richInput,c('StructuredInputDOM').createTextNode(v));this._richChanged=false;this._selectionChanged=false;this.inform('change');};u.prototype.setHint=function(v){'use strict';this._hintNodes=this._createStructureNodes(v);this._toggleHint();};u.prototype.getStructure=function(){'use strict';var v=[];Array.from(this._richInput.childNodes).forEach(function(w){var x=!c('isTextNode')(w),y=c('StructuredInputDOM').getDecodedText(w);y.length&&v.push({text:y,uid:x?w.getAttribute('data-uid'):null,type:x&&w.getAttribute('data-type')||'text',isLocal:x&&w.getAttribute('data-is-local'),categoryName:x?w.getAttribute('data-category-name'):null});});return v;};u.prototype.setStructure=function(v){'use strict';c('DOM').setContent(this._richInput,this._createStructureNodes(v));this._cleaner.clean();this._cleaner.endOnText();this.togglePlaceholder();this._toggleHint();this._richChanged=false;this._selectionChanged=false;this.inform('change');};u.prototype.getContentDimensions=function(){'use strict';var v=this._richInput.lastChild;return {width:v?v.offsetLeft+v.offsetWidth:0,height:v?v.offsetTop+v.offsetHeight:0};};u.prototype.getSelection=function(){'use strict';if(this._selection)return {offset:this._selection.getOffset(),length:this._selection.getLength()};};u.prototype.setSelection=function(v){'use strict';if(this.hasFocus()&&this._selection){this._selection.update();this._selection.setPosition(v.offset,v.length);this._selection.scrollToFocus();this._selectionChanged=false;this.inform('select');}};u.prototype.moveSelectionToEnd=function(){'use strict';this.setSelection({length:0,offset:c('StructuredInputDOM').getLength(this._richInput)});};u.prototype.isSelectionAtEnd=function(){'use strict';var v=this.getSelection().offset,w=c('StructuredInputDOM').getLength(this._richInput);return v>=w;};u.prototype.selectAll=function(){'use strict';this.setSelection({offset:0,length:c('StructuredInputDOM').getLength(this._richInput)});};u.prototype.hasFocus=function(){'use strict';return c('DOM').contains(this._root,document.activeElement);};u.prototype.focus=function(){'use strict';this._richInput.focus();};u.prototype.blur=function(){'use strict';var v={position:'absolute',top:0,width:'1px',height:'1px'};if(c('Locale').isRTL()){v.right='-100px';}else v.left='-100px';var w=c('DOM').create('input',{type:'text',tabIndex:-1,style:v});c('DOM').appendContent(this._root,w);var x=function(){if(this.hasFocus()||t&&document.activeElement===document.body){w.focus();w.blur();}};this.blur=x;this.blur();};u.getInstance=function(v){var w=c('Parent').bySelector(v,"._586g");if(!w)throw new Error('No DOMElement structured input found using '+v);return c('DataStore').get(w,'StructuredInput')||new u(w);};f.exports=u;},null);
__d('FacebarTypeaheadInput',['csx','ArbiterMixin','DOM','FacebarStructuredText','StructuredInput','Vector','Locale','mixin'],function a(b,c,d,e,f,g,h){var i,j;if(c.__markCompiled)c.__markCompiled();var k={text:{className:"text",group:"all",select:"none"},ent:{className:"entity",group:"all",select:"group"},'ent:hashtag_exact':{className:"entity",group:"hashtag",select:"none"}};function l(n){return Object.assign(n.toStruct(),{display:k[n.getType()]||k[n.getTypePart(0)]});}i=babelHelpers.inherits(m,c('mixin')(c('ArbiterMixin')));j=i&&i.prototype;function m(n){'use strict';j.constructor.call(this);this.root=n;this.input=c('StructuredInput').getInstance(n);this.value=null;this.selection={offset:0,length:0};this.resetOnChange=true;this.initEvents();}m.prototype.initEvents=function(){'use strict';var n=function(o,p){this.inform(o,p);}.bind(this);this.input.subscribe('blur',n);this.input.subscribe('focus',n);this.input.subscribe('change',function(o,p){if(this.resetOnChange)this.value=null;this.inform('change',p);}.bind(this));};m.prototype.togglePlaceholder=function(n){'use strict';return this.input.togglePlaceholder(n);};m.prototype.focus=function(){'use strict';this.input.focus();};m.prototype.blur=function(){'use strict';this.input.blur();};m.prototype.getElement=function(){'use strict';return this.root;};m.prototype.getRawPlaceholderElement=function(){'use strict';return c('DOM').find(this.root,"._586j");};m.prototype.getRawInputElement=function(){'use strict';return c('DOM').scry(this.root,"._586i")[0];};m.prototype.getValue=function(){'use strict';if(this.value===null)this.value=c('FacebarStructuredText').fromStruct(this.input.getStructure());return this.value;};m.prototype.getLength=function(){'use strict';return this.getValue().getLength();};m.prototype.resetPlaceholder=function(){'use strict';this.input.resetPlaceholder();};m.prototype.setValue=function(n,o){'use strict';this.value=n;this.resetOnChange=!!o;var p=n.toArray().map(l);this.input.setStructure(p);this.input.setSelection({offset:n.getLength(),length:0});this.resetOnChange=true;};m.prototype.storeSelection=function(){'use strict';this.selection=this.input.getSelection();};m.prototype.restoreSelection=function(){'use strict';if(this.selection)this.input.setSelection(this.selection);};m.prototype.clearSelection=function(){'use strict';this.input.setSelection({offset:this.getLength(),length:0});};m.prototype.setHint=function(n){'use strict';var o=n&&!n.hasRTL()&&!c('Locale').isRTL()?n.toArray().map(l):[];this.input.setHint(o);};m.prototype.isSelectionAtEnd=function(){'use strict';return this.input.isSelectionAtEnd();};m.prototype.selectInput=function(n){'use strict';this.input.setSelection({offset:n||0,length:this.getLength()});};m.prototype.getEndOffset=function(){'use strict';var n=c('Vector').getElementDimensions(this.root),o=this.input.getContentDimensions();return Math.min(n.x,o.width);};Object.assign(m.prototype,{events:['change','focus','blur']});f.exports=m;},null);
__d('FacebarTypeaheadWebSearch',['FacebarStructuredFragment','FacebarStructuredText'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=new (c('FacebarStructuredFragment'))({type:'ent:websuggestion',text:'Web Search: ',uid:null}),i=h.getText().toLowerCase().trim();function j(m,n){if(!m||m.type!=='websuggestion')return;var o=n.getValue().toArray();o.forEach(function(p){if(p.isType('ent')&&!p.isType('ent','user')&&p.getUID())if(m.extra_uri_params){m.extra_uri_params.qh=p.getUID();return;}});}function k(m){return m.getType()===h.getType();}function l(m){'use strict';this._core=m.getCore();this._view=m.getView();this._input=this._core.input;this._isEnabled=false;}l.prototype.enable=function(){'use strict';this._isEnabled=true;this.changeListener=this._input.subscribe('change',this._changeWebSearch.bind(this));this.lockListener=this._input.subscribe('shortcut',this._lockWebSearch.bind(this));this.beforeSelectListener=this._view.subscribe('beforeSelect',this._beforeSelect.bind(this));this.beforeRenderListener=this._view.subscribe('beforeRender',this._beforeRender.bind(this));};l.prototype._changeWebSearch=function(){'use strict';var m=this._input.getValue(),n=m.toArray(),o=n[0];if(o&&o.getType()==='text')if(o.getText().toLowerCase().startsWith(i)){n.splice(0,1,h,new (c('FacebarStructuredFragment'))({text:o.getText().substr(i.length).replace(/^ /,'')}));this._replaceFragments(n);}else if(n.length>1&&n.some(k)){var p='';n.forEach(function(q){if(k(q))return;p+=q.getText();});this._input.storeSelection();this._input.setValue(c('FacebarStructuredText').fromString(p));this._input.restoreSelection();}};l.prototype._replaceFragments=function(m){'use strict';this._input.storeSelection();this._input.setValue(new (c('FacebarStructuredText'))(m));this._input.restoreSelection();};l.prototype._beforeSelect=function(m,n){'use strict';j(n.selected,this._input);return true;};l.prototype._beforeRender=function(m,n){'use strict';var o=this._input.getValue().toArray()[0],p=o&&k(o);n.results.forEach(function(q){if(q.type==='websuggestion')q.isLockedWebSearchMode=p;});return true;};l.prototype._lockWebSearch=function(m,n){'use strict';if(n.shift){var o=this._input.getValue().toArray()[0];if(!o||!k(o))this._input.setValue(new (c('FacebarStructuredText'))([h]));}};l.prototype.disable=function(){'use strict';this.beforeSelectListener.unsubscribe();this.changeListener.unsubscribe();this.lockListener.unsubscribe();this.beforeRenderListener.unsubscribe();this._isEnabled=false;};l.addPrefix=function(m){'use strict';var n=k(m.getFragment(0))||m.getFragment(0).getText().toLowerCase().startsWith(i);if(!n){var o=[h].concat(m.toArray());return new (c('FacebarStructuredText'))(o);}else return m;};f.exports=l;},null);
__d('FacebarTypeaheadCore',['csx','cx','invariant','Animation','Arbiter','ArbiterMixin','Base64','DOM','Event','FacebarGlobalOptions','FacebarJSConstants','FacebarKeywordSearchUtils','FacebarResultStoreUtils','FacebarStructuredText','FacebarTypeaheadInput','FacebarTypeaheadWebSearch','Keys','KeywordsSearchResultConfig','Parent','Style','URI','arrayContains','getActiveElement','mixin','setTimeout'],function a(b,c,d,e,f,g,h,i,j){var k,l;if(c.__markCompiled)c.__markCompiled();k=babelHelpers.inherits(m,c('mixin')(c('ArbiterMixin')));l=k&&k.prototype;function m(n){'use strict';l.constructor.call(this);Object.assign(this,n);}m.prototype.init=function(n,o,p){'use strict';if(window.getSelection===null)throw new Error('Facebar: window.getSelection is null!');this.init=function(){};this.data=n;this.view=o;this.root=p;this.facebarRoot=c('Parent').bySelector(p,"._585-");this.windowFocused=true;this.isFocused=false;this.hoverAnimation=null;this.stickyQuery=null;this.settedQuery=null;this.selectedQuery=null;this.currentQuery=null;this.isSuggestionBagdeVisible=false;this.initSubcomponents();this.initEvents();this.checkValue();this.checkSingleState();this.checkLocal();this.checkCategoryName();this.checkIsPersonSERP();};m.prototype.initSubcomponents=function(){'use strict';var n=c('DOM').find(this.root,"._5861");this.input=new (c('FacebarTypeaheadInput'))(n);this.view.setInputElement(this.input.getRawInputElement());};m.prototype.initEvents=function(){'use strict';c('Event').listen(this.root,'keydown',this.keydown.bind(this));c('Event').listen(this.root,'keyup',this.keyup.bind(this));c('Event').listen(this.root.parentNode,'mousedown',this.mousedown.bind(this));c('Event').listen(this.view.getElement(),'mousedown',this.mousedown.bind(this));c('Event').listen(window,'focus',this.focusWindow.bind(this));c('Event').listen(window,'blur',this.blurWindow.bind(this));this.view.subscribe('select',this.selectView.bind(this));this.view.subscribe('highlight',this.highlightView.bind(this));this.view.subscribe('render',this.highlightView.bind(this));this.view.subscribe('hideHelp',this.performQuery.bind(this));this.input.subscribe('focus',this.focusInput.bind(this));this.input.subscribe('blur',this.blurInput.bind(this));this.input.subscribe('change',this.changeInput.bind(this));this.data.subscribe('activity',this.typeaheadActivity.bind(this));this.data.subscribe('respond',this.completeData.bind(this));this.data.subscribe('nullstateReady',this.performQueryIfVisible.bind(this));this.data.subscribe('reloadNullstate',this.performQuery.bind(this));c('Arbiter').subscribe('FacebarTypeahead.clearRecentSearches',function(){return this.clearRecentSearches();}.bind(this));c('Arbiter').subscribe('FacebarTypeahead.focus',function(){this.input.focus();c('setTimeout')(function(){this.input.clearSelection();}.bind(this),0);}.bind(this));c('setTimeout')(this.initFocus.bind(this),0);};m.prototype.initFocus=function(){'use strict';if(!this.lazyFocused&&c('DOM').contains(this.input.root,c('getActiveElement')())){this.lazyFocused=true;this.isFocused=true;this._newSession();this.inform('focus',{catchup:true});this.open(true);}};m.prototype.setStartTime=function(n){'use strict';this.inform('focusStartTime',{time:n});};m.prototype.cleanQuery=function(n){'use strict';n=babelHelpers['extends']({},n)||{};if(!n.structure)n.structure=new (c('FacebarStructuredText'))();if(!c('FacebarGlobalOptions').allowGrammar||c('FacebarJSConstants').nonGrammarTypes[n.type])n.structure=c('FacebarStructuredText').fromString(n.structure.toString());!(n.structure instanceof c('FacebarStructuredText'))?j(0):void 0;if(n.type=='websuggestion'&&c('FacebarGlobalOptions').allowGrammar&&c('FacebarGlobalOptions').webSearchLockedInMode)n.structure=c('FacebarTypeaheadWebSearch').addPrefix(n.structure);return n;};m.prototype._unlockQuery=function(){'use strict';var n=this.input.getValue();if(n.hasType('ent')&&n.trim().getCount()===1){this.input.storeSelection();this.input.setValue(c('FacebarStructuredText').fromString(n.toString()));this.input.restoreSelection();}};m.prototype.setPageQuery=function(n){'use strict';n=this.cleanQuery(n);var o=this.input.getValue(),p=n.structure,q=!p.isEmptyOrWhitespace()&&(o.isEmptyOrWhitespace()||!o.matches(p));return this.selectQuery(n,q);};m.prototype.selectQuery=function(n,o){'use strict';o=o!==false;n=this.cleanQuery(n);if(o||!this.selectedQuery){if(o||this.getValue().isEmptyOrWhitespace())this.setQuery(n);this.selectedQuery=n;}return n;};m.prototype.completeSelection=function(){'use strict';var n=this.view.getSelection();if(n&&!n.search){this.data.saveResult(n);n.structure=n.structure.pad();this.setQuery(n);return true;}};m.prototype.setQuery=function(n,o){'use strict';n=this.cleanQuery(n);if(n.structure.hasType('blank'))n.structure=new (c('FacebarStructuredText'))(n.structure.toArray().filter(function(p){return p.getType()!='blank';}));this.input.setValue(n.structure);this.settedQuery=n;this.stickyQuery=o===false?this.stickyQuery:n;this.checkValue();this.checkSingleState();this.checkLocal();this.checkCategoryName();this.checkIsPersonSERP();};m.prototype.checkValue=function(){'use strict';if(this.value&&this.value.getHash()==this.input.getValue().getHash())return;this.checkBlockedSearch();this.performQueryIfVisible();this.showSearchSuggestionBadgeIfPossible();};m.prototype.showSearchSuggestionBadgeIfPossible=function(){'use strict';if(this.isNullState()){if(!this.isSuggestionBagdeVisible&&this.data.resultStore.injectedSuggestionCount){c('Arbiter').inform('FacebarTypeahead.showSuggestionBadge');this.isSuggestionBagdeVisible=true;}}else if(this.isSuggestionBagdeVisible){c('Arbiter').inform('FacebarTypeahead.hideSuggestionBadge');this.isSuggestionBagdeVisible=false;}};m.prototype.checkSingleState=function(){'use strict';var n=this.input.getValue();this.data.setSingleState(n.getCount()===1&&n.hasType('ent'));};m.prototype.checkIsPersonSERP=function(){'use strict';var n=this.input.getValue();this.data.setIsPersonSERP(n.getCount()===1&&n.isPersonSERP());};m.prototype.checkLocal=function(){'use strict';var n=this.input.getValue();this.data.setLocal(n.getCount()===1&&n.isLocal());};m.prototype.checkCategoryName=function(){'use strict';var n=this.input.getValue();if(n.getCategoryName()!==null)this.data.setCategoryName(n.getCategoryName());};m.prototype.checkBlockedSearch=function(){'use strict';var n=this.input.getValue().toString().toLocaleLowerCase();if(!this.data.blockees||!this.data.blockees.hasOwnProperty(n)){this.view.hideBlockNotification();}else this.view.showBlockNotification(this.data.blockees[n]);};m.prototype.isNullState=function(){'use strict';return this.input.getValue().getHash()==='';};m.prototype.performQueryIfVisible=function(){'use strict';if(!this.view.visible)return;this.performQuery();};m.prototype.performQuery=function(){'use strict';this.value=this.nextQuery=this.getValue();if(c('FacebarGlobalOptions').graphSearchV2)this.view.resetIndex();this.data.query(this.nextQuery);this.currentQuery=this.nextQuery;};m.prototype.requery=function(){'use strict';if(this.currentQuery)this.data.query(this.currentQuery);};m.prototype.executeQuery=function(n){'use strict';var o=this.isNullState();n=this.cleanQuery(n);var p=this.inform('execute',n),q=this.getSessionID();this.close();if(c('FacebarGlobalOptions').allowGrammar){this.selectQuery(n);}else this.selectQuery();if(c('FacebarGlobalOptions').hasRecentSearchNullState&&n.type!=='shortcut'&&(!o||n.isInjectedSuggestion)){this.data.resultStore.addRecentEntryToNullState(n);if(n.isInjectedSuggestion){c('Arbiter').inform('FacebarTypeahead.removeInjectedSuggestion');--this.data.resultStore.injectedSuggestionCount;this.performQuery();}}if(!p)this._navigateToQuery(n,q);};m.prototype.getSearchType=function(){'use strict';return 'facebar';};m.prototype._newSession=function(){'use strict';if(this._sessionID!=null)return;this._sessionID=Math.random().toString();this.inform('session',this._sessionID,c('Arbiter').BEHAVIOR_STATE);};m.prototype._closeSession=function(){'use strict';this._sessionID=null;this.inform('session',null,c('Arbiter').BEHAVIOR_STATE);};m.prototype.getSessionID=function(){'use strict';return this._sessionID;};m.prototype._navigateToQuery=function(n,o){'use strict';var p=this.data.facebarConfig;if(n.uri){n.uri.addQueryData(n.extra_uri_params);n.uri.addQueryData({ref:'br_tf'});if(n.structure&&(n.type=='websuggestion'||n.type==c('KeywordsSearchResultConfig').result_type||n.type=='grammar'&&(!p||String(n.uri.getPath()).startsWith(p.search_path)))){var q=this.data.getRawStructure(n.structure).text_form,r=c('Base64').encode(encodeURIComponent(q)).replace(/\=+$/,''),s={sid:o,qs:r,gv:this.data.getQueryData().grammar_version},t=c('Base64').encode(JSON.stringify(s)).replace(/\=+$/,'');n.uri.addQueryData({ref:t,bs:n.alternateSemantic});}n.uri.go();return;}};m.prototype.reset=function(){'use strict';this.selectQuery();this.inform('reset');this.showSearchSuggestionBadgeIfPossible();};m.prototype.animateInputValue=function(n,o,p){'use strict';this.hoverAnimation&&this.hoverAnimation.stop();var q=new (c('Animation'))(o).from('opacity',1).to('opacity',0).duration(150).ondone(function(){this.input.setValue(p);this.hoverAnimation=r.go();}.bind(this)),r=new (c('Animation'))(n).from('opacity',0).to('opacity',1).duration(150).ondone(function(){this.hoverAnimation=null;c('Style').set(o,'opacity','');c('Style').set(n,'opacity','');}.bind(this));c('Style').set(n,'opacity',0);this.hoverAnimation=q.go();};m.prototype.open=function(n){'use strict';this.inform('open');this.view.show(this.facebarRoot.offsetWidth);this.input.focus({catchup:n});this.checkValue();this.checkSingleState();this.checkLocal();this.checkCategoryName();this.checkIsPersonSERP();if(!this.isFocused){this.isFocused=true;this._newSession();this.inform('focus');}};m.prototype.close=function(){'use strict';this._closeSession();if(this.inform('close')===false)return;if((!this.value||this.value.isEmptyOrWhitespace())&&this.selectedQuery){this.input.setValue(this.selectedQuery.structure);}else if(this.stickyQuery)this.input.setValue(this.stickyQuery.structure);this.input.blur();this.view.hide();this.view.setAutoSelect(false);this.inform('session',null,c('Arbiter').BEHAVIOR_STATE);if(this.isFocused){this.isFocused=false;c('setTimeout')(this.inform.bind(this,'blur'),0);}};m.prototype.getElement=function(){'use strict';return this.root;};m.prototype.getValue=function(){'use strict';return this.input.getValue();};m.prototype.getText=function(){'use strict';return this.getValue().toString();};m.prototype.submitQuery=function(n){'use strict';if(c('FacebarGlobalOptions').graphSearchV2&&this.view.index<0){var o=this.input.getValue(),p=this.data.getRawStructure(o);if(p&&!p.is_empty){var q=!p.raw_text?c('FacebarResultStoreUtils').getRawTextFromStructured(o.toArray()):p.raw_text,r=c('FacebarKeywordSearchUtils').makeFacebarEntry(q);r.position=n;this.inform('magSearch',r);this.executeQuery(r);}}else this.view.select();};m.prototype.keydown=function(event){'use strict';var n=true,o=c('Event').getKeyCode(event);if(event.metaKey===true)this.metaOnKeyDown=true;switch(o){case c('Keys').ESC:this.close();break;case c('Keys').RIGHT:if(!c('FacebarGlobalOptions').disableLockingEntitiesOnRightArrow){n=this.input.isSelectionAtEnd()&&this.completeSelection();}else n=false;break;case c('Keys').TAB:var p=this.cleanQuery(this.view.getSelection()),q=p.structure.hasType('blank');if(event.getModifiers().shift||!this.completeSelection()&&!this.loading){this.view.setAutoSelect(false);this.view.hide();n=false;}else if(!q&&!c('FacebarGlobalOptions').graphSearchV2)this.tabQueued=true;break;case c('Keys').UP:this.view.prev();break;case c('Keys').DOWN:this.view.next();break;case c('Keys').RETURN:var r=-2;this.submitQuery(r);break;case c('Keys').PAGE_UP:this.view.first();break;case 222:var s=this.input.value.trim();if(!event.getModifiers().shift&&s.endsOnType('ent'))this.input.setValue(s);n=false;break;default:var t=o<=46&&o!==8&&o!==32,u=o>=112&&o<=126,v=o===144||o===145,w=o===91||o===92||o===93||o===224;if(!t&&!u&&!v&&!event.metaKey&&!w){this.data.setSingleState(false);this.data.setLocal(false);if(c('FacebarGlobalOptions').autohighlight)this.view.setAutoSelect(true);}this.stickyQuery=null;n=false;break;}this.input.storeSelection();if(n)return event.kill();};m.prototype.keyup=function(event){'use strict';var n=c('Event').getKeyCode(event),o=n<=46&&n!==8&&n!==32,p=n>=112&&n<=126,q=n===144||n===145,r=n===91||n===92||n===93||n===224;if(!o&&!p&&!q&&!event.metaKey&&!r&&!this.metaOnKeyDown)if(c('FacebarGlobalOptions').unlockTextOnKeypress)this._unlockQuery();if(!r)this.metaOnKeyDown=false;};m.prototype.mousedown=function(event){'use strict';if(c('FacebarGlobalOptions').autohighlight)this.view.setAutoSelect(true);this.input.storeSelection();if(c('Parent').bySelector(event.target,"._50c9"))event.preventDefault();};m.prototype.focusWindow=function(){'use strict';this.windowFocused=true;};m.prototype.blurWindow=function(){'use strict';this.windowFocused=false;};m.prototype.selectView=function(n,o){'use strict';if(!o||!o.selected)return;this.inform('select',o);var p=this.cleanQuery(o.selected);this.executeQuery(p);};m.prototype.highlightView=function(){'use strict';var n=this.view.getSelection();if(c('FacebarGlobalOptions').graphSearchV2){this.input.setHint(n?n.structure:null);}else n&&this.input.setHint(n.structure);};m.prototype.blurInput=function(){'use strict';c('setTimeout')(function(){if(this.windowFocused||c('URI').getRequestURI().getSubdomain()==='apps'){this.input.togglePlaceholder();this.close();}}.bind(this),0);};m.prototype.changeInput=function(){'use strict';this.inform('change');this.checkValue();this.checkLocal();this.checkIsPersonSERP();this.inform('change_end');};m.prototype.focusInput=function(){'use strict';this.open();this.input.togglePlaceholder(false);};m.prototype.updateData=function(){'use strict';this.view.setLoading(this.loading);};m.prototype.completeData=function(n,o){'use strict';this.checkBlockedSearch();if(o.forceDisplay||this.value&&this.value.matches(o.value)){var p=c('FacebarGlobalOptions').graphSearchV2?!o.results.length:!o.results.length&&!this.loading&&o.isEmptyResults;this.view.render(o.value,o.results,o.isAsync,p);if(this.tabQueued&&this.completeSelection())delete this.tabQueued;}};m.prototype.typeaheadActivity=function(n,o){'use strict';this.fetching=o.activity;if(this.loading!==this.fetching){this.loading=this.fetching;this.updateData();}};m.prototype.getNameTextFromSelected=function(){'use strict';var n=this.settedQuery&&this.settedQuery.semantic,o=this.data.facebarConfig&&this.data.facebarConfig.name_functions,p=n&&o&&n.match(/[a-z-]+\([^()]+\)/g);if(p)for(var q=0;q<p.length;q++){var r=p[q].match(/([a-z-]+)\(([^()]+)\)/);if(r&&c('arrayContains')(o,r[1]))return r[2];}return this.value.toString();};m.prototype.clearRecentSearches=function(){'use strict';this.data.resultStore.clearRecentSearches();};m.clearRecentSearches=function(){'use strict';c('Arbiter').inform('FacebarTypeahead.clearRecentSearches');};Object.assign(m.prototype,{events:['session','focus','select','change','execute','blur','focusStartTime','open']});f.exports=m;},null);
__d('FacebarTypeaheadRecorder',['clickRefAction','Event','Keys','SearchTypeaheadRecorder','URI','Arbiter','FacebarTimerUtils','FacebarGlobalOptions','FacebarJSConstants'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('SearchTypeaheadRecorder'));i=h&&h.prototype;function j(k){'use strict';i.constructor.call(this,k);this.userText="";this.nullStateCandidates=null;this.singleStateCandidates=null;this.queryTimes={};this._sessionDisabled=false;this.type="facebar";this._maxQueryID=0;this._isQueryMatch=true;}j.prototype.initEvents=function(k){'use strict';k.getCore().subscribe('session',function(l,m){if(m===null){this.sessionEnd();}else this.sessionStart(m);}.bind(this));k.getCore().subscribe('select',function(l,m){this.recordSelectInfo(m);}.bind(this));k.getCore().subscribe('magSearch',function(l,m){this.recordMagSearch(m);}.bind(this));k.getCore().input.subscribe('shortcut',function(l,m){this.recordShortcut(m);}.bind(this));k.getCore().subscribe('quickSelectRedirect',function(l,m){this.recordQuickSelectInfo(m);}.bind(this));k.getView().subscribe('render',function(l,m){if(this.data._isInjectedSuggestionFlow)return;this.recordRender(m);if(this.allFromNullState){this.nullStateCandidates=this.buildListTypeaheadRecords();}else if(this.allFromSingleState)this.singleStateCandidates=this.buildListTypeaheadRecords();}.bind(this));k.getView().subscribe('show',function(l,m){if(!this.data.lastNullOrSingleStateFetchStartTime)return;this.recordStat('time_render_null_state',Date.now()-this.data.lastNullOrSingleStateFetchStartTime);this.data.lastNullOrSingleStateFetchStartTime=null;}.bind(this));k.getView().subscribe('logPerformanceTiming',function(l,m){this.performanceTimings[m.field]=m.value;}.bind(this));k.data.subscribe('query',function(l,m){if(!m.value.isEmpty())this.recordCountStat('num_queries');this.recordAvgStat('num_results_from_cache',m.results.length);this.queryTimes[m.queryId]={send:c('FacebarTimerUtils').getTimestamp()};}.bind(this));k.data.subscribe('sending_request',function(l,m){var n=m.data.value;if(!n)return;this.backendQueries.push(n);}.bind(this));k.subscribe('navigation',function(l,m){if(m&&m.structure){this.recordStat('navigation_input',JSON.stringify(m.structure.toStruct()));this.recordStat('navigation_text',m.structure.toString());}}.bind(this));k.data.subscribe('response_received',function(l,m,n){if(this.queryTimes[m.queryId]){var o=this.queryTimes[m.queryId];o.recv=c('FacebarTimerUtils').getTimestamp()-o.send;if(m&&m.payload)o.payload_size=JSON.stringify(m.payload).length;}}.bind(this));k.data.subscribe('remote_query_latency',function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.remoteQueryLatencies=m.latencies;}}.bind(this));k.data.subscribe('cache_query_latency',function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.cacheQueryLatencies=m.latencies;}}.bind(this));k.data.subscribe('backend_response',function(l,m){if(this.queryTimes[m.queryId]){var n=this.queryTimes[m.queryId];n.render=c('FacebarTimerUtils').getTimestamp()-n.send;if(m.payload.incomplete)n.incomplete=true;n.backendInfo=m.payload.info;if(this.core.scubaInfo)this.logToScuba(m,n,this.core.scubaInfo,m.inputQuery,this.type);}}.bind(this));k.getCore().subscribe('change',function(l,m){this.userInput(this.core.getText());}.bind(this));k.data.subscribe('remote_query_match',function(l,m){if(this._maxQueryID<m.queryId){this._maxQueryID=m.queryId;this._isQueryMatch=m.isMatch;}}.bind(this));c('Arbiter').subscribe('BrowseNUX/typing',this.disableThisSession.bind(this));c('Arbiter').subscribe('TestConsole/typing',this.disableThisSession.bind(this));k.subscribe('clear',function(){this.recordAppendStat('before_clear_queries',this.userText);}.bind(this));c('Event').listen(this.element,'keydown',function(event){this.recordStat('keypressed',1);this.recordCountStat('count_keys_pressed');if(c('Event').getKeyCode(event)==c('Keys').BACKSPACE){if(!this._backspacing){this._backspacing=true;this.recordAppendStat('before_backspace_queries',this.core.getText());}}else this._backspacing=false;}.bind(this));this.core.subscribe('open',function(l,m){if(m&&m.catchup)return;this.data.lastNullOrSingleStateFetchStartTime=Date.now();}.bind(this));this.core.subscribe('focusStartTime',function(l,m){this.data.lastNullOrSingleStateFetchStartTime=m.time;}.bind(this));this.data.subscribe('beforeQuery',function(l,m){if(!this.queryStartTime)this.queryStartTime=[];if(!this.query&&!this.data.lastNullOrSingleStateFetchStartTime)this.data.lastNullOrSingleStateFetchStartTime=Date.now();this.queryStartTime[this.query]=Date.now();}.bind(this));k.subscribe('filter',function(l,m){this._unsupportedGrammarInfo=this.buildUnsupportedGrammarInfo(m);}.bind(this));k.getCore().subscribe('recordFunction',function(l,m){this._extraRecorder.push(m);}.bind(this));this.data.subscribe('bootstrapped',function(l,m){this.recordStat('bootstrap_size',m.size||-1);}.bind(this));};j.prototype._reset=function(k){'use strict';this.stats={};this.avgStats={};this.appendStats={};this._backspacing=false;this.backendQueries=[];this._topreplace=false;this._inflightRequests={};};j.prototype.sessionStart=function(k){'use strict';this._sessionEnded=false;this.data.setQueryData({sid:k});this.recordStat('sid',k);if(!this.stats.session_start_time){this.recordStat('session_start_time',c('FacebarTimerUtils').getTimestamp());var l=new Date(),m=l.getTimezoneOffset(),n=Date.now()-m*60*1000;this.recordStat('session_start_time_user_timezone',n);}this.recordStat('keypressed',0);this.queryTimes={};};j.prototype.sessionEnd=function(){'use strict';if(this._sessionEnded||this._sessionDisabled){if(this._sessionDisabled){this.reset();this._sessionDisabled=false;this._sessionEnded=true;}return;}this._sessionEnded=true;var k='typed';if(this.allFromNullState){k='nullstate';}else if(this.allFromSingleState)k='singlestate';this.recordStat('last_state',k);this.recordStat('session_end_time',c('FacebarTimerUtils').getTimestamp());this.recordStat('grammar_version',this.data.getQueryData().grammar_version);this.submit();this.nullStateCandidates=null;this.singleStateCandidates=null;};j.prototype.disableThisSession=function(){'use strict';this._sessionDisabled=true;};j.prototype.userInput=function(k){'use strict';this.userText=k;};j.prototype.buildUnsupportedGrammarInfo=function(k){'use strict';var l=k.results?k.results[0]:null;if(!l||l.results_set_type!=='unimplemented')return null;return {unsupported_grammar:{category:l.error_info.category||'unknown',edge:l.error_info.blamed_edge}};};j.prototype.buildTypeaheadRecord=function(k,l){'use strict';var m=k.rankType||k.render_type||k.type,n=0,o=l;if(typeof k.groupIndex=='number'){n=k.groupIndex;o=k.indexInGroup;}var p={group_index:n,index_in_group:o,cost:k.cost,s_value:k.s_value||0,semantic:k.semantic,text:k.structure.toString(),cache_only:k.cacheOnlyResult?1:0,prefetched:k.isPrefetched?1:0,parse:k.parse,category:k.category,type:m,source:k.bootstrapped,grammar_results_type:(k.results_set_type||'').replace(/[\[\{](.*)[\]\}]/,'$1'),result_from_memcache:k.memcache,dynamic_cost:k.dynamic_cost,is_js_bootstrap_match:k.isJSBootstrapMatch,backend_cost:k.backendCost,bootstrap_cost:k.bootstrapCost,match_type:k.match_type,l_type:k.l_type,vertical_type:k.vertical_type,prefix_match:k.prefix_match,prefix_length:k.prefix_length,index_before_buckets:k.indexBeforeBuckets,bucket_lineage:k.bucketLineage,nullstate:k.isNullState,singlestate:k.isSingleState,query_id:k.qid,template_id:k.templateID,coeff_cost:typeof k.grammar_costs=='undefined'?-1:k.grammar_costs["{"+k.type+"}"],suggestion:k.isSuggestion,keyword_source:k.keywordSource,keyword_bootstrap_type:k.keywordBootstrapType,exact_match_suggestion:k.exactMatchKeyword?1:0,keyword_type:k.keywordType};if(k.logInfo)p.backend_log_info=k.logInfo;if(k.s_token)p.s_token=k.s_token;if(k.s_categories)p.s_categories=k.s_categories;return p;};j.prototype.buildListTypeaheadRecords=function(){'use strict';var k=[];this.results&&this.results.forEach(function(l,m){if(l.uid!=='search')k.push(this.buildTypeaheadRecord(l,m));}.bind(this));return k;};j.prototype.recordShortcut=function(k){'use strict';this.recordStat('shortcut',1);this.recordStat('shortcut_with_shift',k.shift);};j.prototype.recordStats=function(k,l){'use strict';for(var m in l)this.recordStat(k+'_'+m,l[m]);};j.prototype.getTypeaheadIndex=function(k,l){'use strict';var m=typeof k.groupIndex=='number'?k.groupIndex+1:0;return l-m;};j.prototype.recordQuickSelectInfo=function(k){'use strict';var l={input_query:k.input_query,semantic:k.semantic,type:k.type,position:k.position,with_mouse:k.with_mouse,text:k.text,quick_select:1};this.recordStats('selected',l);this.recordStat('quick_select',1);};j.prototype.recordMagSearch=function(k){'use strict';var l={};l.text=k.text;l.semantic=k.semantic;l.type=k.type;l.input_query=k.text;l.position=k.position;this.recordStats('selected',l);};j.prototype.recordSelectInfo=function(k){'use strict';var l=k.selected,m=this.getTypeaheadIndex(l,k.index),n={};if(l.uid=='search'){n.selected_search=1;}else{n=this.buildTypeaheadRecord(l);var o=n.type=='friend'?'user':n.type;n.position=m;n[o]=1;}n.with_mouse=k.clicked?1:0;n.quick_select=0;n.input_query=this.userText;n.input_fragments=JSON.stringify(this.core.currentQuery.toStruct());var p=l.dataGT?{gt:JSON.parse(l.dataGT)}:{},q={href:l.path};c('clickRefAction')('click',q,null,null,p);this.recordStats('selected',n);this.recordAppendStat('selection_history',{selected:n,candidate_results:this.buildListTypeaheadRecords(),timestamp:c('FacebarTimerUtils').getTimestamp()});var r={};this._extraRecorder.forEach(function(s){s(k,this.results,r);}.bind(this));this.recordStat('extra_select_info',JSON.stringify(r));this.recordStat('selected_with_mouse',k.clicked?1:0);};j.prototype._dataToSubmit=function(){'use strict';this.recordStat('max_results',this.data._maxResults);if(this.stats&&this.stats.selected_input_query){this.recordStat('input_query',this.stats.selected_input_query);}else this.recordStat('input_query',this.userText);this.recordStat('uri',new (c('URI'))(window.location.href).toString());if(!this.stats.shortcut){this.recordStat('shortcut',0);this.recordStat('shortcut_with_shift',false);}var k=this.stats;for(var l in this.avgStats){var m=this.avgStats[l];k[l]=m[0]/m[1];}var n={candidate_results:this.buildListTypeaheadRecords(),timestamp:c('FacebarTimerUtils').getTimestamp(),input_query:this.userText,remote_query_match:this._isQueryMatch};if(this._unsupportedGrammarInfo)Object.assign(n,this._unsupportedGrammarInfo);this.recordAppendStat('suggestions_at_end_of_session',n);if(this.nullStateCandidates)this.recordAppendStat('suggestions_at_nullstate_session',{candidate_results:this.nullStateCandidates});if(this.singleStateCandidates)this.recordAppendStat('suggestions_at_singlestate_session',{candidate_results:this.singleStateCandidates});this.recordAppendStat('query_times',this.queryTimes);if(this.backendQueries.length>0){if(this.backendQueries.length>this.data.logBackendQueriesWindow)this.backendQueries=this.backendQueries.slice(this.backendQueries.length-this.data.logBackendQueriesWindow);this.recordStat('backend_queries',this.backendQueries);}if(c('FacebarGlobalOptions').taSessionLoggingSample){var o=[];this.results.forEach(function(q){o.push([q.text||'',q.category||'',q.subtext||'']);});this.recordStat('raw_suggestions_text',o);}if(c('FacebarGlobalOptions').graphSearchV2){this.recordStat('experience_type','gsv2');}else this.recordStat('experience_type','facebar');for(var p in this.appendStats)k[p]=JSON.stringify(this.appendStats[p]);return k;};j.prototype.getDataToSubmit=function(){'use strict';return this._dataToSubmit();};j.prototype.reset=function(){'use strict';return this._reset();};j.prototype.submit=function(){'use strict';if(!this._sessionDisabled)i.submit.call(this);this.view.inform('feedback');this._reset();};Object.assign(j.prototype,{_sessionEnded:true,_extraRecorder:[],_banzaiRoute:'facebar'});f.exports=j;},null);
__d('FacebarTypeaheadV2',['csx','cx','CSS','DOM','Event','Parent'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={init:function(k){this._view=k.getView();this._root=c('Parent').bySelector(k.getElement(),"._585-");this._button=c('DOM').find(this._root,"._4w98");this._core=k.getCore();c('Event').listen(this._button,'click',this.buttonDownAndClick.bind(this));c('Event').listen(this._button,'mousedown',this.buttonDownAndClick.bind(this));c('Event').listen(this._button,'mouseup',this.buttonUp.bind(this));this._core.subscribe('open',this.showButton.bind(this));this._core.subscribe('close',this.hideButton.bind(this));},showButton:function(){c('CSS').addClass(this._button,"_4w97");},hideButton:function(){if(c('CSS').matchesSelector(this._button,"._4w97"))c('CSS').removeClass(this._button,"_4w97");},buttonDownAndClick:function(event){event.preventDefault();},buttonUp:function(){if(!this._core.isFocused){this._core.focusInput();}else{var k=-1;this._core.submitQuery(k);}}};f.exports=j;},null);
__d('FacebarTypeaheadGrammarItem.react',['cx','fbt','React','FacebarTypeaheadItem.react','FacebarTypeaheadToken.react','FacebarTypeaheadTokenText','joinClasses'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={user:i._("Person")},k=c('React').createClass({displayName:'FacebarTypeaheadGrammarItem',renderToken:function(){var l=this.props.result.decoration,m=this.props.result.ambiguity,n=m&&m.text,o=l&&l.entity||m&&m.entity;if(this.props.result.isRecent){var p=i._("Recent search");return (c('React').createElement(c('FacebarTypeaheadToken.react'),{text:[p],innerClass:"_53ab"}));}else if(n){return (c('React').createElement(c('FacebarTypeaheadToken.react'),{text:c('FacebarTypeaheadTokenText').text(n)}));}else if(o)return (c('React').createElement(c('FacebarTypeaheadToken.react'),{text:c('FacebarTypeaheadTokenText').textForEntity(o,j),limit:2,leadingMiddot:true}));},getClassName:function(){var l=this.props.result;if(l.isPeopleAndPagesSuggestion)return "_2enu";if(l.tags&&l.tags.displayedSeeMore)return "_10gs";return "_207";},render:function(){var l=this.renderToken(),m=l&&!l.props.leadingMiddot;return (c('React').createElement(c('FacebarTypeaheadItem.react'),babelHelpers['extends']({},this.props,{className:c('joinClasses')(this.props.className,this.getClassName()),valign:m,token:l})));}});f.exports=k;},null);
__d('FacebarTypeaheadKeywordItem.react',['cx','fbt','FacebarGlobalOptions','FacebarTypeaheadItem.react','FacebarTypeaheadToken.react','FacebarTypeaheadTokenText','React','joinClasses'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').createClass({displayName:'FacebarTypeaheadKeywordItem',render:function(){var k=[i._("Search")];if(this.props.result.isTrending){k.push(i._("Trending"));}else if(this.props.result.type=='related')k=[i._("Related search")];if(c('FacebarGlobalOptions').renderKeywordSnippets){var l=c('FacebarTypeaheadTokenText').textForEntity(this.props.result,{});if(l&&l.length)k=l;}var m=c('FacebarGlobalOptions').renderKeywordSnippets&&l!=null&&(l.length>1||this.props.result.boldedSubtext!=null),n=this.props.result.isSeeMore,o=n?null:c('React').createElement(c('FacebarTypeaheadToken.react'),{text:k,mainClass:(m?"_4jt7":'')+(m&&this.props.result.isSpecialIntent?' '+"_21z1":'')+(m&&this.props.result.isLocal?' '+"_2xfl":'')+(m&&this.props.result.isPersonSERP?' '+"_46_o":'')+(m&&this.props.result.isPhotos?' '+"_21z2":'')+(m&&this.props.result.isVideos?' '+"_21z4":'')+(m&&this.props.result.isSingleState&&this.props.result.exactMatchKeyword&&!this.props.result.isLocal?' '+"_21z5":''),innerClass:"_53ab"});return (c('React').createElement(c('FacebarTypeaheadItem.react'),babelHelpers['extends']({},this.props,{className:c('joinClasses')(this.props.className,(!c('FacebarGlobalOptions').renderKeywordSnippets?"_207":'')+(' '+"_5d77")),token:o,prefix:this.props.result.query_string.toLowerCase(),showSecondaryIcon:c('FacebarGlobalOptions').showKeywordSuggestionPhotos})));}});f.exports=j;},null);
__d('FacebarTypeaheadNodeItem.react',['React','ReactDOM','DOM','isElementNode'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'FacebarTypeaheadNodeItem',render:function(){var i=this.props.result.node;return (c('React').createElement('li',this.props,!c('isElementNode')(i)?i:null));},attachNode:function(i){var j=this.props.result.node;if(c('isElementNode')(j))c('DOM').setContent(i,j);},componentDidMount:function(){this.attachNode(c('ReactDOM').findDOMNode(this));},componentDidUpdate:function(i,j,k){this.attachNode(c('ReactDOM').findDOMNode(this));},shouldComponentUpdate:function(i){return this.props.result.node!==i.result.node;}});f.exports=h;},null);
__d('FacebarTypeaheadRecentItem.react',['cx','FacebarGlobalOptions','FacebarTypeaheadItem.react','Image.react','React','joinClasses'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'FacebarTypeaheadRecentItem',render:function(){return (c('React').createElement(c('FacebarTypeaheadItem.react'),babelHelpers['extends']({},this.props,{className:c('joinClasses')(this.props.className,!c('FacebarGlobalOptions').renderKeywordSnippets?"_207":''),icon:this.renderIcon(),recentSearchItem:true})));},renderIcon:function(){var j=this.props.result;if(!c('FacebarGlobalOptions').allowGrammar)return (c('React').createElement(c('Image.react'),{className:"_20h",src:j.photo}));var k=j.icon_class?c('React').createElement('span',{className:j.icon_class}):c('React').createElement(c('Image.react'),{className:"_20h",src:j.photo});return (c('React').createElement('span',{className:!c('FacebarGlobalOptions').renderKeywordSnippets||j.icon_class&&c('FacebarGlobalOptions').renderKeywordSnippets?"_k83":''},k));}});f.exports=i;},null);
__d('FacebarTypeaheadTrendingItem.react',['cx','FacebarTypeaheadItem.react','FacebarTypeaheadToken.react','React','joinClasses'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').createClass({displayName:'FacebarTypeaheadTrendingItem',render:function(){var j=this.props.result.articleTitle||'',k=c('React').createElement(c('FacebarTypeaheadToken.react'),{text:[j],innerClass:"_53ab",leadingMiddot:true});return (c('React').createElement(c('FacebarTypeaheadItem.react'),babelHelpers['extends']({},this.props,{className:c('joinClasses')(this.props.className,"_207"),token:k,valign:false})));}});f.exports=i;},null);
__d('FacebarTypeaheadList.react',['csx','cx','fbt','ARIA','CSS','FacebarGlobalOptions','FacebarJSConstants','FacebarTypeaheadEntityItem.react','FacebarTypeaheadGrammarItem.react','FacebarTypeaheadKeywordItem.react','FacebarTypeaheadNodeItem.react','FacebarTypeaheadRecentItem.react','FacebarTypeaheadTrendingItem.react','LoadingIndicator.react','React','ReactDOM','StaticContainer.react'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l={grammar:c('FacebarTypeaheadGrammarItem.react'),trending:c('FacebarTypeaheadTrendingItem.react'),related:c('FacebarTypeaheadKeywordItem.react')};l[c('FacebarJSConstants').browseTypes.keyword]=c('FacebarTypeaheadKeywordItem.react');l[c('FacebarJSConstants').keywordType]=c('FacebarTypeaheadKeywordItem.react');var m=c('React').createClass({displayName:'FacebarTypeaheadList',propTypes:{results:k.array,onRender:k.func,onSelect:k.func.isRequired,onHighlight:k.func.isRequired,isKeywordList:k.bool},getItemComponentConstructor:function(n,o){if(n.node)return c('FacebarTypeaheadNodeItem.react');if(n.isRecent)return c('FacebarTypeaheadRecentItem.react');if(n.results_set_type===c('FacebarJSConstants').browseTypes.keyword)return c('FacebarTypeaheadKeywordItem.react');if(n.type&&l[n.type])return l[n.type];return c('FacebarTypeaheadEntityItem.react');},renderItem:function(n,o){var p=this.getItemComponentConstructor(n),q;if(n.type===c('FacebarJSConstants').keywordType){q=n.query_string+n.semantic+n.boldedSubtext+n.subtext+n.fromCache+(n.isSeeMore?'see_more':'')+(n.keywordBootstrapType?n.keywordBootstrapType:'')+(n.uid!=null?n.uid:'')+n.isInvalidated;}else{q=n.semantic||n.uid||n.tuid;q=q+n.isNullState;if(c('FacebarGlobalOptions').facebarUpdateSnippets)q=q+n.category+n.subtext;}return (c('React').createElement(c('StaticContainer.react'),{key:q},c('React').createElement(p,{result:n,onClick:this.handleClick.bind(null,n),onMouseEnter:this.handleMouseEnter.bind(null,n)})));},renderFooter:function(){var n="_3su"+(!this.props.loading?' '+"hidden_elem":'');return (c('React').createElement('li',{className:n},c('React').createElement('div',{className:"_21f"},j._("Finding results"),c('React').createElement(c('LoadingIndicator.react'),{size:'medium',color:'white'}))));},componentDidMount:function(){var n=c('ReactDOM').findDOMNode(this);c('ARIA').owns(this.props.accessibilityElement,n);},hasValidRecentSearches:function(){if(!c('FacebarGlobalOptions').hasRecentSearchNullState||!this.props.results)return false;return this.props.results.some(function(n){return n.isRecent;});},render:function(){var n=this.props.results,o=[];if(n)n.forEach(function(p){o.push(this.renderItem(p));},this);return (c('React').createElement('div',null,c('React').createElement('ul',{id:'facebar_typeahead_view_list',className:"_21c"+(this.props.isKeywordList?' '+"_2yob":''),'data-click':'Search',onMouseLeave:this.handleMouseLeave,role:'listbox'},o,this.renderFooter())));},handleClick:function(n,o){if(c('CSS').matchesSelector(o.target,"._2d9t"))return;if(!o.nativeEvent.isMiddleClick()&&!o.nativeEvent.getModifiers().any){this.props.onSelect(n);o.preventDefault();}},handleMouseEnter:function(n){this.props.onHighlight(n);},handleMouseLeave:function(){if(c('FacebarGlobalOptions').facebarTypeaheadMouseoutHighlight)this.props.onClearHighlight();},componentDidUpdate:function(n,o,p){this.props.onRender();},shouldComponentUpdate:function(n){return this.props.loading!==n.loading||this.props.results!==n.results;}});f.exports=m;},null);
__d('FacebarTypeaheadView',['csx','cx','fbt','Arbiter','ContextualLayer','CSS','DOM','FacebarGlobalOptions','FacebarJSConstants','FacebarStructuredText','FacebarTypeaheadList.react','Link.react','Parent','React','ReactDOM','ScriptPath','Style','TypeaheadView','URI','performanceNow'],function a(b,c,d,e,f,g,h,i,j){var k,l;if(c.__markCompiled)c.__markCompiled();var m='unimplemented';k=babelHelpers.inherits(n,c('TypeaheadView'));l=k&&k.prototype;function n(o,p){'use strict';l.constructor.call(this,o,p);this.element=o;this.sid='';this.index=-1;this.warningShown=false;this.autoSelect=false;this.flipCount=0;this.loading=false;this.handleClearHighlight=this.handleClearHighlight.bind(this);this.handleHighlight=this.handleHighlight.bind(this);this.handleRender=this.handleRender.bind(this);this.handleSelect=this.handleSelect.bind(this);this.events=['highlight','render','filter','show'];}n.prototype.init=function(){'use strict';this.initializeElements();};n.prototype.initGSV2Elements=function(){'use strict';var o=this.element;this.contentKeyword=c('DOM').find(o,"._f7s");this.contentEntity=c('DOM').find(o,"._2pda");this.contentRecent=c('DOM').find(o,"._mn8");this.contentSuggestion=c('DOM').find(o,"._2pl-");this.contentAdminedPages=c('DOM').find(o,"._1e-s");this.contentSeeMore=c('DOM').find(o,"._3-xd");this.keywordResultsContainer=c('DOM').create('div');this.entityResultsContainer=c('DOM').create('div');this.recentSearchContainer=c('DOM').create('div');this.seeMoreContainer=c('DOM').create('div');this.results=[];this.keywordResults=[];this.entityResults=[];};n.prototype.initGSV2Construct=function(){'use strict';this.currentKeywordContainer=this.contentKeyword;this.currentEntityContainer=this.contentEntity;this.contentKeyword.appendChild(this.keywordResultsContainer);this.contentEntity.appendChild(this.entityResultsContainer);this.contentRecent.appendChild(this.recentSearchContainer);this.contentSeeMore.appendChild(this.seeMoreContainer);if(this.isNullState()){if(c('FacebarGlobalOptions').hasRecentOnTopNullState){this.resultsContainer.appendChild(this.contentRecent);this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentEntity);}else{this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentRecent);this.resultsContainer.appendChild(this.contentEntity);}return;}if(this.entityTop){this.resultsContainer.appendChild(this.contentEntity);this.resultsContainer.appendChild(this.contentKeyword);}else{this.resultsContainer.appendChild(this.contentKeyword);this.resultsContainer.appendChild(this.contentEntity);}if(!this.isNullState())this.resultsContainer.appendChild(this.contentSeeMore);};n.prototype.initializeElements=function(){'use strict';var o=this.element;this.isGSV2=c('FacebarGlobalOptions').graphSearchV2;this.dynamicRank=this.isGSV2;this.fixedBlendingOrder=c('FacebarGlobalOptions').blendingOrderKeywordFirst||c('FacebarGlobalOptions').blendingOrderEntityFirst;this.entityTop=c('FacebarGlobalOptions').blendingOrderEntityFirst&&!c('FacebarGlobalOptions').renderKeywordsFirst;this.content=c('DOM').find(o,"._21r");this.warningNode=c('DOM').find(o,"._553e");this.blockNotificationNode=c('DOM').find(o,"._2hh");this.resultsContainer=c('DOM').create('div');if(this.isGSV2)this.initGSV2Elements();};n.prototype.initializeList=function(){'use strict';this.renderTypeaheadList();this.content.appendChild(this.resultsContainer);if(this.isGSV2)this.initGSV2Construct();};n.prototype.initializeLayer=function(){'use strict';this.layer=new (c('ContextualLayer'))({context:c('Parent').bySelector(this.causalElement,"._585-"),position:'below',causalElement:this.causalElement},this.element);var o=this.layer.getContentRoot();this.root=c('DOM').find(o,"._50c9");c('CSS').addClass(o,"_5tlx");if(this.isGSV2)c('CSS').addClass(o,"_5xzd");this.wrapper=o;};n.prototype.setInputElement=function(o){'use strict';this.setAccessibilityControlElement(o);this.causalElement=o;this.initializeLayer();this.initializeList();};n.prototype.setAutoSelect=function(o){'use strict';this.autoSelect=o;if(this.index===-1&&o)this.first();};n.prototype.getIndexOf=function(o,p){'use strict';for(var q=0;q<p.length;q++)if(o.semantic===p[q].semantic&&o.isSeeMore===p[q].isSeeMore&&o.text===p[q].text)return q;return -1;};n.prototype.handleClearHighlight=function(){'use strict';this.highlight(-1,false);};n.prototype.handleHighlight=function(o){'use strict';this.highlight(this.getIndexOf(o,this.results),false);};n.prototype.handleSelect=function(o){'use strict';this.handleHighlight(o);this.select(true);};n.prototype.show=function(o){'use strict';if(!this.visible){this.inform('beforeShow',this.layer);c('Style').set(this.wrapper,'minWidth',o+'px');var p=l.show.call(this);this.first();this.layer.show();this.layer.updatePosition();this.inform('show');c('Arbiter').inform('layer_shown',{type:'FacebarTypeahead'});return p;}};n.prototype.hide=function(){'use strict';if(this.visible){this.layer.hide();l.hide.call(this);this.inform('hide');c('Arbiter').inform('layer_hidden',{type:'FacebarTypeahead'});this.flipCount=0;}return this;};n.prototype.select=function(o){'use strict';var p=this.results&&this.results[this.index];if(!p){this.inform('quickSelect');return;}var q=this.inform('beforeSelect',{index:this.index,selected:p});if(q!==false){c('ScriptPath').setClickPointInfo({click:'Search'});l.select.call(this,o);}};n.prototype.doesResultBelongToEntitySection=function(o){'use strict';switch(o.type){case c('FacebarJSConstants').keywordType:return false;case c('FacebarJSConstants').grammarType:return o.tags&&o.tags.displayedSeeMore;default:return true;}};n.prototype.processGSV2Results=function(o){'use strict';this.keywordResults=[];this.entityResults=[];var p=[],q=[],r=[],s=o.some(function(t){return t.isSingleState;});o.forEach(function(t){if(this.doesResultBelongToEntitySection(t)){this.entityResults.push(t);}else if(s){if(t.alternateSemantic){q.push(t);}else if(t.exactMatchKeyword){r.push(t);}else p.push(t);}else this.keywordResults.push(t);}.bind(this));if(s)this.keywordResults=r.concat(q.concat(p));if(this.entityTop)return this.entityResults.concat(this.keywordResults);return this.keywordResults.concat(this.entityResults);};n.prototype.reGenerateContainer=function(o){'use strict';var p=c('DOM').create('div');if(this.isNullState()){if(c('FacebarGlobalOptions').hasRecentOnTopNullState){p.appendChild(this.contentRecent);p.appendChild(this.currentKeywordContainer);p.appendChild(this.currentEntityContainer);}else{p.appendChild(this.currentKeywordContainer);p.appendChild(this.contentRecent);p.appendChild(this.currentEntityContainer);}return p;}if(this.entityTop){p.appendChild(this.currentEntityContainer);p.appendChild(this.currentKeywordContainer);}else{p.appendChild(this.currentKeywordContainer);p.appendChild(this.currentEntityContainer);}if(!this.isNullState()&&!o)p.appendChild(this.contentSeeMore);return p;};n.prototype.buildResultsNoRegeneration=function(o,p){'use strict';if(this.dynamicRank&&o.length>0&&!this.fixedBlendingOrder&&!c('FacebarGlobalOptions').renderKeywordsFirst&&this.flipCount<2){var q=o[0].type!==c('FacebarJSConstants').keywordType;if(c('FacebarGlobalOptions').hasFlipOnce&&this.value.toString()&&this.entityTop!=q)this.flipCount++;this.entityTop=q;}var r=String(this.value);o.forEach(function(u){u.query_string=r;});this.results=o;if(this.isGSV2){if(c('FacebarGlobalOptions').disableKeywords)o=o.filter(function(u){return u.semantic!=null&&u.semantic.match(/^[0-9]+$/)!=null;});this.results=this.processGSV2Results(o);if(this.seeMoreResult){var s=this.results.indexOf(this.seeMoreResult);if(s>-1)this.results.splice(s,1);this.seeMoreResult=null;}if(!this.isNullState()&&!p){this.seeMoreResult=this.inform('seeMore',{value:r,results:this.results});if(this.seeMoreResult){this.results.push(this.seeMoreResult);this.inform('afterSeeMore',{results:this.results});}}}var t=c('performanceNow')();this.renderTypeaheadList({results:this.results,loading:this.loading});this.inform('logPerformanceTiming',{field:'build_results_set_props_duration',value:c('performanceNow')()-t});};n.prototype.buildResults=function(o){'use strict';var p=o.some(function(q){return q.isSingleState;});this.buildResultsNoRegeneration(o,p);if(this.dynamicRank)this.resultsContainer=this.reGenerateContainer(p);return this.resultsContainer;};n.prototype.getGSV2Items=function(){'use strict';return l.getItems.call(this).filter(function(o){return !c('CSS').matchesSelector(o,"._3su");});};n.prototype.getItems=function(){'use strict';if(this.isGSV2)return this.getGSV2Items();return l.getItems.call(this).slice(0,-1);};n.prototype.handleRender=function(){'use strict';this.items=this.getItems();};n.prototype.render=function(o,p,q,r){'use strict';this.inform('filter',{results:p,value:o});var s=!o||o instanceof c('FacebarStructuredText')&&o.isEmptyOrWhitespace();c('CSS').conditionClass(this.wrapper,"_5qz2",!p.length&&s&&!this.getMegaphone());var t=p[0];if(r&&!s){if(!this.isGSV2)this.showWarning(j._("There are no results for '{query}'",[j.param('query',o.toString())]));}else if(t&&t.results_set_type===m){if(!t.error_info.suppress)this.showWarning(t.error_info.errorMessage||j._("This search isn't currently supported."));}else this.hideWarning();if(this.inform('removeUnimplementedGrammar')!==false)p=p.filter(function(u){return u.results_set_type!==m;}.bind(this));l.render.call(this,o,p,q);};n.prototype.reset=function(){'use strict';this.index=-1;this.items=[];this.results=[];this.value='';this.buildResults([]);this.inform('reset');return this;};n.prototype.resetIndex=function(){'use strict';this.index=-1;};n.prototype.getMegaphone=function(){'use strict';return c('DOM').scry(this.element,'.megaphone_location_gsv2_typeahead')[0];};n.prototype.showBlockNotification=function(o){'use strict';var p=new (c('URI'))('https://www.facebook.com').setPath('/settings').addQueryData('tab','blocking'),q=c('React').createElement('div',null,j._("You've blocked {fullName}. For more info on privacy and blocking, go to your {settings}.",[j.param('fullName',o),j.param('settings',c('React').createElement(c('Link.react'),{href:{url:p}},j._("settings")))]));c('CSS').show(this.blockNotificationNode);c('ReactDOM').render(q,this.blockNotificationNode);};n.prototype.hideBlockNotification=function(){'use strict';c('CSS').hide(this.blockNotificationNode);c('DOM').setContent(this.blockNotificationNode,'');};n.prototype.showWarning=function(o){'use strict';c('CSS').show(this.warningNode);c('DOM').setContent(this.warningNode,o);this.warningShown=true;this.highlight(-1,false);};n.prototype.hideWarning=function(){'use strict';c('CSS').hide(this.warningNode);this.warningShown=false;this.highlight(this.index,false);};n.prototype.setLoading=function(o){'use strict';if(this.loading!=o){this.loading=o;this.renderTypeaheadList({results:this.results,loading:o});}};n.prototype.first=function(){'use strict';this.index=this.autoSelect?0:-1;this.highlight(this.index);};n.prototype.prev=function(){'use strict';if(this.isGSV2){if(this.index<0||this.index===0&&this.autoSelect)this.index=this.items.length;}else if(this.index<=0)this.index=this.items.length;this.ignoreMouseover=true;l.prev.call(this);};n.prototype.next=function(){'use strict';if(this.isGSV2&&this.autoSelect&&this.index>=this.items.length-1)this.index=-1;if(!this.isGSV2&&this.index+1>=this.items.length)this.index=-1;this.ignoreMouseover=true;l.next.call(this);};n.prototype.highlight=function(o,p){'use strict';p=p!==false&&this.index!=o;if(!p||this.inform('beforeHighlight')!==false){var q=this.warningShown||!this.autoSelect?-1:0;l.highlight.call(this,Math.max(q,o),p);}};n.prototype.isNullState=function(){'use strict';return !String(this.value).trim();};n.prototype.updateCurrentKeywordContainer=function(){'use strict';var o=this.currentKeywordContainer;if(this.isNullState()){this.currentKeywordContainer=this.contentSuggestion;}else this.currentKeywordContainer=this.contentKeyword;if(o&&o!==this.currentKeywordContainer){c('CSS').hide(o);o.removeChild(this.keywordResultsContainer);this.currentKeywordContainer.appendChild(this.keywordResultsContainer);}};n.prototype.updateCurrentEntityContainer=function(){'use strict';var o=this.currentEntityContainer,p=!String(this.value).trim();if(p&&this.entityResults){this.currentEntityContainer=this.contentAdminedPages;}else this.currentEntityContainer=this.contentEntity;if(o&&o!=this.currentEntityContainer){c('CSS').hide(o);o.removeChild(this.entityResultsContainer);this.currentEntityContainer.appendChild(this.entityResultsContainer);}};n.prototype.hasValidRecentSearches=function(){'use strict';if(!c('FacebarGlobalOptions').hasRecentSearchNullState||!this.keywordResults)return false;return this.keywordResults.some(function(o){return o.isRecent;});};n.prototype.copyProps=function(o){'use strict';return babelHelpers['extends']({accessibilityElement:this.accessibilityElement,onClearHighlight:this.handleClearHighlight,onHighlight:this.handleHighlight,onRender:this.handleRender,onSelect:this.handleSelect},o);};n.prototype.renderList=function(o,p){'use strict';c('ReactDOM').render(c('React').createElement(c('FacebarTypeaheadList.react'),this.copyProps(o)),p);};n.prototype.renderGSV2TypeaheadList=function(o){'use strict';var p=this.copyProps(Object.assign({},o,{isKeywordList:true})),q=this.copyProps(o),r=this.copyProps(Object.assign({},o,{isKeywordList:true}));p.results=this.isNullState()?this.keywordResults.filter(function(u){return !u.isRecent;}):this.keywordResults;r.results=this.isNullState()?[]:this.results.filter(function(u){return u.isSeeMore;});q.results=this.entityResults;if(r.results.length>0||this.isNullState()){p.loading=false;q.loading=false;}else if(this.entityTop||q.results.length===0){q.loading=false;}else p.loading=false;var s=!!p.results.length;this.renderList(p,this.keywordResultsContainer);this.renderList(q,this.entityResultsContainer);var t=false;if(this.isNullState()){p.results=this.keywordResults.filter(function(u){return u.isRecent;});this.renderList(p,this.recentSearchContainer);t=!!p.results.length;}this.updateCurrentKeywordContainer();this.updateCurrentEntityContainer();this.renderList(r,this.seeMoreContainer);c('CSS').conditionShow(this.currentKeywordContainer,s);c('CSS').conditionShow(this.contentRecent,t);c('CSS').conditionShow(this.currentEntityContainer,!!this.entityResults.length);c('CSS').conditionShow(this.contentSeeMore,this.seeMoreResult!=null&&!this.isNullState());};n.prototype.renderTypeaheadList=function(o){'use strict';o=o||{};if(this.isGSV2){this.renderGSV2TypeaheadList(o);}else this.renderList(o,this.resultsContainer);};f.exports=n;},null);
__d('DismissNUXOnFocus',['Arbiter','NavigationMessage','Run','SubscriptionsHandler'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this.view=i.getCore().view;this.subscriptionsHandler=new (c('SubscriptionsHandler'))();}h.prototype.enable=function(){'use strict';this.subscriptionsHandler.addSubscriptions(c('Arbiter').subscribe(c('NavigationMessage').NAVIGATION_BEGIN,function(){this.disable();}.bind(this)));c('Run').onLeave(function(){this.disable();}.bind(this));this.setup();};h.prototype.disable=function(){'use strict';this.teardown();};h.prototype.setup=function(){'use strict';this.subscriptionsHandler.addSubscriptions(this.view.subscribe('show',this.onViewShow.bind(this)));};h.prototype.teardown=function(){'use strict';this.subscriptionsHandler.release();};h.prototype.onViewShow=function(){'use strict';c('Arbiter').inform('SearchAwareness.weakDismissUnit');};f.exports=h;},null);
__d('FacebarTypeaheadDecorateEntities',['arrayContains','emptyFunction'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(l){var m=[];l.forEach(function(n){if(n.isType('ent'))m.push(n.getUID());});return m;}function i(l,m){var n=null;l.structure.forEach(function(o){if(o.isType('ent')&&!c('arrayContains')(m,o.getUID()))n=o;});return n;}function j(l,m,n){l.forEach(function(o){var p=i(o,m);o.decoration={entity:p&&n.getEntryForFragment(p)};});}function k(l){'use strict';this._typeahead=l;}k.prototype.enable=function(){'use strict';this._typeahead.view.subscribe('filter',function(l,m){j(m.results,h(this._typeahead.core.getValue()),this._typeahead.data);}.bind(this));};Object.assign(k.prototype,{disable:c('emptyFunction')});f.exports=k;},null);
__d('FacebarTypeaheadDisambiguateResults',['FacebarDisambiguationDialog','FacebarStructuredFragment','FacebarStructuredText','URI','emptyFunction','getObjectValues'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(q,r){var s={};q.forEach(function(v){if(v.type=='grammar'){var w=r(v.structure).toLowerCase();s[w]=s[w]||[];s[w].push(v);}});var t=[];for(var u in s)if(s[u].length>1)t.push(s[u]);return t;}function i(q){var r=[];q.toArray().forEach(function(s,t){if(s.isType('ent'))r.push(t);});return r;}function j(q,r,s){var t={},u={},v={};r.forEach(function(x){var y=q[0].structure.getFragment(x),z=y.getHash();u[z]=u[z]||[];v[x]=u[z];q.forEach(function(aa){var ba=aa.structure.getFragment(x),ca=ba&&ba.getUID();if(ca&&!t.hasOwnProperty(ca)){u[z].push(s.getEntryForFragment(ba));t[ca]=true;}});});for(var w in v)if(v[w].length<=1)delete v[w];return v;}function k(q,r){var s={},t=[];q.forEach(function(u){var v=u.structure.getFragment(r).getUID();if(!s.hasOwnProperty(v)){s[v]=t.length;t.push([]);}t[s[v]].push(u);});return t;}function l(q,r,s){var t=q.shift();t.ambiguity.entities=r;s.push.apply(s,q);return t;}function m(q,r){var s=[],t=[],u=false;q.forEach(function(w){w.ambiguity={fragment:null,entities:null,text:null};});h(q,function(w){return w.getHash();}).forEach(function(w){var x=w[0].structure,y=i(x),z=j(w,y,r);if(u){l(w,z,s);return;}var aa=y.pop();if(typeof aa=='number'){var ba=k(w,aa);u=ba.length>1;if(u)delete z[aa];ba.forEach(function(ca){var da=l(ca,z,s);if(u){var ea=da.structure.getFragment(aa).getUID();da.ambiguity.entity=r.getEntry(ea);t.push(da);}});}});s.forEach(function(w){var x=q.indexOf(w);x!=-1&&q.splice(x,1);});h(q,function(w){return w.toString();}).forEach(function(w){w.forEach(function(x){if(!x.ambiguity.entities)x.ambiguity.text=x.queryTypeText;});});var v=q.indexOf(t[0]);t.slice(1).forEach(function(w){var x=q.indexOf(w);if(x!=-1&&x!=++v){q.splice(x,1);q.splice(v,0,w);}});}function n(q,r){var s=q&&q.ambiguity&&q.ambiguity.entities,t=s&&Object.keys(s).map(Number),u=r.core.input;if(!t||t.length===0)return false;var v=function(y){r.core.executeQuery(o(q,t,y));},w=function(){u.focus();u.input.moveSelectionToEnd();};s=s?c('getObjectValues')(s):[];var x=new (c('FacebarDisambiguationDialog'))(s,q.uri.getPath(),v,w,r.getCore().getSessionID());u.blur();x.show();return true;}function o(q,r,s){var t=q.structure.toArray(),u=new (c('URI'))(q.uri),v=u.getPath().split('/');r.forEach(function(w){var x=t[w],y=s.shift(),z=v.indexOf(String(x.getUID()));if(z!=-1)v[z]=y.uid;t[w]=new (c('FacebarStructuredFragment'))({uid:y.uid,text:y.text,type:'ent:'+y.type});});return {uri:u.setPath(v.join('/')),structure:new (c('FacebarStructuredText'))(t)};}function p(q){'use strict';this._typeahead=q;}p.prototype.enable=function(){'use strict';this._typeahead.view.subscribe('filter',function(q,r){m(r.results,this._typeahead.data);}.bind(this));this._typeahead.view.subscribe('beforeSelect',function(q,r){return !n(r.selected,this._typeahead);}.bind(this));};Object.assign(p.prototype,{disable:c('emptyFunction')});f.exports=p;},null);
__d('FacebarTypeaheadInjectedSuggestion',['csx','cx','fbt','Arbiter','DOM'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=3,l=0,m;function n(o){'use strict';this.core=o.getCore();this.$FacebarTypeaheadInjectedSuggestion1=this.core.view;}n.prototype.enable=function(){'use strict';c('Arbiter').subscribe('FacebarTypeahead.injectedSuggestion',function(){return this.addSuggestionTextToSearchBox();}.bind(this));c('Arbiter').subscribe('FacebarTypeahead.removeInjectedSuggestion',function(){return this.removeSuggestionTextToSearchBox();}.bind(this));c('Arbiter').subscribe('FacebarTypeahead.showSuggestionBadge',function(){return this.showSuggestionBadge(true);}.bind(this));c('Arbiter').subscribe('FacebarTypeahead.hideSuggestionBadge',function(){return this.showSuggestionBadge(false);}.bind(this));};n.prototype.disable=function(){'use strict';this.$FacebarTypeaheadInjectedSuggestion2.unsubscribe();};n.prototype.showSuggestionBadge=function(o){'use strict';var p=c('DOM').scry(this.core.getElement(),"._5861")[0];if(p){var q=p.getElementsByClassName('injectedSearchSuggestion')[0];if(!q)return;if(o){q.style.visibility='visible';}else q.style.visibility='hidden';}};n.prototype.removeSuggestionTextToSearchBox=function(){'use strict';if(!l)return;--l;if(!l){var o=c('DOM').scry(this.core.getElement(),"._5861")[0],p=o.getElementsByClassName('injectedSearchSuggestion')[0];o.removeChild(p);}else if(m){var q=j._({"suggestion":"{suggestionCount} new suggestion","suggestions":"{suggestionCount} new suggestions"},[j.param('suggestionCount',l),j['enum'](l===1?'suggestion':'suggestions',{suggestion:'suggestion',suggestions:'suggestions'})]);m.innerText=q;}};n.prototype.addSuggestionTextToSearchBox=function(){'use strict';if(l){if(m&&l<k)m.innerText=l+1+' new suggestions';}else{var o=c('DOM').scry(this.core.getElement(),"._5861")[0];if(o){m=document.createElement('DIV');var p=document.createTextNode('1 new suggestion');m.style.cssFloat='right';m.appendChild(p);var q=document.createElement('DIV');q.className="_586j injectedSearchSuggestion";q.appendChild(m);o.appendChild(q);}}l+=1;};f.exports=n;},null);
__d('FacebarTypeaheadNavigation',['Arbiter','FacebarNavigation','emptyFunction'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._core=i.core;this._preserveQuery=false;this._typeahead=i;}h.prototype.enable=function(){'use strict';c('FacebarNavigation').registerBehavior(this);this._core.subscribe('execute',this.executedUserQuery.bind(this));};h.prototype.executedUserQuery=function(i,j){'use strict';this._preserveQuery=true;};h.prototype.pageTransition=function(){'use strict';if(!this._preserveQuery){this._core.close();this._core.reset();}else this._preserveQuery=false;};h.prototype.setPageQuery=function(i){'use strict';i=this._core.setPageQuery(i);this._typeahead.inform('navigation',i,c('Arbiter').BEHAVIOR_PERSISTENT);};Object.assign(h.prototype,{disable:c('emptyFunction')});f.exports=h;},null);
__d('FacebarTypeaheadPrefixLengthOrderedCache',['emptyFunction','Arbiter'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._typeahead=i;}h.prototype.enable=function(){'use strict';this._typeahead.data.inform('setSortFunction',function(i,j){if((i.keyword_type==='local'||i.keyword_type==='local_category')&&(j.keyword_type==='local'||j.keyword_type==='local_category'))return 0;if(i.cache_id_length!==j.cache_id_length)return i.cache_id_length-j.cache_id_length;var k=(i.cost||0)-(j.cost||0);if(k!==0)return k;return (i.semantic||'').localeCompare(j.semantic||'');},c('Arbiter').BEHAVIOR_STATE);};Object.assign(h.prototype,{disable:c('emptyFunction')});f.exports=h;},null);
__d('FacebarTypeaheadQuickSelect',['FacebarStructuredText','URI'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='/search/web/direct_search.php';function i(j){'use strict';this._core=j.getCore();this._view=j.getView();this._input=this._core.input;this._beforeSelectListener=null;this._quickSelectListener=null;}i.prototype.enable=function(){'use strict';this._beforeSelectListener=this._view.subscribe('beforeSelect',this._quickSelect.bind(this));this._quickSelectListener=this._view.subscribe('quickSelect',this._quickSelect.bind(this));};i.prototype._quickSelect=function(j,k){'use strict';if(k&&k.selected)return true;var l=this._input.getValue().toArray(),m=new (c('FacebarStructuredText'))(l),n=m.toString();if(!n)return true;var o=new (c('URI'))(h).addQueryData('q',n),p={input_query:n,type:'quickselect',text:n,position:0,with_mouse:0,semantic:'quickselect('+o.toString()+')',extra_uri_params:{source:'quickselect',sid:this._core.getSessionID()},uri:o};this._core.inform('quickSelectRedirect',p);this._core.executeQuery(p);return false;};i.prototype.disable=function(){'use strict';this._beforeSelectListener&&this._view.unsubscribe(this._beforeSelectListener);this._quickSelectListener&&this._view.unsubscribe(this._quickSelectListener);};f.exports=i;},null);
__d('FacebarTypeaheadRecorderBasic',['FacebarTypeaheadRecorder'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._typeahead=i;}h.prototype.enable=function(){'use strict';var i=this._typeahead;this._recorder=new (c('FacebarTypeaheadRecorder'))(i);};h.prototype.disable=function(){'use strict';this._typeahead.unsubscribe(this._subscription);this._recorder=null;this._subscription=null;};Object.assign(h.prototype,{_subscription:null});f.exports=h;},null);
__d('FacebarTypeaheadSeeMore',['cx','fbt','FacebarGSv2Echo','FacebarKeywordSearchUtils','FacebarStructuredText'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();function j(k){'use strict';this.$FacebarTypeaheadSeeMore1=k.getCore();this.$FacebarTypeaheadSeeMore2=this.$FacebarTypeaheadSeeMore1.view;}j.prototype.enable=function(){'use strict';this.$FacebarTypeaheadSeeMore3=this.$FacebarTypeaheadSeeMore2.subscribe('seeMore',this.$FacebarTypeaheadSeeMore4.bind(this));};j.prototype.disable=function(){'use strict';this.$FacebarTypeaheadSeeMore3.unsubscribe();};j.prototype.$FacebarTypeaheadSeeMore4=function(k,l){'use strict';var m=l.value.toString().trim();m=c('FacebarGSv2Echo').normalizeValue(m);var n=c('FacebarKeywordSearchUtils').makeFacebarEntry(m),o=i._("See all results for \"{query}\"",[i.param('query',m)]);return babelHelpers['extends']({},n,{query_string:m,icon_class:"_5b1w",isSeeMore:true,structure:c('FacebarStructuredText').fromString(m),displayStructure:c('FacebarStructuredText').fromString(String(o)),uri:n.uri,tags:{},isSingleState:this.$FacebarTypeaheadSeeMore1.data.getSingleState()});};f.exports=j;},null);
__d('FacebarTypeaheadSelectAll',['requestAnimationFrame'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._core=i.getCore();this._listener=null;}h.prototype.enable=function(){'use strict';var i=this._core.input;this._listener=this._core.subscribe('focus',function(j,k){var l=k&&k.catchup;l||c('requestAnimationFrame')(function(){i.selectInput();});});};h.prototype.disable=function(){'use strict';this._listener&&this._core.unsubscribe(this._listener);};f.exports=h;},null);
__d('FacebarTypeaheadShortcut',['FacebarTypeaheadShortcutConfig','KeyEventController','Run','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._input=i.core.input;this._view=i.view;this._listener=null;}h.prototype.enable=function(){'use strict';this._registerListener();};h.prototype.disable=function(){'use strict';};h.prototype._registerListener=function(){'use strict';this._listener&&this._listener.remove();this._listener=c('KeyEventController').registerKey('SLASH',this._handleKeydown.bind(this));c('Run').onLeave(function(){c('setTimeoutAcrossTransitions')(this._registerListener.bind(this),0);}.bind(this));};h.prototype._handleKeydown=function(i){'use strict';var j=i.getModifiers().shift;if(j&&!c('FacebarTypeaheadShortcutConfig').gkWebShortcut)return;this._selectInput(j);return false;};h.prototype._selectInput=function(i){'use strict';this._view.setAutoSelect(true);this._input.focus();this._input.selectInput();this._input.inform('shortcut',{shift:i});};f.exports=h;},null);
__d('FacebarTypeaheadSizeAdjuster',['getElementChildren','clamp','emptyFunction','isTextNode','Style','Vector'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=12,i=20,j=50,k=200,l=5;function m(o){if(c('isTextNode')(o))return 0;return c('Vector').getElementDimensions(o).x;}function n(o){'use strict';this._core=o.getCore();this._view=this._core.view;this._input=this._core.input;this._cachedSizes={};this._appliedSize=null;this._defaultSize=this.getDefaultFontSize();this._calculatedSize=this._defaultSize;this._containerWidth=this.getContainerWidth();}n.prototype.enable=function(){'use strict';this._input.subscribe('change',this.adjustFontSize.bind(this));this.adjustFontSize();};n.prototype.getContainerWidth=function(){'use strict';return c('Vector').getElementDimensions(this._input.getElement()).x;};n.prototype.getDefaultFontSize=function(){'use strict';var o=c('Style').get(this._input.getElement(),'font-size'),p=/^([\d\.]+)px$/.exec(o),q=p&&Number(p[1]);return Math.max(h,Math.min(i,q));};n.prototype.calculateFontSize=function(){'use strict';var o=this.getTextWidth(),p=this._calculatedSize;if(o>this._containerWidth-j){p--;}else if(o<this._containerWidth-k)p++;this._calculatedSize=c('clamp')(p,h,this._defaultSize);return this._calculatedSize;};n.prototype.getTextWidth=function(){'use strict';var o=this._calculatedSize+this.getValueKey();if(!this._cachedSizes.hasOwnProperty(o))this._cachedSizes[o]=this.measureTextWidth();return this._cachedSizes[o];};n.prototype.getValueKey=function(){'use strict';var o=this._core.getValue().getHash(),p=l*Math.floor(o.length/l);return o.substr(0,p);};n.prototype.measureTextWidth=function(){'use strict';var o=c('getElementChildren')(this._input.getRawInputElement());return o.reduce(function(p,q){return p+m(q);},0);};n.prototype.adjustFontSize=function(){'use strict';for(var o=0;o<10;o++){var p=this.calculateFontSize();if(p!=this._appliedSize){this._appliedSize=p;c('Style').set(this._input.getElement(),'font-size',p+'px');c('Style').set(this._view.content,'font-size',p+'px');}else break;}};Object.assign(n.prototype,{disable:c('emptyFunction')});f.exports=n;},null);
__d('FacebarTypeaheadStickyFilters',['Arbiter','NavigationMessage','Run','SubscriptionsHandler','enumerate','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=false,i=5000,j='/search/top';function k(l){'use strict';this.core=l.getCore();this.filters={};this.subscriptionsHandler=new (c('SubscriptionsHandler'))();this.view=this.core.view;}k.prototype.enable=function(){'use strict';this.subscriptionsHandler.addSubscriptions(c('Arbiter').subscribe('SearchLHCFilters.initStickyFilters',function(l,m){for(var n=c('enumerate')(this.filters),o=Array.isArray(n),p=0,n=o?n:n[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var q;if(o){if(p>=n.length)break;q=n[p++];}else{p=n.next();if(p.done)break;q=p.value;}var r=q,s=r[0],t=r[1];if(!(s in m))t.active=false;}for(var u=c('enumerate')(m),v=Array.isArray(u),w=0,u=v?u:u[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var x;if(v){if(w>=u.length)break;x=u[w++];}else{w=u.next();if(w.done)break;x=w.value;}var y=x,z=y[0],aa=y[1],ba={value:aa,active:true};this.filters[z]=ba;}}.bind(this)),c('Arbiter').subscribe(c('NavigationMessage').NAVIGATION_BEGIN,function(event,l){this.resetFiltersIfNotSearching();}.bind(this)),this.view.subscribe('filter',this.handleFilter.bind(this)),this.core.subscribe('magSearch',this.handleSearch.bind(this)),this.view.subscribe('afterSeeMore',this.handleSeeMore.bind(this)));c('Run').onLeave(function(){this.resetFiltersIfNotSearching();}.bind(this));};k.prototype.disable=function(){'use strict';this.teardown();};k.prototype.teardown=function(){'use strict';this.subscriptionsHandler.release();};k.prototype.handleFilter=function(l,m){'use strict';var n=m.results.filter(function(o){return !o.isNullState&&!o.isTrending;});this.updateResultData(n);};k.prototype.handleSearch=function(l,m){'use strict';this.updateResultData([m]);};k.prototype.handleSeeMore=function(l,m){'use strict';var n=m.results.filter(function(o){return o.isSeeMore;});this.updateResultData(n);};k.prototype.resetFiltersIfNotSearching=function(){'use strict';if(h)return;h=true;c('setTimeoutAcrossTransitions')(function(){var l=window.location.pathname;if(l.indexOf(j)===-1)for(var m=c('enumerate')(this.filters),n=Array.isArray(m),o=0,m=n?m:m[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var p;if(n){if(o>=m.length)break;p=m[o++];}else{o=m.next();if(o.done)break;p=o.value;}var q=p,r=q[1];r.active=false;}h=false;c('Run').onLeave(function(){this.resetFiltersIfNotSearching();}.bind(this));}.bind(this),i);};k.prototype.updateResultData=function(l){'use strict';for(var m=0;m<l.length;m++){var n=l[m];if(n.type==='keyword'){var o=n.uri.getQueryData();for(var p=c('enumerate')(this.filters),q=Array.isArray(p),r=0,p=q?p:p[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var s;if(q){if(r>=p.length)break;s=p[r++];}else{r=p.next();if(r.done)break;s=r.value;}var t=s,u=t[0],v=t[1];if(v.active){o[u]=v.value;}else n.uri.removeQueryData(u);}}}};f.exports=k;},null);
__d('SearchAwarenessLearningNUX',['csx','cx','Arbiter','CSS','DOM','NavigationMessage','Run','SearchAwarenessDispatcher','SearchAwarenessWebConfig','SearchPivotType','SubscriptionsHandler'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();function j(k){'use strict';this.core=k.getCore();this.view=this.core.view;this.data=this.core.data;this.debug=false;this.subscriptionsHandler=new (c('SubscriptionsHandler'))();this.showingFirstStep=true;this.setupComplete=false;this.setupSecondStepComplete=false;}j.prototype.enable=function(){'use strict';var k=this.core.getValue()!=null?this.core.getValue().toString():null;if(k==null||k.length>0&&!this.data.getSingleState())return;this.subscriptionsHandler.addSubscriptions(c('Arbiter').subscribe('SearchAwareness.triggerLearningNUX',function(l,m){if(m.origin===c('SearchPivotType').LEARNING_NUX||m.origin===c('SearchPivotType').LEARNING_NUX_STANDALONE){this.setup();}else this.setupSecondStep();}.bind(this)),c('Arbiter').subscribe(c('NavigationMessage').NAVIGATION_BEGIN,function(){this.disable();}.bind(this)));c('Run').onLeave(function(){this.disable();}.bind(this));this.setup();};j.prototype.disable=function(){'use strict';this.teardown();};j.prototype.setup=function(){'use strict';if(this.setupComplete)return;var k=this.getHiddenAwarenessUnit(c('SearchPivotType').LEARNING_NUX);if(k==null)k=this.getHiddenAwarenessUnit(c('SearchPivotType').LEARNING_NUX_STANDALONE);var l=this.core.getValue()!=null?this.core.getValue().toString():null;if(k==null||l==null||l.length>0&&!this.data.getSingleState())return;this.config=JSON.parse(k.getAttribute('data-config'));if(this.config.ghost_text!=null){var m=c('DOM').scry(document.body,"._586i")[0];if(m){c('CSS').addClass(m,"_55me");m.setAttribute('data-ghost-text',this.config.ghost_text);}}this.firstStep=c('DOM').create('div',{'class':"_1qs6"},k);c('DOM').prependContent(this.view.getElement(),this.firstStep);this.subscriptionsHandler.addSubscriptions(this.view.subscribe('show',this.onViewShow.bind(this)),this.view.subscribe('hide',this.onViewHide.bind(this)),this.view.subscribe('filter',this.onViewFilter.bind(this)),this.view.subscribe('beforeSelect',this.onViewBeforeSelect.bind(this)),this.core.subscribe('magSearch',this.onCoreMagSearch.bind(this)));if(this.view.visible)this.onViewShow();this.mask=c('DOM').create('div',{className:"_3lif"});c('DOM').appendContent(document.body,this.mask);this.showSecondStepAwarenessUnit();this.activationWindowTimer=setTimeout(function(){this.disable();}.bind(this),this.config.activation_window);this.setupComplete=true;};j.prototype.teardown=function(){'use strict';if(this.mask)c('CSS').removeClass(this.mask,"_3lih");c('CSS').removeClass(this.view.getElement(),"_3lii");c('CSS').removeClass(this.view.getElement(),"_1qs7");c('CSS').removeClass(this.view.getElement(),"_55mf");c('CSS').removeClass(this.view.getElement(),"_55mg");c('CSS').removeClass(this.core.getElement(),"_55mh");if(this.debug)return;if(this.mask){c('DOM').remove(this.mask);this.mask=null;}if(this.firstStep){c('DOM').remove(this.firstStep);this.firstStep=null;}if(this.secondStep){c('DOM').remove(this.secondStep);this.secondStep=null;}this.subscriptionsHandler.release();};j.prototype.setupSecondStep=function(){'use strict';if(this.setupSecondStepComplete||!this.setupComplete)return;var k=this.getHiddenAwarenessUnit(c('SearchPivotType').LEARNING_NUX_SECOND_STEP);if(k==null){this.setupSecondStepComplete=true;return;}this.secondStep=c('DOM').create('div',{className:"_3lig"},k);c('DOM').prependContent(this.view.getElement(),this.secondStep);this.setupSecondStepComplete=true;};j.prototype.getHiddenAwarenessUnit=function(k){'use strict';var l=c('DOM').scry(document.body,"._3lik"),m=void 0;for(var n=l,o=Array.isArray(n),p=0,n=o?n:n[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var q;if(o){if(p>=n.length)break;q=n[p++];}else{p=n.next();if(p.done)break;q=p.value;}var r=q,s=r.getAttribute('data-origin');if(s===k&&r.firstChild!=null)m=r;}if(m==null)return undefined;var t=m.firstChild;c('DOM').remove(m);return t;};j.prototype.onViewShow=function(){'use strict';this.showOrHideFirstStep();clearTimeout(this.activationWindowTimer);var k=c('DOM').scry(document.body,"._18vg")[0];if(k==null)c('CSS').addClass(this.mask,"_3lih");c('CSS').addClass(this.view.getElement(),"_3lii");};j.prototype.onViewHide=function(){'use strict';this.disable();};j.prototype.onViewFilter=function(k,l){'use strict';this.showOrHideFirstStep();var m=0;for(var n=0;n<l.results.length;n++){var o=l.results[n];if(o.type==='keyword'){m++;this.updateResultQuery(o);}else o.unselectable=true;}var p=this.core.getValue()!=null?this.core.getValue().toString():null,q=p!=null&&p.length>0&&p.length<3&&m<3;c('CSS').conditionClass(this.core.getElement(),"_55mh",q);if((this.config.block_ta_entity_clicks==null||this.config.block_ta_entity_clicks===false)&&p!=null&&p.length>=1)c('CSS').addClass(this.view.getElement(),"_55mf");};j.prototype.onViewBeforeSelect=function(k,l){'use strict';if(this.blockedClick||this.config.block_ta_entity_clicks!==true)return true;if(l.selected.type!=='keyword'){this.blockedClick=true;c('CSS').addClass(this.view.getElement(),"_55mf");c('CSS').addClass(this.view.getElement(),"_55mg");setTimeout(function(){c('CSS').removeClass(this.view.getElement(),"_55mg");}.bind(this),5000);return false;}return true;};j.prototype.showSecondStepAwarenessUnit=function(){'use strict';c('SearchAwarenessDispatcher').triggerLearningNUX(c('SearchPivotType').LEARNING_NUX_SECOND_STEP,this.config.encoded_query,this.config.actor_id,this.config.story_id,this.config.global_share_id);};j.prototype.showOrHideFirstStep=function(){'use strict';c('CSS').conditionClass(this.view.getElement(),"_1qs7",this.core.isNullState()||this.data.getSingleState());};j.prototype.onCoreMagSearch=function(k,l){'use strict';this.updateResultQuery(l);};j.prototype.updateResultQuery=function(k){'use strict';var l=k.uri.getQueryData();l[c('SearchAwarenessWebConfig').url_param_nux_trigger_key]=this.config.aw_id;k.uri.setQueryData(l);};f.exports=j;},null);
__d('SearchAwarenessSERPSurvey',['Arbiter','SearchAwarenessWebConfig','SubscriptionsHandler'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this.core=i.getCore();this.view=this.core.view;this.subscriptionsHandler=new (c('SubscriptionsHandler'))();}h.prototype.enable=function(){'use strict';this.subscriptionsHandler.addSubscriptions(c('Arbiter').subscribe('SearchAwareness.setupSurveyTriggers',function(i,j){this.urlParamvalue=j.url_param_value;}.bind(this)),this.view.subscribe('hide',this.onViewHide.bind(this)),this.view.subscribe('filter',this.onViewFilter.bind(this)),this.core.subscribe('magSearch',this.onCoreMagSearch.bind(this)));};h.prototype.disable=function(){'use strict';this.teardown();};h.prototype.teardown=function(){'use strict';this.subscriptionsHandler.release();};h.prototype.onViewHide=function(){'use strict';if(this.urlParamvalue!=null)this.disable();};h.prototype.onViewFilter=function(i,j){'use strict';if(this.urlParamvalue==null)return;for(var k=0;k<j.results.length;k++){var l=j.results[k];if(l.type==='keyword')this.updateResultQuery(l);}};h.prototype.onCoreMagSearch=function(i,j){'use strict';this.updateResultQuery(j);};h.prototype.updateResultQuery=function(i){'use strict';var j=i.uri.getQueryData();j[c('SearchAwarenessWebConfig').url_param_survey_trigger_key]=this.urlParamvalue;i.uri.setQueryData(j);};f.exports=h;},null);
__d('TypeaheadSearchMegaphone',['AsyncRequest','DOM','DOMQuery','Event','Parent'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this.$TypeaheadSearchMegaphone1=i;}h.prototype.enable=function(){'use strict';var i=c('DOMQuery').scry(this.$TypeaheadSearchMegaphone1.getView().getElement(),'.megaphone_location_gsv2_typeahead')[0];if(!i)return;this.ajaxify=c('DOMQuery').scry(i,'a.megaphone_hide_link[ajaxify]')[0].getAttribute('ajaxify');c('DOMQuery').scry(i,'a').forEach(this.processLink,this);c('Event').listen(i,'click',this.onClick.bind(this));};h.prototype.disable=function(){'use strict';};h.prototype.processLink=function(i){'use strict';if(i.getAttribute('ajaxify'))return;c('DOM').setAttributes(i,{target:'_blank'});};h.prototype.onClick=function(event){'use strict';var i=c('Parent').byTag(event.target,'a');if(!i||i.getAttribute('ajaxify'))return;c('AsyncRequest').bootstrap(this.ajaxify,i);};f.exports=h;},null);