/*!CK:424952478!*//*1459133985,*/

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

__d("PhotoWarningScreenConfig",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={GraphicEvents:{GRAPHIC_PHOTO_SHOWN_NO_WARNING:"GRAPHIC_PHOTO_SHOWN_NO_WARNING",GRAPHIC_PHOTO_SHOWN_WITH_WARNING:"GRAPHIC_PHOTO_SHOWN_WITH_WARNING",GRAPHIC_PHOTO_WARNING_DISMISSED:"GRAPHIC_PHOTO_WARNING_DISMISSED"},ObjectionableEvents:{INVALIDATE_CONTENT:"invalidate_content",SHOW_WARNING_SCREEN:"show_warning_screen",WARNING_SCREEN_DISMISSED:"warning_screen_dismissed",WARNING_SCREEN_REENABLED:"warning_screen_reenabled",MARK_OBJECTIONABLE:"mark_objectionable",UNDO_MARK_OBJECTIONABLE:"undo_mark_objectionable"},Types:{GRAPHIC:"graphic",OBJECTIONABLE:"objectionable"}};},null);
__d("SpotlightViewerLoggingEvents",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={LOADED:"loaded",LOADING:"loading",ERROR:"error",ABORT:"abort",OPEN_BEGIN:"open_begin",OPEN_COMPLETE:"open_complete",CLOSE_BEGIN:"close_begin",CLOSE_COMPLETE:"close_complete",PAGE_BEGIN:"page_begin",PAGE_COMPLETE:"page_complete",PHOTO_CHANGE_BEGIN:"photo_change_begin",PHOTO_CHANGE_COMPLETE:"photo_change_complete",DATA_FETCH_BEGIN:"data_fetch_begin",DATA_FETCH_COMPLETE:"data_fetch_complete",PHOTO_FETCH:"photo_fetch"};},null);
__d('ImageUtils',['UserAgent_DEPRECATED'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={hasLoaded:function(i){if(i.naturalWidth!==undefined){return i.complete&&i.width!==0;}else if(i.height==20&&i.width==20&&i.complete){return false;}else if(i.complete===undefined&&c('UserAgent_DEPRECATED').webkit()<500){var j=new Image();j.src=i.src;return j.complete;}return i.complete;}};f.exports=h;},null);
__d('PhotoEverstoreLogger',['Event','AsyncRequest','ImageUtils'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={BATCH_WINDOW_MS:500,storedLog:[]};function i(){}Object.assign(i,{_log:function(k){h.storedLog.push(k);if(h.storedLog.length==1)setTimeout(j,h.BATCH_WINDOW_MS);},logImmediately:function(k){i._log(k);},registerForLogging:function(k){var l=document.getElementById(k);if(l!=null)if(c('ImageUtils').hasLoaded(l)){i._log(l.src);}else c('Event').listen(l,'load',function(event){i._log(l.src);});}});function j(){var k=h.storedLog;h.storedLog=[];var l=JSON.stringify(k);new (c('AsyncRequest'))().setURI('/ajax/photos/logging/everstore_logging.php').setData({loggedUrls:l}).setMethod('POST').setOption('suppressErrorHandlerWarning',true).setOption('suppressErrorAlerts',true).send();}f.exports=i;},null);
__d('PhotoViewerImage',['PhotoEverstoreLogger','URI','Vector'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this._hiResDimensions=i.hiResDimensions&&c('Vector').deserialize(i.hiResDimensions);this._normalDimensions=i.normalDimensions&&c('Vector').deserialize(i.normalDimensions);this._info=i.info;this._video=i.video;this._shouldLog=i.everstoreLogThis;this._hiResSrc=i.hiResSrc;this._normalSrc=i.normalSrc;this._thumbSrc=i.thumbSrc;this._isInverted=false;this._data=i;}h.prototype.getURIString=function(){'use strict';return new (c('URI'))(this._info.permalink).getUnqualifiedURI().toString();};h.prototype.hasHiResDimensions=function(){'use strict';return !!this._hiResDimensions;};h.prototype.getHiResDimensions=function(){'use strict';return this._hiResDimensions;};h.prototype.getNormalDimensions=function(){'use strict';return this._normalDimensions;};h.prototype.getHiResSrc=function(){'use strict';return this._hiResSrc;};h.prototype.getNormalSrc=function(){'use strict';return this._normalSrc;};h.prototype.getThumbSrc=function(){'use strict';return this._thumbSrc;};h.prototype.getInfo=function(){'use strict';return this._info;};h.prototype.getPermalink=function(){'use strict';return this._info.permalink;};h.prototype.getHighestResSrc=function(){'use strict';return this._hiResSrc||this._normalSrc;};h.prototype.preload=function(i){'use strict';var j;if(this.getHighestResSrc())if(i&&!this._resource){this._resource=new Image();this._resource.src=this.getHighestResSrc();j=this._resource.src;if(this._shouldLog)c('PhotoEverstoreLogger').logImmediately(this._resource.src);}else if(!i&&!this._small){this._small=new Image();this._small.src=this._normalSrc||this._hiResSrc;j=this._small.src;if(this._shouldLog)c('PhotoEverstoreLogger').logImmediately(this._small.src);}return j;};h.prototype.setNormalDimensions=function(i,j){'use strict';this._normalDimensions=new (c('Vector'))(i,j);};h.prototype.setHiResDimensions=function(i,j){'use strict';this._hiResDimensions=new (c('Vector'))(i,j);};h.prototype.invertDimensions=function(){'use strict';if(this.hasHiResDimensions())this._hiResDimensions=new (c('Vector'))(this._hiResDimensions.y,this._hiResDimensions.x);this._normalDimensions=new (c('Vector'))(this._normalDimensions.y,this._normalDimensions.x);this._isInverted=!this._isInverted;};h.prototype.copy=function(){'use strict';return new h(this._data);};f.exports=h;},null);
__d('PhotosConst',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={VIEWER_PERMALINK:0,VIEWER_SNOWLIFT:6,VIEWER_VAULTBOX:8,VIEWER_SNOWFLAKE:14,VIEWER_COMPOSER:16,VIEWER_CAROUSEL:19,VIEWER_PERMALINK_STRING:'permalink',VIEWER_SNOWLIFT_STRING:'snowlift',VIEWER_VAULTBOX_STRING:'vaultbox',VIEWER_CAROUSEL_STRING:'carousel',BULK_EDITOR:3,BULK_EDITOR_REACT:15,EDITOR_MODAL:17,FLASH_UPLOADER:4,HTML5_UPLOADER:10,SIZE_NORMAL:'n',PIC_NORMAL_FBX_SIZE:180,ALBUM_NAME_MAXLEN:65};f.exports=h;},null);
__d('PhotoStreamCache',['DOM','HTML','PhotoEverstoreLogger','PhotosConst','PhotoViewerImage','Rect','UIPagelet','URI','Vector','ge'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){'use strict';}h.prototype.init=function(i,j,k,l,m){'use strict';this.version=i;this.pageletName=j;this.pageletRootID=k;this.tagSuggestionMode=m;this.bufferSize=h.BUFFER_SIZE;this.fullBucketSize=h.FULL_BUCKET_SIZE;this.initError=false;this.isActive=true;this.usesOpaqueCursor=false;this.usesNonCircularPhotoSet=false;this.reachedLeftEnd=false;this.reachedRightEnd=false;this.leftLock=false;this.rightLock=false;this.useAjaxPipe=true;this.logger=l;this.viewAsUser=null;this.reset();};h.prototype.setViewAs=function(i){'use strict';this.viewAsUser=i;};h.prototype.isInViewAsMode=function(){'use strict';return !!this.viewAsUser;};h.prototype.getViewAsUserId=function(){'use strict';return this.viewAsUser;};h.prototype.getUsesOpaqueCursor=function(){'use strict';return this.usesOpaqueCursor;};h.prototype.isNonCircularPhotoSet=function(){'use strict';return this.usesNonCircularPhotoSet;};h.prototype.setReachedLeftEnd=function(){'use strict';this.reachedLeftEnd=true;};h.prototype.setReachedRightEnd=function(){'use strict';this.reachedRightEnd=true;};h.prototype.hasReachedLeftEnd=function(){'use strict';return this.reachedLeftEnd;};h.prototype.hasReachedRightEnd=function(){'use strict';return this.reachedRightEnd;};h.prototype.nonCircularPhotoSetCanPage=function(i){'use strict';if(!this.isNonCircularPhotoSet())return true;if(i<0)return this.getCursorPos()||!this.hasReachedLeftEnd();if(i>0)return this.getLength()-1!=this.getCursorPos()||!this.hasReachedRightEnd();return true;};h.prototype.setUseAjaxPipe=function(i){'use strict';this.useAjaxPipe=i;};h.prototype.reset=function(){'use strict';this.cache={image:{},extra:{},html:{}};this.fbidList=[];this.loaded=false;this.allLoaded=false;this.permalinkMap={};this.position=0;this.totalCount=null;this.firstCursor=null;this.firstCursorIndex=null;this.firstOpaqueCursor=null;};h.prototype.waitForInitData=function(){'use strict';this.fbidList.push(h.INIT_PLACEHOLDER);};h.prototype.destroy=function(){'use strict';this.reset();this.isActive=false;};h.prototype.isLoaded=function(){'use strict';return this.loaded;};h.prototype.canPage=function(){'use strict';if(!this.isLoaded())return false;if(this.totalCount!==null)return this.totalCount>1;if(this.usesNonCircularPhotoSet)return true;return this.getLength()>1;};h.prototype.errorInCurrent=function(){'use strict';if(this.initError){return true;}else if(!this.isLoaded())return false;return this.checkErrorAt(this.getCursor());};h.prototype.getLength=function(){'use strict';return this.fbidList.length;};h.prototype.getPhotoSet=function(){'use strict';return this.photoSetQuery.set;};h.prototype.getPhotoSetQuery=function(){'use strict';return this.photoSetQuery;};h.prototype.getCurrentImageData=function(){'use strict';return this.getImageData(this.getCursor());};h.prototype.addViewAsToURI=function(i){'use strict';var j=new (c('URI'))(i);if(this.isInViewAsMode())j.addQueryData({viewas:this.getViewAsUserId()});return j;};h.prototype.getOpaqueCursor=function(i){'use strict';if(this.getImageData(i)){if(this.version===c('PhotosConst').VIEWER_VAULTBOX)return this.getImageData(i).getInfo().opaquecursor;return this.getImageData(i).info.opaquecursor;}if(i==this.firstCursor)return this.firstOpaqueCursor;return null;};h.prototype.getImageData=function(i){'use strict';var j=this.getCacheContent(i,h.IMAGE_DATA);if(j)j.info.permalink=this.addViewAsToURI(j.info.permalink);return j;};h.prototype.getCurrentHtml=function(){'use strict';return this.getCacheContent(this.getCursor(),h.HTML);};h.prototype.getCurrentExtraData=function(){'use strict';return this.getCacheContent(this.getCursor(),h.EXTRA);};h.prototype.getCacheContent=function(i,j){'use strict';if(!i||i===h.ERROR_ID||i===h.INIT_PLACEHOLDER)return null;return this.cache[j][i];};h.prototype.getCursorPos=function(){'use strict';return this.position;};h.prototype.getCursor=function(){'use strict';if(this.position>=0&&this.position<this.getLength())return this.fbidList[this.position];return null;};h.prototype.getCursorAt=function(i){'use strict';return this.fbidList[i];};h.prototype.getCursorForURI=function(i){'use strict';return this.permalinkMap[i];};h.prototype.calculatePositionForMovement=function(i){'use strict';var j=this.position+i;if(this.allLoaded){var k=this.getLength();j=(k+j%k)%k;}return j;};h.prototype.isValidMovement=function(i){'use strict';if(!this.isLoaded()||!this.canPage())return false;var j=this.calculatePositionForMovement(i);return this.getCursor()>0||j>=0&&j<this.getLength();};h.prototype.moveCursor=function(i){'use strict';if(!this.isValidMovement(i))return;this.position=this.calculatePositionForMovement(i);if(i!==0)this.loadMoreIfNeccessary(i>0);};h.prototype.checkErrorAt=function(i){'use strict';if(!this.isLoaded())return false;if(i===h.ERROR_ID)return true;return false;};h.prototype.getRelativeMovement=function(i){'use strict';for(var j=0;j<this.getLength();j++)if(this.fbidList[j]==i)return j-this.position;return null;};h.prototype.preloadImages=function(i){'use strict';var j,k,l=this.getLength(),m=this.cache.image,n=h.BUFFER_SIZE;if(l>n*2){j=(this.position+l-n%l)%l;k=(this.position+n)%l;}else{j=0;k=l-1;}while(j!=k){var o,p=this.fbidList[j],q=i&&i(m[p]);if(this.version===c('PhotosConst').VIEWER_VAULTBOX){o=m[p]&&m[p].preload(q);}else if(m[p]&&m[p].url)if(q&&!m[p].resource){m[p].resource=new Image();m[p].resource.src=m[p].url;o=m[p].url;if(m[p].everstoreLogThis===true)c('PhotoEverstoreLogger').logImmediately(m[p].resource.src);}else if(!q&&!m[p].small){m[p].small=new Image();m[p].small.src=m[p].smallurl||m[p].url;o=m[p].small.src;if(m[p].everstoreLogThis===true)c('PhotoEverstoreLogger').logImmediately(m[p].small.src);}if(this.logger&&o)this.logger.log(o);j=(j+1)%l;}};h.prototype.loadMoreIfNeccessary=function(i){'use strict';if(this.allLoaded||i&&this.rightLock||!i&&this.leftLock)return;var j=i?1:-1,k=this.position+this.bufferSize*j;if(k<0&&!this.checkErrorAt(this.getEndCursor(false))){this.leftLock=true;this.fetch(this.fullBucketSize,false);}else if(k>this.getLength()&&!this.checkErrorAt(this.getEndCursor(true))){this.rightLock=true;this.fetch(this.fullBucketSize,true);}};h.prototype.getEndCursor=function(i){'use strict';return i?this.fbidList[this.getLength()-1]:this.fbidList[0];};h.prototype.calculateRelativeIndex=function(i,j,k){'use strict';if(!this.totalCount)return null;var l=this.fbidList.indexOf(j),m=this.fbidList.indexOf(k);if(l===-1||m===-1)return null;var n=m-l;return (i+n+this.totalCount)%this.totalCount;};h.prototype.calculateDistance=function(i,j){'use strict';var k=this.fbidList.indexOf(i),l=this.fbidList.indexOf(j);if(k===-1||l===-1)return null;return (l-k+this.getLength())%this.getLength();};h.prototype.fetch=function(i,j){'use strict';var k=this.getEndCursor(j),l=babelHelpers['extends']({cursor:k,version:this.version,end:this.getEndCursor(!j),fetchSize:j?i:-1*i,relevant_count:this.relevantCount,opaqueCursor:this.getOpaqueCursor(k),tagSuggestionMode:this.tagSuggestionMode},this.photoSetQuery);if(this.isInViewAsMode())l.viewas=this.getViewAsUserId();if(this.totalCount&&this.firstCursorIndex!==null){l.total=this.totalCount;l.cursorIndex=this.calculateRelativeIndex(this.firstCursorIndex,this.firstCursor,k);}var m=c('ge')(this.pageletRootID);if(!m){m=c('DOM').create('div',{id:this.pageletRootID});c('DOM').appendContent(document.body,m);}c('UIPagelet').loadFromEndpoint(this.pageletName,m,l,{usePipe:this.useAjaxPipe,automatic:true,jsNonblock:true,crossPage:true});if(!this.useAjaxPipe)this.setUseAjaxPipe(true);};h.prototype.storeToCache=function(i){'use strict';var j={};if(!this.isActive)return j;if('error' in i){this.processErrorResult(i.error);j.error=true;return j;}if('init' in i){this.processInitResult(i.init);j.init={logids:i.init.logids,fbid:i.init.fbid,loggedin:i.init.loggedin,fromad:i.init.fromad,withinbusiness:i.init.withinbusiness,eid:i.init.eid};}if('image' in i){this.processImageResult(i.image);j.image=true;}if('data' in i){this.processDataResult(i.data);j.data=true;}return j;};h.prototype.processInitResult=function(i){'use strict';if(this.loaded)return;this.usesOpaqueCursor=i.usesopaquecursor;this.usesNonCircularPhotoSet=i.isnoncircularphotoset;this.loaded=true;this.photoSetQuery=i.query;if(i.bufferSize)this.bufferSize=i.bufferSize;if(i.fullBucketSize)this.fullBucketSize=i.fullBucketSize;if(this.fbidList.length===0){this.fbidList.push(i.fbid);this.rightLock=true;}else{var j=this.fbidList.indexOf(h.INIT_PLACEHOLDER);if(j!=-1)this.fbidList[j]=i.fbid;}this.firstCursor=i.fbid;this.firstOpaqueCursor=i.opaquecursor;if('initIndex' in i&&'totalCount' in i){this.firstCursorIndex=i.initIndex;this.totalCount=i.totalCount;}if(this.version==c('PhotosConst').VIEWER_PERMALINK){var k=i.initialBucketSize?i.initialBucketSize:h.INIT_BUCKET_SIZE;this.fetch(k,true);}};h.prototype.processImageResult=function(i){'use strict';for(var j in i){if(j===this.firstCursor&&i[j].everstoreLogThis)c('PhotoEverstoreLogger').logImmediately(i[j].url);if(this.version===c('PhotosConst').VIEWER_VAULTBOX){var k=i[j];this.cache.image[j]=new (c('PhotoViewerImage'))(k);this.permalinkMap[this.cache.image[j].getURIString()]=j;}else{this.cache.image[j]=i[j];if(i[j].dimensions)this.cache.image[j].dimensions=c('Vector').deserialize(i[j].dimensions);if(i[j].originalDimensions)this.cache.image[j].originalDimensions=c('Vector').deserialize(i[j].originalDimensions);if(i[j].smalldims)this.cache.image[j].smalldims=c('Vector').deserialize(i[j].smalldims);this.permalinkMap[new (c('URI'))(i[j].info.permalink).getUnqualifiedURI().toString()]=j;}}};h.prototype.attachToFbidsList=function(i,j,k){'use strict';if(this.allLoaded)return;if(j===-1){for(var l=i.length-1;l>=0;l--){this.fbidList.unshift(i[l]);this.position++;}this.leftLock=false;}else{for(var m=0;m<i.length;m++)this.fbidList.push(i[m]);this.rightLock=false;}if(k)this.setAllLoaded();};h.prototype.setAllLoaded=function(){'use strict';this.allLoaded=true;if(this.getCursor()===null)this.position=this.calculatePositionForMovement(0);};h.prototype.processDataResult=function(i){'use strict';for(var j in i){if(!this.cache.html[j])this.cache.html[j]={};for(var k in i[j].html){var l=i[j].html[k];if(typeof l==='string')l=c('HTML')(l).getRootNode();if(l.childNodes){this.cache.html[j][k]=Array.from(l.childNodes);}else this.cache.html[j][k]=[];}if(!('extra' in i[j])){this.cache.extra[j]=null;continue;}this.cache.extra[j]={tagRects:{}};if(!Array.isArray(i[j].extra.tagRects))for(var m in i[j].extra.tagRects)if(i[j].extra.tagRects[m])this.cache.extra[j].tagRects[m]=c('Rect').deserialize(i[j].extra.tagRects[m]);Object.keys(i[j].extra).forEach(function(n){if(n=='tagRects')return;this.cache.extra[j][n]=i[j].extra[n];}.bind(this));}};h.prototype.processErrorResult=function(i){'use strict';if(!this.isLoaded()){this.initError=true;return;}var j=i.side,k=[h.ERROR_ID];this.attachToFbidsList(k,j);};h.prototype.setTotalCount=function(i){'use strict';this.totalCount=i;};h.prototype.setFirstCursorIndex=function(i){'use strict';this.firstCursorIndex=i;};Object.assign(h,{ERROR:'error',HTML:'html',IMAGE_DATA:'image',EXTRA:'extra',BUFFER_SIZE:3,INIT_BUCKET_SIZE:4,FULL_BUCKET_SIZE:12,ERROR_ID:-1,INIT_PLACEHOLDER:1});f.exports=h;},null);
__d('PhotosetSearchPivotData',['Promise','AsyncRequest','PhotoStreamCache','XPhotosetSearchPivotController'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=/^(perm:)?tag:(\d+)/,i={},j={fetch:function(k,l){if(!(k in i)){var m=c('XPhotosetSearchPivotController').getURIBuilder().setInt('fbid',k);if(l){var n={};l.fbidList.forEach(function(o){var p=l.getCacheContent(o,c('PhotoStreamCache').EXTRA);if(p)Object.keys(p.tagRects).forEach(function(q){if(h.test(q)){var r=RegExp.$2;if(r in n){n[r]++;}else n[r]=1;}});});m.setIntToIntMap('tags',n);}i[k]=new (c('Promise'))(function(o,p){new (c('AsyncRequest'))().setURI(m.getURI()).setHandler(function(q){o(q.getPayload());}).setErrorHandler(p).setAllowCrossPageTransition(true).send();});}return i[k]['catch'](function(o){delete i[k];throw o;});}};f.exports=j;},null);
__d('GraphicPhotoWarningTypedLogger',['Banzai','GeneratedLoggerUtils','nullthrows'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(){this.clear();}h.prototype.log=function(){c('GeneratedLoggerUtils').log('logger:GraphicPhotoWarningLoggerConfig',this.$GraphicPhotoWarningTypedLogger1,c('Banzai').BASIC);};h.prototype.logVital=function(){c('GeneratedLoggerUtils').log('logger:GraphicPhotoWarningLoggerConfig',this.$GraphicPhotoWarningTypedLogger1,c('Banzai').VITAL);};h.prototype.clear=function(){this.$GraphicPhotoWarningTypedLogger1={};return this;};h.prototype.updateData=function(j){this.$GraphicPhotoWarningTypedLogger1=babelHelpers['extends']({},this.$GraphicPhotoWarningTypedLogger1,j);return this;};h.prototype.setEvent=function(j){this.$GraphicPhotoWarningTypedLogger1.event=j;return this;};var i={event:true};f.exports=h;},null);
__d('ObjectionableContentFilterTypedLogger',['Banzai','GeneratedLoggerUtils','nullthrows'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(){this.clear();}h.prototype.log=function(){c('GeneratedLoggerUtils').log('logger:ObjectionableContentFilterLoggerConfig',this.$ObjectionableContentFilterTypedLogger1,c('Banzai').BASIC);};h.prototype.logVital=function(){c('GeneratedLoggerUtils').log('logger:ObjectionableContentFilterLoggerConfig',this.$ObjectionableContentFilterTypedLogger1,c('Banzai').VITAL);};h.prototype.clear=function(){this.$ObjectionableContentFilterTypedLogger1={};return this;};h.prototype.updateData=function(j){this.$ObjectionableContentFilterTypedLogger1=babelHelpers['extends']({},this.$ObjectionableContentFilterTypedLogger1,j);return this;};h.prototype.setContentID=function(j){this.$ObjectionableContentFilterTypedLogger1.content_id=j;return this;};h.prototype.setEvent=function(j){this.$ObjectionableContentFilterTypedLogger1.event=j;return this;};h.prototype.setVC=function(j){this.$ObjectionableContentFilterTypedLogger1.vc=j;return this;};h.prototype.updateExtraData=function(j){j=c('nullthrows')(c('GeneratedLoggerUtils').serializeMap(j));c('GeneratedLoggerUtils').checkExtraDataFieldNames(j,i);this.$ObjectionableContentFilterTypedLogger1=babelHelpers['extends']({},this.$ObjectionableContentFilterTypedLogger1,j);return this;};h.prototype.addToExtraData=function(j,k){var l={};l[j]=k;return this.updateExtraData(l);};var i={content_id:true,event:true,vc:true};f.exports=h;},null);
__d('PhotoWarningScreen',['csx','cx','CSS','DOM','EventListener','PhotoWarningScreenConfig','ObjectionableContentFilterTypedLogger','GraphicPhotoWarningTypedLogger'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();function j(k){'use strict';if(k.footer){k.footer=c('DOM').insertAfter(k.rootElement,k.footer).pop();var l=c('DOM').scry(k.footer,"._1kmy").pop();if(l)c('EventListener').listen(l,'click',function(){c('CSS').hide(k.footer);c('CSS').show(k.warningOverlay);c('CSS').addClass(k.innerContent,"_1t6v");if(k.warningType===c('PhotoWarningScreenConfig').Types.OBJECTIONABLE)j.logObjectionable(c('PhotoWarningScreenConfig').ObjectionableEvents.WARNING_SCREEN_REENABLED,k.responsiblePhotos);});}c('EventListener').listen(k.seePhotoButton,'click',function(){c('CSS').hide(k.warningOverlay);if(k.footer)c('CSS').show(k.footer);c('CSS').removeClass(k.innerContent,"_1t6v");switch(k.warningType){case c('PhotoWarningScreenConfig').Types.GRAPHIC:j.logGraphic(c('PhotoWarningScreenConfig').GraphicEvents.GRAPHIC_PHOTO_WARNING_DISMISSED);break;case c('PhotoWarningScreenConfig').Types.OBJECTIONABLE:j.logObjectionable(c('PhotoWarningScreenConfig').ObjectionableEvents.WARNING_SCREEN_DISMISSED,k.responsiblePhotos);break;}});}j.logGraphic=function(event){new (c('GraphicPhotoWarningTypedLogger'))().setEvent(event).log();};j.logObjectionable=function(event,k){k.forEach(function(l){new (c('ObjectionableContentFilterTypedLogger'))().setEvent(event).setContentID(l).log();});};f.exports=j;},null);
__d('PhotoWarningScreenMixin',['csx','cx','CSS','DOM','emptyFunction'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('emptyFunction'),k={getGraphicWarningContainer:j,getGraphicWarningHiddenContent:j,_graphicWarningMarkup:null,_graphicWarningOverlay:null,_graphicWarningHiddenContentWrapper:null,initGraphicWarningDOM:function(l){this._graphicWarningMarkup=l;this._graphicWarningOverlay=c('DOM').scry(l,"._1t6w").pop();this._graphicWarningHiddenContentWrapper=c('DOM').scry(l,"._1t6x").pop();},showGraphicWarning:function(){this._graphicWarningOverlay&&c('CSS').show(this._graphicWarningOverlay);if(this.getGraphicWarningContainer().contains(this._graphicWarningMarkup))return;if(this._graphicWarningHiddenContentWrapper){this.getGraphicWarningContainer().replaceChild(this._graphicWarningMarkup,this.getGraphicWarningHiddenContent());c('CSS').addClass(this._graphicWarningHiddenContentWrapper,"_1t6v");this._graphicWarningHiddenContentWrapper.appendChild(this.getGraphicWarningHiddenContent());}},hideGraphicWarning:function(){if(!this.getGraphicWarningContainer().contains(this._graphicWarningMarkup))return;this.getGraphicWarningContainer().replaceChild(this.getGraphicWarningHiddenContent(),this._graphicWarningMarkup);}};f.exports=k;},null);
__d('PhotoLogger',['Event','BanzaiScuba','SpotlightViewerLoggingEvents','SubscriptionsHandler'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){'use strict';this.$PhotoLogger1=i;this.$PhotoLogger2={};}h.prototype.log=function(i){'use strict';if(!this.$PhotoLogger2[i]){this.$PhotoLogger3(i);this.$PhotoLogger2[i]=true;}};h.prototype.$PhotoLogger3=function(i){'use strict';this.$PhotoLogger4(c('SpotlightViewerLoggingEvents').LOADING,{uri:i});var j=new (c('SubscriptionsHandler'))(),k=new Image();j.addSubscriptions(c('Event').listen(k,'load',function(){this.$PhotoLogger4(c('SpotlightViewerLoggingEvents').LOADED,{uri:i});j.release();}.bind(this)),c('Event').listen(k,'error',function(){this.$PhotoLogger4(c('SpotlightViewerLoggingEvents').ERROR,{uri:i});j.release();}.bind(this)),c('Event').listen(k,'abort',function(){this.$PhotoLogger4(c('SpotlightViewerLoggingEvents').ABORT,{uri:i});j.release();}.bind(this)));k.src=i;};h.prototype.logEvent=function(i){'use strict';this.$PhotoLogger4(i);};h.prototype.$PhotoLogger4=function(i,j){'use strict';var k=new (c('BanzaiScuba'))('photos_client_loading',null,{addBrowserFields:true});k.addNormal('event',i);k.addNormal('viewer',this.$PhotoLogger1);for(var l in j)k.addNormal(l,j[l]);k.post();};f.exports=h;},null);
__d('PhotoSessionLog',['AsyncRequest','Run','URI','Vector'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){}Object.assign(h,{UNKNOWN:0,ESC:1,X:2,OUTSIDE:3,UNLOAD:4,NAVIGATE:5,AGGREGATE:6,LEAVE:7,PERMALINK:0,SNOWLIFT:6,SNOWDOWN:13,AGGREGATION_COUNT:20,set:null,time:null,views:0,fbidList:[],details:{},width:0,height:0,first:false,last:false,logIds:false,version:null,source:null,buttonLikes:0,pagingAction:'',cycle:false,endOfRelevant:false,relevantCount:0,closingTypeToString:function(i){return {0:'UNKNOWN',1:'ESC',2:'X',3:'OUTSIDE',4:'UNLOAD',5:'NAVIGATE'}[i]||'UNKNOWN';},initLogging:function(i){this.set=null;this.time=new Date();this.views=0;this.hiResLoads=0;this.fullScreenViews={};this.first=true;this.last=false;this.logIds=false;this.eid='';this.version=i;this.buttonLikes=0;this.pagingAction='';this.cycle=false;this.endOfRelevant=false;this.relevantCount=0;this.panoramaClicks=0;this.panoramaImpressions=0;if(i===h.SNOWLIFT){var j=c('Vector').getViewportDimensions();this.width=j.x;this.height=j.y;}},_isSnowlift:function(){return this.version===h.SNOWLIFT;},setLogFbids:function(i){this.logIds=i;},setEid:function(i){this.eid=i;},setPhotoSet:function(i){this.set=i;},addButtonLike:function(){this.buttonLikes++;},setPagingAction:function(i){this.pagingAction=i;},setCycle:function(i){this.cycle=i;},setEndOfRelevant:function(i){this.endOfRelevant=i;},setRelevantCount:function(i){this.relevantCount=i;},setEndMetrics:function(i){this.endMetrics=i;},setSource:function(i){this.source=i;},addPanoramaClick:function(){this.panoramaClicks++;},addPanoramaImpression:function(){this.panoramaImpressions++;},addPhotoView:function(i,j,k){if(this.logIds&&this.views>=this.AGGREGATION_COUNT)this.logPhotoViews(this.AGGREGATE);this.views++;if(i)this.fbidList.push([i.fbid,i.owner,Date.now()]);if(j)this.hiResLoads++;if(k)this.fullScreenViews[i.fbid]=true;},logEnterFullScreen:function(i){this.fullScreenViews[i]=true;},addDetailData:function(i,j){if(!this.details[i])this.details[i]={t:j.num_tags,l:j.has_location,c:j.has_caption,cm:j.comment_count,lk:j.like_count,w:j.width,h:j.height,ad:'{}',p:this.pagingAction};},updateAdData:function(i,j){if(this.details[i])this.details[i].ad=JSON.stringify(j);},logPhotoViews:function(i){if(!this.views)return;if(i!=this.AGGREGATE)this.last=true;var j={set:this.set,time:new Date()-this.time,fbids:this.logIds?this.fbidList:[],details:this.logIds?this.details:{},eid:this.eid,first:this.first,last:this.last,close:i?i:this.UNKNOWN,button_likes:this.buttonLikes,version:this.version,endmetric:this.endMetrics,cycle:this.cycle,end_relev:this.endOfRelevant,relev_count:this.relevantCount,source:this.source,panorama_clicks:this.panoramaClicks,panorama_impressions:this.panoramaImpressions};if(this.version===h.SNOWLIFT){var k=c('Vector').getViewportDimensions();j.width=k.x||this.width;j.height=k.y||this.height;if(this.hiResLoads>0)j.hires_loads=this.hiResLoads;if(this.last){var l=Object.keys(this.fullScreenViews).length;if(l>0)j.fullscreen=l;}}var m=new (c('URI'))('/ajax/photos/logging/session_logging.php').setSubdomain('www');new (c('AsyncRequest'))().setAllowCrossPageTransition(true).setURI(m).setOption('asynchronous_DEPRECATED',i!=h.UNLOAD).setOption('suppressErrorHandlerWarning',true).setData(j).send();this.views=0;this.hiResLoads=0;this.fbidList=[];this.details={};this.first=false;this.buttonLikes=0;if(this.last){this.set=null;this.logIds=false;this.fullScreenViews={};}}});c('Run').onUnload(function(){h.logPhotoViews(h.UNLOAD);});c('Run').onLeave(function(){h.logPhotoViews(h.LEAVE);});f.exports=h;},null);
__d('PhotosUtils',['Vector'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){}Object.assign(h,{getNearestBox:function(i,j){var k=Infinity,l=null;for(var m in i){var n=i[m];if(n.contains(j)){var o=j.distanceTo(n.getCenter());if(o<k){k=o;l=m;}}}return l;},absoluteToNormalizedPosition:function(i,j){var k=c('Vector').getElementPosition(i),l=c('Vector').getElementDimensions(i),m=j.sub(k).mul(100/l.x,100/l.y);m.domain='pure';return m;},normalizedToAbsolutePosition:function(i,j){var k=c('Vector').getElementPosition(i),l=c('Vector').getElementDimensions(i),m=j.mul(l.x/100,l.y/100).add(k);m.domain='document';return m;},isFacebox:function(i){return i.match(/^face:/);},isTag:function(i){return i.match(/^tag:/);}});f.exports=h;},null);
__d('PhotoPermalinkURI',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={isValid:function(i){return h.parse(i)!==null;},parse:function(i){if(this.isValidLegacy(i)){var j=i.getQueryData();if(j.fbid)return {photo_id:j.fbid,set_token:j.set};if(j.id&&j.pid)return {photo_id:j.id+':'+j.pid,set_token:j.set};return null;}var k=i.getPath();if(k[k.length-1]==='/')k=k.substring(0,k.length-1);var l=k.split('/');if(l.length>=3&&l[2]==='photos')if(l.length===4&&/^\d+$/.exec(l[3])!==null){return {photo_id:l[3],set_token:null};}else if(l.length===5&&/^\d+$/.exec(l[4])!==null)return {photo_id:l[4],set_token:l[3]};return null;},isValidLegacy:function(i){var j=i.getPath();if(j[j.length-1]==='/')j=j.substring(0,j.length-1);if(j==='/photo.php'||j==='/force_photo/photo.php'||j==='/photo'||j==='/force_photo/photo/index.php'||j==='/photo/index.php'||j==='/force_photo/photo'||j==='/video.php'||j==='/video/video.php')return true;return false;}};f.exports=h;},null);
__d('VideoPermalinkURI',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={isValid:function(i){return h.parse(i)!==null;},parse:function(i){if(this.isValidLegacy(i)){var j=i.getQueryData();if(j.v)return {video_id:j.v,set_token:j.set};return null;}var k=i.getPath();if(k[k.length-1]==='/')k=k.substring(0,k.length-1);var l=k.split('/');if(l.length>=3&&l[2]==='videos')if(l.length===4&&/^\d+$/.exec(l[3])!==null){return {video_id:l[3],set_token:null};}else if(l.length===5&&/^\d+$/.exec(l[4])!==null)return {video_id:l[4],set_token:l[3]};return null;},isValidLegacy:function(i){var j=i.getPath();if(j[j.length-1]==='/')j=j.substring(0,j.length-1);if(j==='/photo.php'||j==='/force_photo/photo.php'||j==='/photo'||j==='/force_photo/photo/index.php'||j==='/photo/index.php'||j==='/force_photo/photo'||j==='/video.php'||j==='/video/video.php')return true;return false;}};f.exports=h;},null);
__d('PhotoTagSearchPivotLogger',['Banzai'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={};c('Banzai').subscribe(c('Banzai').SHUTDOWN,function(){Object.keys(h).forEach(function(l){var m=h[l];Object.keys(m).forEach(function(n){c('Banzai').post('photo_tag_search_pivot',{source:l,action:n,count:m[n]});});});});var i=/^(perm:)?tag:/,j,k={logImpression:function(l,m){var n=l in h?h[l]:h[l]={};n[m]=m in n?n[m]+1:1;},logImageImpression:function(l,m,n){if(j!==m){if(n.some(function(o){return i.test(o);}))this.logImpression(l,'image_impression');j=m;}},logPivotImpression:function(l,m){if(i.test(m))this.logImpression(l,'pivot_impression');},logShowMorePhotos:function(){this.logImpression('photoset','show_more_photos');},logHideMorePhotos:function(){this.logImpression('photoset','hide_more_photos');},logSuggestMorePhotos:function(){this.logImpression('photoset','suggest_more_photos');},logMorePhotosNavigation:function(l){c('Banzai').post('photo_tag_search_pivot',{source:'photoset',action:'more_photos_search',query:l,count:1});}};f.exports=k;},null);
__d('PhotosetSearchPivot.react',['cx','fbt','LeftRight.react','PhotoTagSearchPivotLogger','PhotosetSearchPivotData','React','XUISpinner.react','XUIText.react','joinClasses'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'PhotosetSearchPivotItem',propTypes:{normalized:j.string,title:j.object,uri:j.string,images:j.array},onClick:function(){c('PhotoTagSearchPivotLogger').logMorePhotosNavigation(this.props.normalized);},render:function(){return (c('React').createElement('div',{className:"_25r"},c('React').createElement('a',{onClick:this.onClick,href:this.props.uri,className:"_25t _3-8t"},c('React').createElement('div',{className:"_25u"},c('React').createElement('div',{className:"_25v _25w",style:{backgroundImage:'url('+this.props.images[0].uri+')'}}),c('React').createElement('div',{className:"_25x"},c('React').createElement('div',{className:"_25y"},c('React').createElement('div',{className:"_25z"}),c('React').createElement('div',{className:"_26r"},c('React').createElement('div',{className:"_273 _25w",style:{backgroundImage:'url('+this.props.images[1].uri+')'}}))),c('React').createElement('div',{className:"_274"},c('React').createElement('div',{className:"_25z"}),c('React').createElement('div',{className:"_26r"},c('React').createElement('div',{className:"_273 _25w",style:{backgroundImage:'url('+this.props.images[2].uri+')'}}))))),c('React').createElement(c('XUIText.react'),{display:'block',className:"_27f _2pi4",dangerouslySetInnerHTML:{__html:this.props.title.__html}}))));}}),l=c('React').createClass({displayName:'PhotosetSearchPivot',propTypes:{fbid:j.string,endofalbum:j.bool,withBackground:j.bool,linesAroundHeader:j.bool,onclose:j.func},fetchPivots:function(m){c('PhotosetSearchPivotData').fetch(m).then(function(n){setTimeout(this.onFetchSuccess.bind(this,m,n.pivots),0);}.bind(this),function(n){setTimeout(this.onFetchError.bind(this,m),0);}.bind(this));},onFetchSuccess:function(m,n){if(!this.isMounted()||this.props.fbid!==m)return;n=n||[];var o='show';if(n.length===0)o='hide';this.setState({pivots:n,action:o});},onFetchError:function(m){if(!this.isMounted()||this.props.fbid!==m)return;this.setState({pivots:[],action:'hide'});},getInitialState:function(){this.fetchPivots(this.props.fbid);return {pivots:[],action:'loading'};},componentWillReceiveProps:function(m){if(m.fbid){this.setState({action:'loading'});this.fetchPivots(m.fbid);}else this.setState({action:'hide',pivots:[]});},onExitClicked:function(){this.props.onclose();},render:function(){if(this.state.action==='loading')return (c('React').createElement('div',{className:c('joinClasses')(this.props.className,"_27h _2ph_")},c('React').createElement(c('XUISpinner.react'),{size:'large'})));if(this.state.action==='hide')return c('React').createElement('span',null);var m=this.state.pivots.map(function(q){return (c('React').createElement(k,{normalized:q.normalized,title:q.title,uri:q.uri,images:q.images}));}),n=this.props.endofalbum?c('React').createElement('span',{className:"_2pij"},i._("End of album")):null,o="_27m"+(' '+"_2pi3")+(' '+"_2pib")+(this.props.linesAroundHeader?' '+"_3-te":''),p=c('React').createElement('span',null,n,c('React').createElement('span',{className:"_4ptz"},i._("Other photos you may like")));if(this.props.onclose){p=c('React').createElement(c('LeftRight.react'),{className:o},p,c('React').createElement('a',{href:'#',onClick:this.onExitClicked,className:"_27n"}));}else p=c('React').createElement('div',{className:o},p);return (c('React').createElement('div',{className:c('joinClasses')(this.props.className,(this.state.action==='hide'?"_27j":'')+(this.state.action==='show'?' '+"_27k":''))},c('React').createElement('div',{className:"_27l"+(this.props.withBackground?' '+"_3-tf":'')},p,c('React').createElement('div',{className:"_27o _2pi8 clearfix"},m))));}});f.exports=l;},null);
__d('PhotosetPivotSlide.react',['cx','fbt','xuiglyph','Image.react','Link.react','PhotosetSearchPivot.react','React','XUIText.react'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'PhotosetPivotSlide',propTypes:{fbid:k.string,isAlbum:k.bool,albumOwnerName:k.string,visible:k.bool,onReturn:k.func},render:function(){return (c('React').createElement('div',{className:"_1_ap"+(this.props.visible?' '+"_1_aq":'')},c('React').createElement('div',{className:"_1_ar"},c('React').createElement(c('XUIText.react'),{display:'block'},this._getEndOfAlbumTitle()),c('React').createElement(c('Link.react'),{className:"_1_as",onClick:this.props.onReturn},c('React').createElement(c('Image.react'),{className:"_1_at",src:j({name:'arrow-right',shade:'white',size:'small'})}),i._("Return to Beginning"))),c('React').createElement(c('PhotosetSearchPivot.react'),{className:"_1_au",fbid:this.props.visible?this.props.fbid:null,linesAroundHeader:true})));},_getEndOfAlbumTitle:function(){if(this.props.albumOwnerName){if(this.props.isAlbum){return i._("End of {user_name}'s album",[i.param('user_name',c('React').createElement(c('XUIText.react'),{weight:'bold'},this.props.albumOwnerName))]);}else return i._("End of {user_name}'s photos",[i.param('user_name',c('React').createElement(c('XUIText.react'),{weight:'bold'},this.props.albumOwnerName))]);}else if(this.props.isAlbum){return i._("End of album");}else return i._("End of photos");}});f.exports=l;},null);
__d('PhotoSnowliftAds',['csx','Arbiter','Event','CSS','DataStore','DOM','PhotoSessionLog','UIPagelet','URI','Vector'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i={REFRESH_RATE:30000,UNITS_REGISTER_DELAY:1000,root:null,availableDimensions:null,loadQuery:null,lastLoadTime:0,minAds:100,units:null,isLogAdData:null,displayedCallback:null,position:null,adsStatus:'null',adsEvents:{},resetEvents:function(){this.adsStatus='reset';this.adsEvents={};},addEvent:function(j,k){if(k)this.adsStatus=j;var l=Date.now();this.adsEvents[j+'_'+l]=l;},init:function(j,k,l,m){this.reset();this.root=j;this.snowlift=k;this.minAds=l.min_ads;this.displayedCallback=m;this.addEvent('init',true);},reset:function(){this.lastLoadTime=0;this.position=0;this.units=[];this.resetEvents();this.addEvent('reset',true);},resize:function(j){this.availableDimensions=j;this.loadQuery=this.snowlift.getLoadQuery();this.processResize();},calculateUnitSizes:function(j,k,l){var m={};j.forEach(function(n){var o=n.root.firstChild.offsetHeight;n.units.forEach(function(q){if(!c('CSS').hasClass(q,'hidden')&&!this.getIsHoldout(q)&&!this.getIsShadow(q)){var r=this.getHeight(q.firstChild,k);o-=r;}}.bind(this));var p={height:o,visible:false};n.units.forEach(function(q){var r=this.getIsAds(q),s=this.getHeight(q.firstChild,k),t=this.getUnitId(q),u=this.getIsHoldout(q);if(u&&l)return;m[t]={height:s,visible:false,priority:0,is_ads:r,is_holdout:u,section_ref:p};}.bind(this));}.bind(this));return m;},calculateVisibleUnits:function(j,k,l){var m=0,n=this.getUnitPriority(k);n.forEach(function(o){if(k.hasOwnProperty(o)){var p=k[o],q=p.height;if(!p.section_ref.visible)q+=p.section_ref.height;p.height_below=l-q;p.visible=p.height_below>=0&&q>0;if(p.visible){p.section_ref.visible=true;l-=q;m++;}}}.bind(this));return k;},displayUnits:function(j,k){j.forEach(function(l){var m=false,n=true;l.units.forEach(function(o){var p=this.getUnitId(o),q=k[p];if(!q)return;var r=q.visible,s=q.height_below,t=q.is_ads;c('CSS').conditionClass(o,'hidden',!r);if(t&&r&&n){var u=c('DOM').find(o,'div.ego_unit');c('CSS').addClass(u,'ego_unit_no_top_border');n=false;}m=m||r;this.calcUnitStats(this.units[t][p],r,s);}.bind(this));c('CSS').conditionClass(l.root,'hidden',!m);}.bind(this));c('Arbiter').inform('PhotoSnowliftAds/displayUnits');},getUnitsDisplayed:function(j,k){var l=0;j.forEach(function(m){m.units.forEach(function(n){var o=this.getUnitId(n),p=k[o];if(!p||!p.visible)return;l++;}.bind(this));}.bind(this));return l;},getHeightsRequired:function(j,k){var l=0,m=[];j.forEach(function(n){var o=false;n.units.forEach(function(p){var q=this.getUnitId(p),r=k[q];if(!r)return;l+=r.height;if(!o){l+=r.section_ref.height;o=true;}m.push(l);}.bind(this));}.bind(this));return m;},getUnitPriority:function(j){var k=[],l=0,m=0;for(var n in j){var o=j[n];k.push(n);var p=this.minAds+l+m;if(o.is_ads){if(m<this.minAds)p=m;m++;}else l++;o.priority=p;}k=k.sort(function(q,r){var s=j[q],t=j[r];return s.priority-t.priority;}.bind(this));return k;},updateUnitsStatus:function(){var j=this.availableDimensions.x,k=this.availableDimensions.y,l=this.calculateUnitSizes(this.sections,j);l=this.calculateVisibleUnits(this.sections,l,k);for(var m in l){if(!l.hasOwnProperty(m))continue;var n=l[m];if(!n.is_holdout||!n.visible)continue;var o=this.units[1][m];this.calcUnitStats(o,n.visible,n.height_below);}l=this.calculateUnitSizes(this.sections,j,true);l=this.calculateVisibleUnits(this.sections,l,k);this.displayUnits(this.sections,l);if(this.displayedCallback){var p=this.getUnitsDisplayed(this.sections,l),q=this.getHeightsRequired(this.sections,l);this.displayedCallback(p,q);}},calcUnitStats:function(j,k,l){var m=Date.now();if(j.visible)j.totalTime+=m-j.lastShowTime;if(j.trackingCode!==null&&j.totalTime>=this.UNITS_REGISTER_DELAY){var n=j.trackingCode;j.trackingCode=null;this.registerImpression(n,j.registerUrl);}j.visible=k;j.heightBelow=l;j.lastShowTime=m;},prepareResize:function(){var j=function(k){var l=c('DOM').create('div',{className:'inner'}),m=c('DOM').create('div',{className:'wrapper'},l);c('DOM').replace(k,m);c('DOM').setContent(l,k);return m;};this.sections=c('DOM').scry(this.root,'div.ego_section').map(function(k){return {root:j(k),units:c('DOM').scry(k,'div.ego_unit').map(j)};});},processResize:function(){if(this.isLoading||this.lastLoadTime===0||this.availableDimensions===null){this.setLogData();return;}this.updateUnitsStatus();this.setLogData();var j=this.nextRegisterTime();if(j!==Infinity)setTimeout(this.processResize.bind(this),j);},setIsLogAdData:function(j){this.isLogAdData=j;this.addEvent('setIsLogAdData',false);this.setLogData();},setLogData:function(){var j=this.snowlift.getImageId();if(this.isLogAdData&&j){var k=c('Vector').getElementDimensions(this.snowlift.getImage()),l=c('Vector').getElementDimensions(this.snowlift.getRHCHeader()),m=c('Vector').getElementDimensions(this.snowlift.getRHCBody()),n=c('Vector').getElementDimensions(this.snowlift.getRHCFooter()),o={query_set:this.snowlift.getLoadQuery().set,window_x:window.innerWidth,window_y:window.innerHeight,image_x:k.x,image_y:k.y,header_x:l.x,header_y:l.y,body_x:m.x,body_y:m.y,footer_x:n.x,footer_y:n.y,ads_below_space:this.getAdsBelowSpace(),time:Date.now(),adsStatus:this.adsStatus,adsEvents:this.adsEvents,refreshRate:this.refreshUnitsRate,position:this.position};c('PhotoSessionLog').updateAdData(j,o);}},getAdsBelowSpace:function(){var j=[],k=this.units[1];for(var l in k)if(k.hasOwnProperty(l)&&!this.getIsHoldout(this.getAdUnit(l)))j.push(k[l].heightBelow);return j;},getIsAds:function(j){var k=c('DOM').scry(j,"div._4u8");return k.length;},getUnitId:function(j){if(this.getIsAds(j)){return this.getAdId(j);}else return this.getEgoId(j);},getEgoId:function(j){var k=c('DOM').find(j,'div.ego_unit');return k.getAttribute('data-ego-fbid');},getAdData:function(j){var k=c('DOM').find(j,"div._4u8"),l=k.getAttribute('data-ad');return l&&JSON.parse(l)||{};},getAdId:function(j){return this.getAdData(j).adid;},getIsHoldout:function(j){return j&&this.getIsAds(j)&&this.getAdData(j).holdout;},getIsShadow:function(j){return j&&this.getIsAds(j)&&this.getAdData(j).shadow;},getAdUnit:function(j){if(!this.sections)return null;var k=[];this.sections.forEach(function(m){k.push.apply(k,m.units);});for(var l=0;l<k.length;l++)if(this.getIsAds(k[l])&&this.getAdId(k[l])==j)return k[l];return null;},nextRegisterTime:function(){var j=Infinity,k=babelHelpers['extends']({},this.units[0],this.units[1]);for(var l in k)if(k.hasOwnProperty(l)){var m=k[l];if(m.trackingCode!==null&&m.visible)j=Math.min(j,this.UNITS_REGISTER_DELAY-m.totalTime);}return j;},getHeight:function(j,k){var l=c('DataStore').get(j,'height');if(l&&l.x===k)return l.y;return this.cacheHeight(j,k);},cacheHeight:function(j,k){var l={x:k,y:j.offsetHeight};c('DataStore').set(j,'height',l);return l.y;},loadAdsAndEgo:function(){this.resetEvents();this.addEvent('adsRequested',true);this.position++;var j=this.getCursorFBID(this.loadQuery);c('UIPagelet').loadFromEndpoint('WebEgoPane',this.root,{pid:34,data:[this.loadQuery.set,j,false,this.snowlift.getOpaqueCursor(j)]},{crossPage:true,bundle:false});},getCursorFBID:function(j){if(j.v!==undefined)return j.v;if(j.fbid!==undefined)return j.fbid;return '0';},unitsLoaded:function(j,k){var l;if(k){l='/ai.php';this.addEvent('adsLoaded',true);}else{l='/ajax/ei.php';this.addEvent('egoLoaded',true);}var m={};for(var n in j)if(j.hasOwnProperty(n))m[n]={trackingCode:j[n],totalTime:0,lastShowTime:0,heightBelow:-10000,visible:false,registerUrl:l};this.units[k]=m;if(k)this.waitForImages(this.imagesLoaded.bind(this));},imagesLoaded:function(){this.prepareResize();this.addEvent('imagesLoaded',true);this.lastLoadTime=Date.now();this.isLoading=false;this.processResize();c('CSS').removeClass(this.root,'loading');},loadAdsFromUserActivity:function(){var j=Date.now()-this.lastLoadTime;if(!this.isLoading&&j>i.REFRESH_RATE){c('CSS').addClass(this.root,'loading');this.isLoading=true;this.loadAdsAndEgo();}},registerImpression:function(j,k){var l=c('DOM').create('iframe',{src:new (c('URI'))(k).addQueryData({aed:j}),width:0,height:0,frameborder:0,scrolling:'no',className:'fbEmuTracking'});l.setAttribute('aria-hidden','true');c('DOM').appendContent(this.root,l);},waitForImages:function(j){var k=c('DOM').scry(this.root,'img.img'),l=k.length,m=l;if(m===0)j();var n=function(){m--;if(m===0)setTimeout(j,0);};for(var o=0;o<l;o++){var p=k[o];if(p.complete){n();}else c('Event').listen(p,{load:n,error:n,abort:n});}}};f.exports=i;},null);
__d('PhotoViewer',['Bootloader','CSS','DOM','emptyFunction'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){'use strict';this.image=null;this.root=null;this.stream=null;}h.prototype.getEventString=function(i){'use strict';var j=this.getEventPrefix();if(j)return j+'.'+i;return null;};h.prototype.getImage=function(){'use strict';return this.image;};h.prototype.getPosition=function(){'use strict';return this.stream?this.stream.getCursor():null;};h.prototype.getRoot=function(){'use strict';return this.root;};h.prototype.hiliteAllBoxes=function(){'use strict';c('DOM').scry(this.stageWrapper,'div.tagsWrapper div.faceBox').forEach(function(i){c('CSS').addClass(i,'otherActive');});};h.bootstrap=function(i,j){'use strict';c('Bootloader').loadModules(["PhotoSnowlift"],function(k){k.bootstrap(i,j);});};Object.assign(h.prototype,{getEventPrefix:c('emptyFunction').thatReturnsNull,getSourceString:c('emptyFunction').thatReturnsNull,getVersionConst:c('emptyFunction').thatReturnsNull,getViewerSource:c('emptyFunction').thatReturnsNull,getViewerSet:c('emptyFunction').thatReturnsNull});f.exports=h;},null);
__d("SnowliftVideoPivotsCarouselController",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={setPivotsCarousel:function(i,j){this._pivotsCarousel=i;this.adjustCarousel(j);},adjustCarousel:function(i){if(this._pivotsCarousel)this._pivotsCarousel.pageTo(i);},adjustCarouselOnAutoPlay:function(){if(this._pivotsCarousel)this._pivotsCarousel.page();}};f.exports=h;},null);
__d('PhotoSnowlift',['csx','cx','fbt','invariant','$','Arbiter','AsyncRequest','Bootloader','CSS','DataStore','Dialog','DOM','DOMControl','DOMQuery','EncryptedImg','Event','FullScreen','FunnelLogger','ImageUtils','Input','Keys','Layer','LayerHideOnEscape','LikeConfirmer','LinkController','LitestandShareAttachment','LitestandStoryInsertionStatus','Locale','PhotoWarningScreenConfig','PageTransitions','Parent','PhotoLogger','PhotoPermalinkURI','PhotosConst','PhotoSessionLog','PhotosetPivotSlide.react','PhotosetSearchPivot.react','PhotosetSearchPivotData','PhotoSnowliftActionsGating','PhotoSnowliftAds','PhotoStreamCache','PhotosUtils','PhotoTagSearchPivotLogger','PhotoViewer','PhotoWarningScreen','PhotoWarningScreenMixin','ReactComponentRenderer','Rect','ScriptPath','ScrollableArea','SnowliftVideoPivotsCarouselController','Style','Toggler','Tooltip','TrackingNodes','TrackingNodeTypes','UFIFeedbackTargets','UFIRootRegistry','UFIUIEvents','UIPagelet','URI','UserAgent_DEPRECATED','Vector','VideoPermalinkURI','VideoPlayerAbortLoadingExperiment','VideoPlayerReason','arrayContains','classWithMixins','computeRelativeURI','emptyFunction','ge','getActiveElement','goURI','isNode','mixin','tickerPhoteSnowLiftOpenStatus','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g,h,i,j,k){var l,m;if(c.__markCompiled)c.__markCompiled();var n=c('PhotoWarningScreenConfig').GraphicEvents,o='WWW_SNOWLIFT_ACTIONS_FUNNEL',p=74,q=75,r=70,s=76,t=315,u=new RegExp('\\/posts\\/(\\d+)\\/?$');l=babelHelpers.inherits(v,c('classWithMixins')(c('PhotoViewer'),c('mixin')(c('PhotoWarningScreenMixin'))));m=l&&l.prototype;function v(){'use strict';m.constructor.call(this);this._seenTags={};this._navCount=0;this._isZoomOn=false;this.clearAlbumBoundaries();}v.prototype.preload=function(w,x){'use strict';c('Bootloader').loadModules(["PhotoTagger","Live","PhotoTagApproval","PhotoTags","TagTokenizer","css:fb-photos-snowlift-fullscreen-css"],function(y){this.PhotoTagger=y;}.bind(this));};v.prototype.bootstrap=function(w,x){'use strict';this.preload(w,x);this._href=w;this._elem=x;if(this.closeDirty){setTimeout(this.bootstrap.bind(this,w,x),0);return;}c('PhotoSnowliftAds').reset();this.resetUriStack=true;if(this.isOpen)if(this.openExplicitly){this.closeCleanup();this.resetUriStack=false;}else return;this._dataFt=null;var y=c('Parent').byAttribute(x,'data-cursor');if(y){try{var aa=JSON.parse(y.getAttribute('data-ft'));this._dataFt={qid:aa.qid,mf_story_key:aa.mf_story_key};}catch(z){}}else try{y=c('Parent').byAttribute(x,'data-ad');var ba=JSON.parse(y.getAttribute('data-ad'));this._dataFt={ad_id:ba.adid};}catch(z){}c('ScriptPath').openOverlayView('snowlift');this.returningToStart=false;this.loading&&c('CSS').removeClass(this.loading,'loading');if(x){c('CSS').addClass(this.loading=x,'loading');var ca=c('Parent').byClass(x,'uiStreamStory')||c('Parent').bySelector(x,"._5jmm");if(ca){this.storyID=ca.id;}else{var da=c('Parent').bySelector(x,"._5b9c");if(da)this.storyID=da.getAttribute('data-ownerid');}this._updateContainerOwnerID();this.getThumbAndSize(x);}else this.loading=null;c('Arbiter').inform('PhotoSnowlift.GO',w,c('Arbiter').BEHAVIOR_STATE);this.loadFrameIfUninitialized();this._setupNextItemUI();};v.prototype._updateContainerOwnerID=function(){'use strict';if(this.container)if(this.storyID){this.container.setAttribute('data-ownerid',this.storyID);}else this.container.removeAttribute('data-ownerid');};v.prototype.setupFromSnowflake=function(w,x){'use strict';this.extraClasses=w;this.snowflake=true;this.firstInSet=x;if(this.root){c('CSS').addClass(this.root,"snowflake");this.extraClasses.forEach(function(y){c('CSS').addClass(this.root,y);},this);}};v.prototype.getCurrentImageServerSizeDimensions=function(){'use strict';var w=this.stream.getCurrentImageData();return w.originalDimensions||w.dimensions;};v.prototype.getEventPrefix=function(){'use strict';return 'PhotoSnowlift';};v.prototype.getRoot=function(){'use strict';return this.root;};v.prototype.getSourceString=function(){'use strict';return 'snowlift';};v.prototype.getViewerSource=function(){'use strict';return this.source;};v.prototype.getViewerSet=function(){'use strict';return this.stream.getPhotoSet();};v.prototype.getVersionConst=function(){'use strict';return c('PhotosConst').VIEWER_SNOWLIFT;};v.prototype.getImage=function(){'use strict';return this.image;};v.prototype.getImageId=function(){'use strict';return this.stream.getCursor();};v.prototype.getRHCHeader=function(){'use strict';return this.rhcHeader;};v.prototype.getRHCBody=function(){'use strict';return this.ufiForm;};v.prototype.getRHCFooter=function(){'use strict';return this.rhcFooter;};v.prototype.getLoadQuery=function(){'use strict';return this.loadQuery;};v.prototype.getCurrentPhotoInfo=function(){'use strict';var w=this.stream.getCurrentImageData();if(w)return w.info;return null;};v.prototype.getOwnerId=function(){'use strict';var w=this.stream.getCurrentImageData();if(w)return w.info.owner;return null;};v.prototype.getThumbAndSize=function(w){'use strict';this.currentImageSize=null;this.thumbSrc=null;var x=new (c('URI'))(w.getAttribute('ajaxify')).getQueryData();if(!x.size)return;var y=c('Vector').deserialize(x.size);if(!y.x||!y.y)return;this.currentImageSize=y;if(w.getAttribute('data-cropped'))return;var z=c('DOM').scry(w,'img')[0],aa=c('DOM').scry(w,'i')[0],ba=c('Parent').byAttribute(w,'data-size');this.shouldStretch=ba&&this.currentImageSize&&z&&ba.getAttribute('data-size')==="2"&&this.currentImageSize.x>this.currentImageSize.y&&this.currentImageSize.x<=v.TIMELINE_STRETCH_WIDTH&&z.offsetWidth===v.TIMELINE_STRETCH_WIDTH;var ca;if(z){ca=z.src;}else if(aa){ca=c('Style').get(aa,'backgroundImage').replace(/.*url\("?([^"]*)"?\).*/,'$1');}else return;this.thumbSrc=ca;};v.prototype.loadFrameIfUninitialized=function(){'use strict';if(this.root)return;new (c('AsyncRequest'))('/ajax/photos/snowlift/init.php').setAllowCrossPageTransition(true).setMethod('GET').setReadOnly(true).send();};v.prototype.init=function(w,x){'use strict';this.init=c('emptyFunction');this._shouldLog=x.photos_client_loading;this._logger=null;if(this._shouldLog)this._logger=new (c('PhotoLogger'))(c('PhotosConst').VIEWER_SNOWLIFT_STRING);this._showHover=x.pivot_hover;this._showMorePhotos=x.show_more_photos;this._extraSlidePivot=x.extra_slide_pivot;c('PhotoSessionLog').setEndMetrics(x.pivot_end_metric);this.startingMousePos=null;this.haveLeftBufferRegion=false;this.showingTypeaheadSuggestions=false;this.fullscreen=c('FullScreen').isSupportedWithKeyboardInput();this.showOGVideos=x.og_videos;this.resizeCommentsForAds=x.resize_comments_for_ads;this._canSeeGraphicWarning=!!x.can_see_graphic_warning;this.initGraphicWarningDOM(x.graphic_warning_markup);this.spotlight=w;this.spotlight.subscribe('blur',function(){this.closingAction=c('PhotoSessionLog').OUTSIDE;}.bind(this));this.spotlight.subscribe('hide',this.closeHandler.bind(this));this.spotlight.subscribe('key',this.keyHandler.bind(this));this.initializeNodes(this.spotlight.getRoot());c('PhotoSnowliftAds').init(this.sideAdUnit,this,x,this.adsDisplayedCallback.bind(this));this.inAdsDisplayedCallback=false;this.lastAdsHeight=0;if(!this.subscription){c('LinkController').registerHandler(this.handleNavigateAway.bind(this));this.subscription=c('Arbiter').subscribe('PhotoSnowlift.GO',function(y,z){this.openExplicitly=true;this.loading&&c('CSS').removeClass(this.loading,'loading');this.open(z);}.bind(this));}this.transitionHandlerRegistered=false;this.returningToStart=false;c('PageTransitions').registerHandler(this.openHandler.bind(this));this.openHandlerRegistered=true;c('Arbiter').subscribe('PhotoTagApproval.HILITE_TAG',this.onHiliteTag.bind(this));c('Arbiter').subscribe('PhotoTagApproval.UPDATE_TAG_BOX',this.onUpdateTagBox.bind(this));if(this.fullscreen)c('FullScreen').subscribe('changed',this.onFullScreenChange.bind(this));this.buttonTruncateGk=x.snowlift_button_truncate;this._hasZoomCapability=this._hasZoomCapability&&x.www_panorama_viewer;this.allowIrrelevantRequests=!!x.snowlift_allow_irrelevant_requests;if(this.snowflake){c('CSS').addClass(this.root,"snowflake");this.extraClasses.forEach(function(y){c('CSS').addClass(this.root,y);},this);}this._setupNextItemUI();};v.prototype.onFullScreenChange=function(){'use strict';if(!this.isOpen)return;var w=c('FullScreen').isFullScreen();c('CSS').conditionClass(document.body,'fbPhotoSnowliftFullScreenMode',w);if(w){this.lastFullscreenEnter=Date.now();if(!c('CSS').hasClass(this.root,'fbPhotoSnowliftEditMode'))this.collapseRHC();var x=this.stream.getCurrentImageData();if(x&&x.url&&this.image.src!==x.url&&this.shouldShowHiRes(x))this.switchImage(x.url);this.adjustForResize();if(!this._isZoomOn)this._conditionDisplayZoomInButton();}else{if(!this._isZoomOn)this.uncollapseRHC();if(c('UserAgent_DEPRECATED').chrome()&&this.lastPage>this.lastFullscreenEnter&&!c('CSS').hasClass(this.root,'fbPhotoSnowliftEditMode'))this.page(0,false);c('Arbiter').inform('reflow');}c('Toggler').hide();};v.prototype.initializeNodes=function(w){'use strict';this.root=w;this.container=c('DOM').find(w,'div.fbPhotoSnowliftContainer');this._updateContainerOwnerID();this.snowliftPopup=c('DOM').find(this.container,'div.fbPhotoSnowliftPopup');this.rhc=c('DOM').find(this.snowliftPopup,'div.rhc');this.rhcHeader=c('DOM').find(this.rhc,'div.rhcHeader');this.rhcFooter=c('DOM').find(this.rhc,'div.rhcFooter');this.taglist=c('DOM').find(this.rhc,'span.fbPhotoTagList');this.ufiForm=c('DOM').find(this.rhc,'form.fbPhotosSnowliftFeedbackForm');this.ufiInputContainer=c('DOM').find(this.rhc,'div.fbPhotosSnowboxFeedbackInput');this.scroller=c('DOM').find(this.ufiForm,'div.rhcScroller');this.scrollerBody=c('DOM').find(this.scroller,'div.uiScrollableAreaBody');this.stageWrapper=c('DOM').find(this.snowliftPopup,'div.stageWrapper');this.overlay=c('DOM').find(this.snowliftPopup,'div.snowliftOverlay');this.errorBox=c('DOM').find(this.stageWrapper,'div.stageError');this.image=c('DOM').find(this.stageWrapper,'img.spotlight');this.stage=c('DOM').find(this.stageWrapper,'div.stage');this.showZoomInButton=c('DOM').scry(this.stageWrapper,"._5qmg").pop();this.showZoomOutButton=c('DOM').scry(this.stageWrapper,"._5qmh").pop();this.zoomedImage=c('DOM').scry(this.stage,"._10zw").pop();this.outerImageSlider=c('DOM').scry(this.stage,"._10zx").pop();this.innerImageSlider=c('DOM').scry(this.stage,"._10zv").pop();this._hasZoomCapability=this.showZoomInButton&&this.showZoomOutButton&&this.zoomedImage&&this.outerImageSlider&&this.innerImageSlider;if(this._hasZoomCapability){c('CSS').hide(this.showZoomInButton);c('CSS').hide(this.showZoomOutButton);c('CSS').hide(this.zoomedImage);c('CSS').hide(this.outerImageSlider);}this.videoStage=c('DOM').find(this.stageWrapper,'div.videoStage');this.prevPager=c('DOM').find(this.snowliftPopup,'a.snowliftPager.prev');this.nextPager=c('DOM').find(this.snowliftPopup,'a.snowliftPager.next');this.upPager=c('DOM').find(this.container,'a.snowliftPager.up');this.downPager=c('DOM').find(this.container,'a.snowliftPager.down');this.stageActions=c('DOM').find(w,'div.stageActions');this.buttonActions=c('DOM').find(this.stageActions,'div.fbPhotosPhotoButtons');this.placeInfo=c('DOM').find(this.rhc,'div.fbPhotosSnowliftPlaceInfo');this.sideAdUnit=c('DOM').find(w,"._5ciw");c('CSS').conditionClass(this.root,'fullScreenAvailable',this.fullscreen);};v.prototype.getGraphicWarningContainer=function(){'use strict';return this.stageWrapper;};v.prototype.getGraphicWarningHiddenContent=function(){'use strict';return this.stage;};v.prototype.initializeScroller=function(){'use strict';this.initializeScroller=c('emptyFunction');c('CSS').addClass(this.scroller,"_467y");this.scrollableArea=c('ScrollableArea').fromNative(this.scroller,{fade:true,persistent:true});var w=function(event){var x=c('Event').$E(event).getTarget();if(c('DOM').contains(this.ufiInputContainer,x)){var y=c('DOMControl').getInstance(x);if(y){this.scrollableArea.scrollToBottom();var z=y.subscribe('resize',function(){var ba=this.scrollableArea.isScrolledToBottom();this.adjustScroller();ba&&this.scrollableArea.scrollToBottom();}.bind(this)),aa=c('Event').listen(x,'blur',function(){y.unsubscribe(z);aa.remove();});}}if(x.classList.contains('UFIPagerLink')||x.classList.contains('UFICommentLink'))if(this.autoplayOptionScreenConfig&&this.autoplayOptionScreenConfig.enabled)this.haltAutoplay=true;}.bind(this);c('Arbiter').subscribe(c('UFIUIEvents').InputHeightChanged,function(x,y){if(c('DOM').contains(this.ufiInputContainer,y.node))this.adjustScroller();}.bind(this));c('Arbiter').subscribe(c('UFIUIEvents').PhotoPreviewHeightChanged,function(x,y){if(!y.node||c('DOM').contains(this.ufiInputContainer,y.node))this.adjustScroller();}.bind(this));c('Arbiter').subscribe(c('UFIUIEvents').Changed,function(x,y){if(this.ufiForm===y.form)this.adjustScrollerIfNecessary();}.bind(this));c('Arbiter').subscribe(c('UFIUIEvents').Comment,function(x,y){if(this.ufiForm===y.form){this.adjustScrollerIfNecessary();if(y.isinverted){this.scrollableArea.scrollToTop();}else this.scrollableArea.scrollToBottom();}}.bind(this));c('Event').listen(this.rhc,'click',function(event){var x=event.getTarget();if(c('Parent').byTag(x,'a')||c('Parent').byTag(x,'button')||c('DOM').isNodeOfType(x,'input'))this.adjustScrollerIfNecessary();}.bind(this));c('Arbiter').subscribe(['reflow',c('UFIUIEvents').CommentPager],function(){if(this.isOpen)this.adjustScrollerIfNecessary();}.bind(this));c('Arbiter').subscribe(c('UFIUIEvents').TranslationRendered,function(){this.adjustScrollerIfNecessary();}.bind(this));c('Event').listen(this.ufiForm,'focusin',w);};v.prototype.openHandler=function(w){'use strict';if(this.isOpen||!c('PhotoPermalinkURI').isValid(w)||this.returningToStart||w.getQueryData().closeTheater||w.getQueryData().permPage){this.openHandlerRegistered=false;return false;}this.open(w);this._uriStack.push(new (c('URI'))(w).getQualifiedURI().toString());c('PageTransitions').transitionComplete(true);return true;};v.prototype.addHaltAutoplaySubscription=function(){'use strict';c('Arbiter').subscribe([c('UFIUIEvents').Focus],function(){this.haltAutoplay=true;}.bind(this));c('Arbiter').subscribe([c('UFIUIEvents').Blur],function(w,x){this.haltAutoplay=x.hasEnteredText;}.bind(this));};v.prototype.open=function(w){'use strict';var x=new (c('URI'))(w),y=x.getQueryData(),z=c('PhotoPermalinkURI').parse(x);if(z!==null){y.fbid=z.photo_id;y.set=z.set_token;}var aa=c('VideoPermalinkURI').parse(x);if(aa!==null){y.v=aa.video_id;y.set=aa.set_token;}if(!y.fbid&&!y.v&&!y.pid){var ba=u.exec(x.getPath());if(ba)y.v=ba[1];}if(this.resetUriStack)this._uriStack=[];if(!this.initialLoad){y.firstLoad=true;this.initialLoad=true;c('LitestandStoryInsertionStatus').registerBlocker(function(){return this.isOpen;}.bind(this));c('tickerPhoteSnowLiftOpenStatus').registerOpenChecker(function(){return this.isOpen;}.bind(this));}this.sessionID=Date.now();this.loadQuery=Object.assign(y,{ssid:this.sessionID});if(this._dataFt)this.loadQuery.data_ft=this._dataFt;this.isOpen=true;this.pagersShown=false;this.refreshOnClose=false;this.hilitedTag=null;this.loadingStates={image:false,html:false};this.replaceUrl=false;this.movementDelta=0;this.pivotsCarouselElement=null;this.autoplayOptionScreenConfig=null;this.haltAutoplay=false;this.shouldRenderVideoPivots=false;c('CSS').show(this.nextPager);c('CSS').show(this.prevPager);this.source=null;this.saveTagSubscription=c('Arbiter').subscribe('PhotoTagger.SAVE_TAG',this.onTagSaved.bind(this));this.taggedPhotoIds=[];this.stream=new (c('PhotoStreamCache'))();this.stream.init(c('PhotosConst').VIEWER_SNOWLIFT,'PhotoViewerPagelet','pagelet_photo_viewer',this._shouldLog?this._logger:null,y.tagSuggestionMode||'everyone');if(!!c('URI').getMostRecentURI().getQueryData().viewas)this.stream.setViewAs(c('URI').getMostRecentURI().getQueryData().viewas+'');this.fetchInitialData();this.setLoadingState(v.STATE_HTML,true);this.rhcCollapsed=false;this._open(w);c('Bootloader').loadModules(["PhotosButtonTooltips"],function(ca){ca.init();});};v.prototype._open=function(w){'use strict';this.createLoader();this.spotlight.show();c('Arbiter').inform('layer_shown',{type:'PhotoSnowlift'});c('Arbiter').inform('PhotoSnowlift.OPEN');this.stageHandlers=[c('Event').listen(window,'resize',this.adjustForResize.bind(this)),c('Event').listen(this.stageWrapper,'click',function(event){var z=c('Parent').byAttribute(event.getTarget(),'data-ft');if(!z)return;try{var ba=JSON.parse(z.getAttribute('data-ft'));if(!ba.tn)return;var ca=c('TrackingNodes').parseTrackingNodeString(ba.tn),da=Object.keys(c('TrackingNodeTypes')).filter(function(ea){return c('TrackingNodeTypes')[ea]===ca;});if(da.length)c('FunnelLogger').appendAction(o,'click_'+da.join('_'));}catch(aa){}}),c('Event').listen(this.stageWrapper,'click',this.buttonListener.bind(this)),c('Event').listen(this.stageWrapper,'mouseleave',function(event){var z=event.getTarget();if(!(c('Parent').byClass(z,'snowliftOverlay')||c('Parent').byClass(z,'fbPhotoSnowliftTagApproval')||c('Parent').byClass(z,'tagPointer')||c('Parent').byClass(z,'arrow')||c('Parent').byClass(z,'faceboxSuggestion')||c('Parent').byClass(z,'typeaheadWrapper')||c('Parent').byClass(z,'photoTagTypeahead')||c('Parent').byClass(z,'fbPhotoTagger')))this.unhiliteAllTags();this.hidePagers();}.bind(this)),c('Event').listen(this.stageWrapper,'mousemove',this.hilitePager.bind(this)),c('Event').listen(this.root,'mousemove',this.hiliteProductItemPager.bind(this)),c('Event').listen(this.stageWrapper,'mousemove',this.hiliteTagsOnMouseMove.bind(this)),c('Event').listen(this.overlay,'mouseenter',this.unhiliteAllTags.bind(this)),c('Event').listen(this.container,'mousemove',this._enableMouseOver.bind(this)),c('Event').listen(this.container,'mouseover',this._interceptMouseOver.bind(this)),c('Event').listen(this.stageWrapper,'focusin',this.hilitePager.bind(this)),c('Event').listen(this.root,'focusin',this.hiliteProductItemPager.bind(this)),c('Event').listen(this.rhc,'focusin',this.hidePagers.bind(this))];if(this._hasZoomCapability){this.stageHandlers.push(c('Event').listen(this.stage,'mousedown',this._zoomedImageMouseDown.bind(this)));this.stageHandlers.push(c('Event').listen(this.root,'mouseup',this._zoomedImageMouseUp.bind(this)));}this.stageHandlers.push(c('Event').listen(this.root,'click',function(event){var z=event.getTarget();if(c('Parent').bySelector(z,"._418x")){if(c('FullScreen').isFullScreen()){c('FunnelLogger').appendActionWithTagIfNew(o,'fullscreen_exit','fbPhotoSnowlift/close');c('FullScreen').toggleFullScreen();return;}this.closingAction=c('PhotoSessionLog').X;this.spotlight.hide();}}.bind(this)),c('Event').listen(this.container,'click',function(event){var z=event.getTarget();if(c('Parent').byClass(z,'rotateRight')){c('FunnelLogger').appendActionWithTag(o,'rotate_image','right');this.rotate('right');}else if(c('Parent').byClass(z,'rotateLeft')){c('FunnelLogger').appendActionWithTag(o,'rotate_image','left');this.rotate('left');}else if(c('Parent').bySelector(z,"._32_l")){c('FunnelLogger').appendAction(o,'click-pivot-item');var aa=c('Parent').bySelector(z,"._32_l"),ba=aa.getAttribute('data-fbid'),ca=this.stream.getCursor(),da=this.stream.calculateDistance(ca,ba),ea=this.stream.fbidList.indexOf(ba);c('SnowliftVideoPivotsCarouselController').adjustCarousel(ea);this.page(da,false);this.haltAutoplay=false;this.removeAutoplayOptionScreen();}else if(this.fullscreen)if(c('Parent').byClass(z,'fbPhotoSnowliftFullScreen')){c('FunnelLogger').appendActionWithTagIfNew(o,c('FullScreen').isFullScreen()?'fullscreen_exit':'fullscreen_enter','fbPhotoSnowliftFullScreen');this.toggleFullScreen();}else if(c('Parent').byClass(z,'fbPhotoSnowliftCollapse')){this.toggleCollapse();c('FunnelLogger').appendAction(o,'toggle_collapse-rhc');}}.bind(this)));var x=c('ge')('fbPhotoSnowliftFeedback');if(x)this.stageHandlers.push(c('Event').listen(x,'click',function(event){var z=event.getTarget();if(c('Parent').byClass(z,'like_link')||c('Parent').byClass(z,'UFILikeLink')&&c('Parent').byClass(z,'UIActionLinks'))this.toggleLikeButton();var aa=c('Parent').byClass(event.getTarget(),'uiUfiCollapsedComment');if(aa){c('FunnelLogger').appendActionWithTag(o,'like-photo','snowlift-feedback');c('CSS').addClass(aa,'uiUfiCollapsedCommentToggle');}}.bind(this)));var y=c('ge')('fbPhotoSnowliftOnProfile');if(y)this.stageHandlers.push(c('Event').listen(y,'click',function(event){if(c('Parent').byClass(event.getTarget(),'fbPhotoRemoveFromProfileLink'))this.refreshOnClose=true;}.bind(this)));if(this.resetUriStack)this.startingURI=c('URI').getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI();this.setLoadingState(v.STATE_IMAGE_DATA,true);if(!this.transitionHandlerRegistered){c('PageTransitions').registerHandler(this.transitionHandler.bind(this));this.transitionHandlerRegistered=true;}c('PhotoSessionLog').initLogging(c('PhotoSessionLog').SNOWLIFT);if(this.pivots)c('PhotoSessionLog').setRelevantCount(this.pivots.relevantCount);};v.prototype.toggleFullScreen=function(){'use strict';var w=c('FullScreen').toggleFullScreen(document.documentElement);if(w){var x=this.stream.getCurrentImageData();if(x&&x.url&&this.image.src!==x.url&&this.shouldShowHiRes(x))if(!this._log(x.url))new Image().src=x.url;c('PhotoSessionLog').logEnterFullScreen(this.stream.getCursor());}};v.prototype.getStream=function(){'use strict';return this.stream;};v.prototype.fetchInitialData=function(){'use strict';this.stream.waitForInitData();var w=this.loadQuery.within_business?this.loadQuery.business_thread_id:this.loadQuery.fbid;c('UIPagelet').loadFromEndpoint('PhotoViewerInitPagelet',c('ge')('pagelet_photo_viewer_init',this.root),this.loadQuery,{actorID:c('UFIFeedbackTargets').getActorIDForFeedbackTargetIfExists(w),usePipe:true,jsNonblock:true,crossPage:true,allowIrrelevantRequests:this.allowIrrelevantRequests});};v.prototype.toggleCollapse=function(){'use strict';if(this.rhcCollapsed){this.uncollapseRHC();}else this.collapseRHC();};v.prototype.collapseRHC=function(){'use strict';this.rhcCollapsed=true;c('CSS').addClass(this.root,'collapseRHC');this.adjustForResize();};v.prototype.uncollapseRHC=function(){'use strict';this.rhcCollapsed=false;c('CSS').removeClass(this.root,'collapseRHC');this.adjustForResize();};v.prototype.closeHandler=function(){'use strict';if(!this.isOpen)return;this.closingAction=this.closingAction||c('PhotoSessionLog').ESC;if(c('URI').getMostRecentURI().addQueryData({closeTheater:1}).getUnqualifiedURI().toString()==this.startingURI.toString()){this.close();return;}this.returnToStartingURI(this.refreshOnClose);this.close();};v.prototype.returnToStartingURI=function(w,x){'use strict';if(!w)if(x){this.squashNextTransition(c('goURI').bind(null,x));}else this.squashNextTransition();this.returningToStart=true;var y=c('Arbiter').subscribe('page_transition',function(){this.returningToStart=false;y.unsubscribe();}.bind(this)),z=w||isNaN(c('UserAgent_DEPRECATED').opera()),aa=this._uriStack.length;if(z&&aa<window.history.length){window.history.go(-aa);}else{var ba=this.startingURI,ca=new (c('URI'))(ba).removeQueryData('closeTheater');if(ba.getQueryData().sk=='approve'&&ba.getPath()=='/profile.php'){ca.removeQueryData('highlight');ca.removeQueryData('notif_t');}c('goURI')(ca);}};v.prototype.squashNextTransition=function(w){'use strict';this.squashNext=true;c('PageTransitions').registerHandler(function x(){if(this.squashNext){this.squashNext=false;if(w)setTimeout(w,0);c('PageTransitions').transitionComplete(true);return true;}return false;}.bind(this),7);};v.prototype.handleNavigateAway=function(w){'use strict';var x=c('computeRelativeURI')(c('PageTransitions').getMostRecentURI().getQualifiedURI(),w.getAttribute('href'));if(this.isOpen&&x instanceof c('URI')&&x.getUnqualifiedURI().toString()!=this.startingURI.toString()&&x.getPath()!='/photo.php'){if(!this.closingAction)this.closingAction=c('PhotoSessionLog').NAVIGATE;this.returnToStartingURI(false,x);this.close();return false;}return true;};v.prototype.postProcessTaggedPhotos=function(){'use strict';if(this.taggedPhotoIds&&this.taggedPhotoIds.length>0){var w=null;if(this.source===v.COLLECTIONS_UNTAGGED_PHOTOS){w='/ajax/photos/photo/edit/skiptag/';}else if(this.source===v.PHOTOS_OF_YOU_SUGGESTIONS||this.source===v.FRIENDS_IN_PHOTOS_SUGGESTIONS)w='/ajax/photos/photo/add_to_star_grid/';if(w)new (c('AsyncRequest'))().setURI(w).setAllowCrossPageTransition(true).setData({media_id:this.taggedPhotoIds,source:this.source}).send();}};v.prototype.onTagSaved=function(w,x){'use strict';if(this.taggedPhotoIds){if(this.source===v.PHOTOS_OF_YOU_SUGGESTIONS&&!x.self_tag)return;this.taggedPhotoIds.push(x.photo_fbid);}};v.prototype.clearAlbumBoundaries=function(){'use strict';this._albumBoundaries={start:0,end:0,dir:0};};v.prototype.close=function(){'use strict';if(!this.isOpen)return;c('FunnelLogger').appendActionWithTag(o,'close_snowlift',c('PhotoSessionLog').closingTypeToString(this.closingAction));c('FunnelLogger').endFunnel(o);this._albumFBID=null;this.hideMorePhotos();this.hidePivotSlide();this._pauseVideoIfNeeded();this.isOpen=false;this._navCount=0;this.clearAlbumBoundaries();if(this.fullscreen)c('FullScreen').disableFullScreen();c('CSS').removeClass(document.body,'fbPhotoSnowliftFullScreenMode');c('ScriptPath').closeOverlayView('snowlift');this.spotlight.hide();this.openExplicitly=false;this.postProcessTaggedPhotos();c('Arbiter').unsubscribe(this.saveTagSubscription);this.taggedPhotoIds=[];this.closeDirty=true;c('setTimeoutAcrossTransitions')(this.closeCleanup.bind(this),0);if(this.snowflake){c('CSS').removeClass(this.root,"snowflake");this.extraClasses.forEach(function(w){c('CSS').removeClass(this.root,w);},this);}c('UFIRootRegistry').cleanupSnowliftNodes();this.extraClasses=[];this.snowflake=false;this.firstInSet=null;this.movementDelta=0;};v.prototype.closeCleanup=function(){'use strict';this.closeDirty=false;c('CSS').removeClass(this.root,'dataLoading');c('PhotoSessionLog').logPhotoViews(this.closingAction);this.destroy();c('CSS').hide(this.errorBox);c('CSS').hide(this.image);this.currentImageSize=null;this.thumbSrc=null;this.shouldStretch=false;this.resetUriStack=true;var w=this.stream.getCursor();if(c('VideoPlayerAbortLoadingExperiment').canAbort){var x;for(x=0;x<this.stream.getLength();x++){var y=this.stream.getImageData(this.stream.getCursorAt(x));if(y&&y.video)y.controller.abortLoading();}}c('CSS').removeClass(this.stageWrapper,'showVideo');c('DOM').empty(this.videoStage);this.uncollapseRHC();this.currentMinSize=null;this.setStagePagersState('reset');this.recacheData();c('DOM').empty(this.sideAdUnit);this.stream.destroy();this.root.setAttribute('aria-busy','true');var z=this.closingAction===c('PhotoSessionLog').NAVIGATE;this.closingAction=null;if(!this.openHandlerRegistered){c('PageTransitions').registerHandler(this.openHandler.bind(this));this.openHandlerRegistered=true;}c('Arbiter').inform('layer_hidden',{type:'PhotoSnowlift'});c('Arbiter').inform('PhotoSnowlift.CLOSE',{is_navigating:z,fbid:w});this._setZoomOut();this._previousZoomScrollPercent=null;};v.prototype.createLoader=function(w){'use strict';if(this.currentImageSize===null){this.adjustStageSize(v.STAGE_MIN);}else{var x=this.getStageSize(this.currentImageSize);x=new (c('Vector'))(Math.max(x.x,this.getMinimumStageWidth()),Math.max(x.y,v.STAGE_MIN.y));var y=this.getImageSizeInStage(this.currentImageSize,x);if(this.thumbSrc===null){this.adjustStageSize(y);}else this.useImage(c('DOM').create('img',{className:'spotlight',alt:'',src:this.thumbSrc,style:{width:y.x+'px',height:y.y+'px'}}),y,false);}this.setLoadingState(this.STATE_IMAGE_PIXELS,true);if(w)setTimeout(function(){var z=function(){var da=arguments.length<=0||arguments[0]===undefined?null:arguments[0];if(!this.isOpen)return;if(!this.stream||!this.stream.errorInCurrent()){this.switchImage(da?da:w,this.currentImageSize);this.setLoadingState(v.STATE_IMAGE_DATA,false);}}.bind(this);if(c('EncryptedImg').isEncrypted(w)){c('EncryptedImg').load(w,z);}else{var aa=new Image(),ba=c('Event').listen(aa,'load',z),ca=function(){if(ba){ba.remove();ba=null;}};c('Arbiter').subscribeOnce('PhotoSnowlift.SWITCH_IMAGE',ca);c('Arbiter').subscribeOnce('PhotoSnowlift.CLOSE',ca);aa.src=w;}this._log(w);}.bind(this),0);c('CSS').hide(this.stageActions);this.setStagePagersState('disabled');};v.prototype.initDataFetched=function(w){'use strict';c('PhotoSessionLog').setPhotoSet(this.stream.getPhotoSet());c('PhotoSessionLog').setLogFbids(w.logids);if(w.eid)c('PhotoSessionLog').setEid(w.eid);this._albumBoundaries.start=this.stream.getCursor();var x=this.stream.getCurrentImageData();c('PhotoSessionLog').addPhotoView(x.info,this.shouldShowHiRes(x),this.fullscreen&&c('FullScreen').isFullScreen());var y=this.stream.getCurrentExtraData();if(this._showHover&&y)c('PhotoTagSearchPivotLogger').logImageImpression('snowlift',String(this.stream.getCursor()),Object.keys(y.tagRects));if(y&&y.source!==undefined){this.source=parseInt(y.source,10);c('PhotoSessionLog').setSource(this.source);}if(!this.pageHandlers)this.pageHandlers=[c('Event').listen(this.root,'click',this.pageListener.bind(this)),c('Event').listen(this.root,'mouseleave',this.mouseLeaveListener.bind(this))];c('CSS').show(this.stageActions);this.root.setAttribute('aria-busy','false');this.isLoggedInViewer=w.loggedin;this.disableAds=!this.isLoggedInViewer||w.fromad||w.withinbusiness||this.stream.isInViewAsMode();this.loadAds();if(this._isZoomAvailable(x)){c('PhotoSessionLog').addPanoramaImpression();var z=new (c('Vector'))(this.stage.clientWidth,this.stage.clientHeight);this._displayZoomInButton(z);}else if(this._hasZoomCapability)c('CSS').hide(this.showZoomInButton);};v.prototype.adjustScrollerIfNecessary=function(){'use strict';clearTimeout(this.scrollerTimeout);this.scrollerTimeout=setTimeout(this.adjustScroller.bind(this),0);};v.prototype.adjustScroller=function(w){'use strict';clearTimeout(this.scrollerTimeout);this.initializeScroller();this.scrollableArea.resize();var x=c('Vector').getElementDimensions(this.rhc),y=x.y;y-=c('Vector').getElementDimensions(this.rhcHeader).y;y-=c('Vector').getElementDimensions(this.ufiInputContainer).y;if(this.placeInfo){var z=c('Vector').getElementDimensions(this.placeInfo);y-=z.y;c('Style').set(this.sideAdUnit,'bottom',z.y+'px');}if(w==null)w=this.resizeCommentsForAds?this.lastAdsHeight:0;this.lastAdsHeight=w;y=Math.max(0,y);var aa=c('Vector').getElementDimensions(this.scrollerBody).y,ba=Math.max(v.MIN_UFI_HEIGHT,y-w);if(aa>=ba){if(y>ba){c('CSS').removeClass(this.rhc,'pinnedUfi');y-=ba;}else{c('CSS').addClass(this.rhc,'pinnedUfi');y=0;}c('Style').set(this.scroller,'height',ba+'px');}else{c('Style').set(this.scroller,'height','auto');c('CSS').removeClass(this.rhc,'pinnedUfi');y-=aa;}var ca=c('Vector').getElementDimensions(this.ufiInputContainer).y;c('Style').set(this.ufiForm,'padding-bottom',ca+'px');c('PhotoSnowliftAds').resize(new (c('Vector'))(x.x,y));this.scrollableArea.adjustGripper();};v.prototype.adjustForResize=function(){'use strict';this.currentMinSize=null;this.adjustStageSize();this.adjustForNewData();if(this._hasZoomCapability){if(!this._isZoomOn)this._conditionDisplayZoomInButton();this._scrollZoomedImageToPercent(this._previousZoomScrollPercent);}};v.prototype.shouldShowHiRes=function(w){'use strict';if(!w||!w.smallurl)return false;var x=this.getStageSize(w.dimensions);x=this._adjustStageSizeForPixelRatio(x);var y=this.getImageSizeInStage(w.dimensions,x);return (y.x>v.STAGE_NORMAL_MAX.x||y.y>v.STAGE_NORMAL_MAX.y);};v.prototype._adjustStageSizeForPixelRatio=function(w){'use strict';if(window.devicePixelRatio&&window.devicePixelRatio>1)w=new (c('Vector'))(w.x*window.devicePixelRatio,w.y*window.devicePixelRatio);return w;};v.prototype.getImageURL=function(w){'use strict';if(w.video){return null;}else if(w.smallurl&&!this.shouldShowHiRes(w))return w.smallurl;return w.url;};v.prototype.getImageOrVideoDimensions=function(w){'use strict';if(w.video){var x=this.getVideoElement(w.video);if(x)return this.getVideoSize(x);}return this.getImageDimensions(w);};v.prototype.getImageDimensions=function(w){'use strict';if(this._isZoomOn)return w.originalDimensions;if(w.smalldims&&(!this.shouldShowHiRes(w)||this.image.src===w.smallurl))return w.smalldims;return w.dimensions;};v.prototype.getStageSize=function(w,x){'use strict';var y=c('Vector').getViewportDimensions(),z=new (c('Vector'))(w.x,w.y+this.getExtraVerticalSpace());if(x)z=new (c('Vector'))(Math.max(w.x,x.x),Math.max(w.y,x.y));var aa,ba;if(this.fullscreen&&c('FullScreen').isFullScreen()){ba=screen.height-v.FULL_SCREEN_PADDING*2;return new (c('Vector'))(this.rhcCollapsed?screen.width:screen.width-v.SIDEBAR_SIZE_MAX,this._isItemPagerEnabled()?ba-v.PRODUCT_ITEM_PAGER_HEIGHT_OFFSET:ba);}else{aa=Math.min(z.x,y.x-v.SIDEBAR_SIZE_MAX-v.STAGE_CHROME.x);var ca=y.y-v.STAGE_CHROME.y;ba=Math.min(z.y,this._isItemPagerEnabled()?ca-v.PRODUCT_ITEM_PAGER_HEIGHT_OFFSET:ca);}if(aa===0&&ba===0)return new (c('Vector'))(0,0);var da=aa/ba,ea=z.x/z.y;if(da<ea)return new (c('Vector'))(aa,Math.round(aa/ea));return new (c('Vector'))(Math.round(ba*ea),ba);};v.prototype.getExtraVerticalSpace=function(){'use strict';if(this.getVideoOnStage())return v.VIDEO_BOTTOM_BAR_SPACE*2;return 0;};v.prototype.getComponentsHeight=function(){'use strict';var w=this.getVideoOnStage();if(w){var x=c('ge')(w);if(x)return this.getVideoComponentsHeight(x);}return 0;};v.prototype.getMinimumStageWidth=function(){'use strict';var w=v.STAGE_MIN.x;if(this.getVideoOnStage())return w;if(c('PhotoSnowliftActionsGating').ALLOW_MAKE_PROFILE_PICTURE_BUTTON)w+=v.PROFILE_PICTURE_BUTTON_WIDTH;return w;};v.prototype.getImageSizeInStage=function(w,x){'use strict';var y=w.x,z=w.y,aa=this.getComponentsHeight(),ba=this.getExtraVerticalSpace();z-=aa;x=new (c('Vector'))(x.x,x.y-aa-ba);if(y>=x.x||z>=x.y){var ca=x.x/x.y,da=y/z;if(ca<da){y=x.x;z=Math.round(y/da);}else if(ca>da){z=x.y;y=Math.round(z*da);}else{y=x.x;z=x.y;}}return new (c('Vector'))(y,z+aa);};v.prototype.getStageSizeForZoomedImage=function(w,x){'use strict';if(this.fullscreen&&c('FullScreen').isFullScreen()){var y=this.rhcCollapsed?screen.width:screen.width-v.SIDEBAR_SIZE_MAX,z=screen.height-v.FULL_SCREEN_PADDING*2;return new (c('Vector'))(y,z);}var aa=c('Vector').getViewportDimensions();if(x===null)x=new (c('Vector'))(0,0);var ba=new (c('Vector'))(Math.max(w.x,this.getMinimumStageWidth(),x.x),Math.max(w.y,v.STAGE_MIN.y,x.y)),ca=aa.x-v.STAGE_CHROME.x;if(!this.rhcCollapsed)ca-=v.SIDEBAR_SIZE_MAX;y=Math.min(ba.x,ca);z=Math.min(ba.y,aa.y-v.STAGE_CHROME.y);return new (c('Vector'))(y,z);};v.prototype.adjustStageSize=function(w){'use strict';var x=this.currentImageSize;if(w){x=w;}else{var y=this.stream&&this.stream.getCurrentImageData();if(y)x=this.getImageOrVideoDimensions(y);}if(!x)return;this.currentImageSize=x;var z=this.getExtraVerticalSpace();if(this.shouldStretch&&!this.getVideoOnStage()&&x.x>x.y&&x.x<=v.TIMELINE_STRETCH_WIDTH&&x.x>=v.TIMELINE_STRETCH_MIN){x.y=Math.round(x.y*v.TIMELINE_STRETCH_WIDTH/x.x);x.x=v.TIMELINE_STRETCH_WIDTH;}var aa;if(this._isZoomOn){aa=this.getStageSizeForZoomedImage(x,this.currentMinSize);}else aa=this.getStageSize(x,this.currentMinSize);if(!this.currentMinSize)this.currentMinSize=new (c('Vector'))(0,0);this.currentMinSize=new (c('Vector'))(Math.max(aa.x,this.getMinimumStageWidth(),this.currentMinSize.x),Math.max(aa.y,v.STAGE_MIN.y,this.currentMinSize.y));var ba=this.getImageSizeInStage(x,this.currentMinSize),ca=this.currentMinSize.x-ba.x,da=this.currentMinSize.y-ba.y;if(ca>0&&ca<v.PADDING_MIN){this.currentMinSize.x-=ca;}else if(da>0&&da<v.PADDING_MIN)this.currentMinSize.y-=da;var ea=this.currentMinSize.x+v.SIDEBAR_SIZE_MAX;if(this.rhcCollapsed)ea=this.currentMinSize.x;var fa=this.getVideoOnStage()&&this.pivotsCarouselElement,ga=0,ha=this.currentMinSize.y;if(fa){var ia=this.pivotsCarouselElement.clientHeight;ga=Math.ceil(ia/100)*100;ha=ha+ga;}this.snowliftPopup.style.cssText='width:'+ea+'px;'+'height:'+ha+'px;';var ja=this.currentMinSize.y-z,ka=ja+ga;if(c('UserAgent_DEPRECATED').firefox()){var la=c('Style').get(this.stageWrapper,'font-size');ja=ja/parseFloat(la)+'em';ka=ka/parseFloat(la)+'em';}else{ja=ja+'px';ka=ka+'px';}this.stageWrapper.style.cssText='width:'+this.currentMinSize.x+'px;'+'line-height:'+ja+';';if(this.getVideoOnStage())this.videoStage.style.cssText='width:'+this.currentMinSize.x+'px;'+'height:'+ka+';';if(this._isZoomOn){var ma=this.currentMinSize.y-z;if(x.y>ma){var na=x.x/x.y*ma;c('Style').apply(this.zoomedImage,{width:na+"px",height:ma+"px"});}else c('Style').apply(this.zoomedImage,{width:x.x+"px",height:x.y+"px"});}else{ba.y-=this.getComponentsHeight();this.setMediaElementSize(ba);}if(fa)this.setPivotCarouselElementWidth(la);var oa=this.getTagger();if(oa)oa.repositionTagger();this.adjustScrollerIfNecessary();};v.prototype.setMediaElementSize=function(w){'use strict';var x=this.image;if(this.getVideoOnStage())if(this._videoPlayerStateManager&&this._videoPlayerStateManager.setDimensions){this._videoPlayerStateManager.setDimensions(w.x,w.y);}else x=c('DOM').scry(this.videoStage,"._53j5")[0]||x;x.style.cssText='width:'+w.x+'px;'+'height:'+w.y+'px;';};v.prototype.setPivotCarouselElementWidth=function(w){'use strict';var x=this.videoStage.clientWidth;if(c('UserAgent_DEPRECATED').firefox()){x=x/parseFloat(w)+'em';}else x=x+'px';this.pivotsCarouselElement.style.width=x;};v.prototype.adjustForNewData=function(){'use strict';if(!this.image)return;var w=c('DOM').scry(this.stage,'div.tagsWrapper')[0],x=c('Vector').getElementDimensions(this.image);if(w){c('Style').set(w,'width',x.x+'px');c('Style').set(w,'height',x.y+'px');}};v.prototype.adsDisplayedCallback=function(w,x){'use strict';var y=this.resizeCommentsForAds&&!this.inAdsDisplayedCallback&&!this.disableAds&&w<v.MIN_ADS_VISIBLE&&x.length>=v.MIN_ADS_VISIBLE;if(y){this.inAdsDisplayedCallback=true;var z=x[v.MIN_ADS_VISIBLE-1];this.adjustScroller(z);this.inAdsDisplayedCallback=false;}};v.prototype.setLoadingState=function(w,x){'use strict';switch(w){case v.STATE_IMAGE_PIXELS:c('CSS').conditionClass(this.root,'imagePixelsLoading',x);break;case v.STATE_IMAGE_DATA:this.loadingStates[w]=x;c('CSS').conditionClass(this.root,'imageLoading',x);break;case v.STATE_HTML:this.loadingStates[w]=x;c('CSS').conditionClass(this.root,'dataLoading',x);this.rhc.setAttribute('aria-busy',x?'true':'false');break;}};v.prototype.destroy=function(){'use strict';this.stageHandlers.forEach(function(w){w.remove();});if(this.pageHandlers){this.pageHandlers.forEach(function(w){w.remove();});this.pageHandlers=null;}this._videoPlayerStateManager=null;};v.prototype.checkState=function(w){var x=arguments.length<=1||arguments[1]===undefined?false:arguments[1];'use strict';if(w!=v.STATE_ERROR&&!this.loadingStates[w])return;switch(w){case v.STATE_IMAGE_DATA:var y=this.stream.getCurrentImageData();if(y){var z=this.getImageURL(y);if(z){this.switchImage(z,null,true,x);}else if(y.video)this.switchVideo(y.video,true);this.setLoadingState(w,false);}break;case v.STATE_HTML:if(this.stream.getCurrentHtml()){this.swapData();this.setLoadingState(w,false);}break;default:if(this.stream.errorInCurrent()){c('CSS').hide(this.image);c('CSS').show(this.errorBox);}break;}};v.prototype.buttonListener=function(event){'use strict';var w=event.getTarget(),x=Date.now();if(c('Parent').bySelector(w,"._5qmg")){c('PhotoSessionLog').addPanoramaClick();this.switchIntoZoomedImage();c('FunnelLogger').appendAction(o,'zoom_in_image');return;}if(c('Parent').bySelector(w,"._5qmh")){this._setZoomOut();this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));return false;}if(c('Parent').byClass(w,'fbPhotoTagApprovalBox')){c('FunnelLogger').appendAction(o,'approve_photo_tag');return;}if(x-this.lastPage<350)return;if(c('Parent').byClass(w,'fbPhotosPhotoLike')){this.likePhoto();}else if(c('Parent').byClass(w,'tagApproveIgnore')){this.updateTagBox(event,w);c('FunnelLogger').appendAction(o,'ignore_photo_tag');}else if(c('Parent').bySelector(w,"._5ymu")){if(!this._showingMorePhotos){c('PhotoTagSearchPivotLogger').logShowMorePhotos();var y=this.stream.getCursor();if(y)this.showMorePhotos(String(y));if(this._hasZoomCapability)c('CSS').hide(this.showZoomInButton);}else{c('PhotoTagSearchPivotLogger').logHideMorePhotos();this._conditionDisplayZoomInButton();this.hideMorePhotos();}return;}else if(c('Parent').bySelector(w,"._27n"))this._conditionDisplayZoomInButton();this.hideMorePhotos();};v.prototype.likePhoto=function(){'use strict';c('FunnelLogger').appendActionWithTag(o,'like_photo','snowlift-feedback');c('PhotoSessionLog').addButtonLike();var w=c('$')('fbPhotoSnowliftFeedback'),x=c('DOM').scry(w,'button.like_link')[0];if(!x)x=c('DOM').scry(w,'a.UFILikeLink')[0];var y=x.getAttribute('href');if(c('FullScreen').isFullScreen())if(c('UserAgent_DEPRECATED').chrome())x.setAttribute('href','javascript:;');x.click();x.setAttribute('href',y);};v.prototype.toggleLikeButton=function(){'use strict';var w=c('DOM').scry(this.buttonActions,'a.fbPhotosPhotoLike')[0];if(w){var x=c('DOM').find(this.root,'.likeCount'),y=c('DOM').find(x,'.likeCountNum'),z=c('CSS').hasClass(w,'viewerLikesThis');c('FunnelLogger').appendActionWithTag(o,z?'unlike_photo':'like_photo','snowlift-feedback');if(x)if(z){c('DOM').setContent(y,parseInt(y.textContent,10)-1);}else c('DOM').setContent(y,parseInt(y.textContent,10)+1);c('CSS').toggleClass(w,'viewerLikesThis');c('CSS').removeClass(w,'viewerAlreadyLikedThis');}};v.prototype.likePhotoWithKey=function(){'use strict';return c('LikeConfirmer').like(this.likePhoto.bind(this),c('getActiveElement')());};v.prototype.updateTagBox=function(w,x){'use strict';this.unhiliteAllTags();var y=c('ge')(w);if(!y)return;c('CSS').addClass(y,'tagBox');c('CSS').addClass(y,'tagBoxPendingResponse');c('CSS').removeClass(y,'tagBoxPending');c('CSS').hide(c('DOM').find(y,'span.tagForm'));if(x){c('CSS').show(c('DOM').find(y,'span.tagApproved'));}else c('CSS').show(c('DOM').find(y,'span.tagIgnored'));};v.prototype.rotate=function(w){'use strict';var x=this.stream.getCursor();if(this.getVideoOnStage()){var y=w=='left'?270:90;!!!this.videoRotateURI?k(0):void 0;c('Bootloader').loadModules(["VideoRotate"],function(aa){new aa(x,this.videoRotateURI).motionRotate(y);}.bind(this));return;}var z=babelHelpers['extends']({fbid:x,opaquecursor:this.stream.getOpaqueCursor(x),cs_ver:c('PhotosConst').VIEWER_SNOWLIFT},this.stream.getPhotoSetQuery());z[w]=1;this.setLoadingState(v.STATE_IMAGE_DATA,true);this.setLoadingState(this.STATE_IMAGE_PIXELS,true);c('CSS').hide(this.image);new (c('AsyncRequest'))('/ajax/photos/photo/rotate/').setAllowCrossPageTransition(true).setData(z).setErrorHandler(this.rotationError.bind(this,x)).setFinallyHandler(this.rotationComplete.bind(this,x)).setMethod('POST').setReadOnly(false).send();};v.prototype.rotationComplete=function(w,x){'use strict';if(w==this.stream.getCursor()){this.setLoadingState(v.STATE_IMAGE_DATA,false);this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));this.swapData();}};v.prototype.rotationError=function(w,x){'use strict';if(w==this.stream.getCursor()){this.setLoadingState(v.STATE_IMAGE_DATA,false);this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));c('Bootloader').loadModules(["AsyncResponse"],function(y){y.defaultErrorHandler(x);});}};v.prototype.saveTagsFromPayload=function(w){'use strict';this.storeFromData(w);if('data' in w&&this.stream.getCursor() in w.data)this.swapData();};v.prototype.saveEdit=function(){'use strict';if(!c('CSS').hasClass(this.root,'fbPhotoSnowliftEditMode'))return;c('Bootloader').loadModules(["PhotoInlineEditor","FormSubmit"],function(w,x){var y=w.getInstance(this.getViewerConst());y&&x.send(y.getForm().controller);}.bind(this));};v.prototype.mouseLeaveListener=function(event){'use strict';this.unhiliteAllTags();this.reHilitePendingTag();};v.prototype.hiliteProductItemPager=function(event){'use strict';var w=c('Vector').getEventPosition(event),x=c('Vector').getElementDimensions(this.root),y=x.y-w.y;if(y>v.PRODUCT_ITEM_PAGER_HILIGHT_DISTANCE&&w.y>v.PRODUCT_ITEM_PAGER_HILIGHT_DISTANCE){c('CSS').conditionClass(this.upPager,'hilightPager',false);c('CSS').conditionClass(this.downPager,'hilightPager',false);return;}var z=y<v.PRODUCT_ITEM_PAGER_HILIGHT_DISTANCE;c('CSS').conditionClass(this.upPager,'hilightPager',!z);c('CSS').conditionClass(this.downPager,'hilightPager',z);};v.prototype.hilitePager=function(event){'use strict';var w=c('Vector').getEventPosition(event),x=c('Vector').getElementPosition(this.stage),y=c('Vector').getElementDimensions(this.stage);if(c('Locale').isRTL()){this.stagePagerPrev=y.x-(w.x-x.x)<v.GOPREV_AREA;}else this.stagePagerPrev=w.x-x.x<v.GOPREV_AREA;c('CSS').conditionClass(this.prevPager,'hilightPager',this.stagePagerPrev);c('CSS').conditionClass(this.nextPager,'hilightPager',!this.stagePagerPrev);var z,aa=event.getTarget();if(!c('Parent').byClass(aa,'snowliftOverlay')&&!c('Parent').byClass(aa,'bottomBarActions')&&!c('Parent').byClass(aa,'snowliftPager'))z=v.PAGER_FADE;this.showPagers(z);};v.prototype.showPagers=function(w){'use strict';clearTimeout(this.fadePagerTimer);this.setStagePagersState('active');if(typeof w!=='undefined')this.fadePagerTimer=setTimeout(this.hidePagers.bind(this),w);};v.prototype.hidePagers=function(){'use strict';var w=c('DOM').scry(this.getRoot(),'.fbPhotosPhotoActionsMenu')[0];if(w)return;clearTimeout(this.fadePagerTimer);this.setStagePagersState('inactive');};v.prototype.getTagger=function(){'use strict';return this.PhotoTagger&&this.PhotoTagger.getInstance(c('PhotosConst').VIEWER_SNOWLIFT);};v.prototype.unhiliteAllTags=function(){'use strict';clearTimeout(this.unhiliteTimer);c('DOM').scry(this.stage,'div.tagsWrapper div.hover').forEach(function(x){c('CSS').removeClass(x,'hover');});c('DOM').scry(this.stage,'div.tagsWrapper div.otherActive').forEach(function(x){c('CSS').removeClass(x,'otherActive');});this.hilitedTag=null;this.showingTypeaheadSuggestions=false;if(!c('CSS').hasClass(this.root,'taggingMode')){var w=this.getTagger();if(w){w.hideTagger();w.setCurrentFacebox(null);}}};v.prototype.switchHilitedTags=function(w,x){'use strict';if(this.switchTimer!==null){clearTimeout(this.switchTimer);this.switchTimer=null;}this.unhiliteAllTags();this.hiliteAllBoxes();var y=c('ge')(w);if(y){this.hilitedTag=w;if(!c('CSS').hasClass(this.root,'taggingMode')&&c('PhotosUtils').isFacebox(this.hilitedTag)){var z=this.getTagger();if(z){c('CSS').addClass(y,'hover');var aa=z.getFacebox(w);z.setCurrentFacebox(aa);if(aa)z.addTagFromFacebox(aa);}}else c('CSS').addClass(y,'hover');if(c('CSS').hasClass(y,'tagBoxPending')&&!c('CSS').hasClass(y,'showPendingTagName')&&x===true){c('DOM').scry(this.stage,'div.tagsWrapper div.showPendingTagName').forEach(function(ba){c('CSS').removeClass(ba,'showPendingTagName');});c('CSS').addClass(y,'showPendingTagName');}}};v.prototype.reHilitePendingTag=function(){'use strict';var w=c('ge')(this.hilitedTag);if(w&&c('CSS').hasClass(w,'showPendingTagName'))return;var x=c('DOM').scry(this.stage,'div.tagsWrapper div.showPendingTagName')[0];if(x)this.switchHilitedTags(x.id);};v.prototype.hiliteTagsOnMouseMove=function(event){'use strict';if(!this.stream.getCurrentExtraData()||this.getVideoOnStage())return;if(this.switchTimer!==null)return;var w=event.getTarget();if(c('Parent').byClass(w,'snowliftOverlay')||c('Parent').byClass(w,'fbPhotoSnowliftTagApproval')||c('Parent').byClass(w,'tagPointer')||c('Parent').byClass(w,'arrow')||c('Parent').byClass(w,'faceboxSuggestion')||c('Parent').byClass(w,'typeaheadWrapper')||c('Parent').byClass(w,'photoTagTypeahead'))return;var x=c('Parent').byClass(w,'tagBoxPending'),y=false;if(this.hilitedTag){var z=c('ge')(this.hilitedTag);y=z&&c('CSS').hasClass(z,'tagBoxPending');}var aa=!this.hilitedTag&&x||!y&&x;if(aa){this.switchHilitedTags(x.id);return;}if(x&&x.id==this.hilitedTag)return;var ba=250,ca=15,da=c('Vector').getEventPosition(event);if(!this.startingMousePos)this.startingMousePos=da;var ea=c('PhotosUtils').absoluteToNormalizedPosition(this.image,da);if(!this.haveLeftBufferRegion&&this.startingMousePos.distanceTo(da)<ca){return;}else this.haveLeftBufferRegion=true;if(this.currentTagHasPrecedence(ea))return;var fa=c('PhotosUtils').getNearestBox(this.stream.getCurrentExtraData().tagRects,ea);if(!fa){if(!y){this.unhiliteAllTags();this.reHilitePendingTag();}return;}var ga=null;if(y){var ha={};ha[this.hilitedTag]=this.stream.getCurrentExtraData().tagRects[this.hilitedTag];ga=c('PhotosUtils').getNearestBox(ha,ea);}if(ga!==null&&y)return;if(this.hilitedTag!=fa)if(y){this.switchTimer=setTimeout(this.switchHilitedTags.bind(this,fa),ba);}else{if(this._showHover&&!this._seenTags[fa]){this._seenTags[fa]=true;c('PhotoTagSearchPivotLogger').logPivotImpression('snowlift',fa);}this.switchHilitedTags(fa);}};v.prototype.currentTagHasPrecedence=function(w){'use strict';if(!this.hilitedTag)return false;if(this.stream.getCurrentExtraData().tagRects[this.hilitedTag]===undefined){this.hilitedTag=null;return false;}var x=this.stream.getCurrentExtraData().tagRects[this.hilitedTag],y=new (c('Rect'))(x.t+x.h()/2,x.r,x.b+(c('PhotosUtils').isFacebox(this.hilitedTag)?10:0),x.l,x.domain);return y.contains(w);};v.prototype.getVideoOnStage=function(){'use strict';var w=this.stream&&this.stream.getCurrentImageData();return w&&w.video;};v.prototype.shouldPageOnAction=function(w,x){'use strict';if(!this.isOpen||c('LikeConfirmer').isShowingConfirmation())return false;var y=c('isNode')(x)&&(c('Parent').byClass(x,'snowliftPager')||c('Parent').byClass(x,'stagePagers')||c('Parent').byClass(x,'pivotPageColumn')),z=c('isNode')(x)&&c('Parent').byClass(x,'stage'),aa=c('CSS').hasClass(x,'faceBox'),ba=!c('CSS').hasClass(this.root,'taggingMode')&&aa&&!y;if(ba){if(!this.showingTypeaheadSuggestions){this.getTagger().updateWithSuggestions();setTimeout(function(){c('DOM').find(this.getTagger().tagger,'input.textInput').focus();}.bind(this),0);}this.showingTypeaheadSuggestions=!this.showingTypeaheadSuggestions;return false;}var ca=z&&c('CSS').hasClass(this.root,'taggingMode')||c('Parent').byClass(x,'tagBoxPending')||c('Parent').byClass(x,'tagBoxPendingResponse')||c('Parent').byClass(x,'fbPhotoTagApprovalBox')||c('Parent').byClass(x,'tag');if(ca)return false;if(z&&this._isZoomOn)z=false;return w==c('Keys').LEFT||w==c('Keys').RIGHT||w==c('Keys').UP||w==c('Keys').DOWN||w==p||w==q||y||ba||z;};v.prototype.keyHandler=function(w,event){'use strict';if(event.getModifiers().any||c('Layer').getTopmostLayer()!==this.spotlight)return true;switch(c('Event').getKeyCode(event)){case c('Keys').LEFT:case c('Keys').RIGHT:case c('Keys').UP:case c('Keys').DOWN:case p:case q:this.pageListener(event);return false;case r:c('FunnelLogger').appendActionWithTagIfNew(o,c('FullScreen').isFullScreen()?'fullscreen_exit':'fullscreen_enter','key-f');return this.toggleFullScreen();case s:return this.likePhotoWithKey();case c('Keys').SPACE:this.showPagers(v.PAGER_FADE);return false;case c('Keys').ESC:if(this._isZoomOn){this._setZoomOut();this.switchImage(this.getImageURL(this.stream.getCurrentImageData()));return false;}break;}};v.prototype._isItemPagerEnabled=function(){'use strict';var w=this._scrapProductItemSnowLiftLinks();return w!==null&&w.length>1;};v.prototype._setupNextItemUI=function(){'use strict';if(!this.upPager||!this.downPager)return;var w=this._scrapProductItemSnowLiftLinks();if(!w||w.length<2){c('CSS').hide(this.upPager);c('CSS').hide(this.downPager);}else{var x=c('Vector').getElementDimensions(this.stage),y=c('Vector').getElementDimensions(this.root),z=(y.y-x.y)/2-v.PRODUCT_ITEM_PAGER_MARGIN;this.upPager.style.marginTop="-"+z+"px";this.downPager.style.marginTop=z-v.PRODUCT_ITEM_PAGER_HEIGHT+"px";c('CSS').show(this.upPager);c('CSS').show(this.downPager);}};v.prototype._scrapProductItemSnowLiftLinks=function(){'use strict';if(!this._elem)return null;var w=c('ge')('pagelet_group_forsaleposts');if(!w)w=c('ge')('group_commerce_cross_group_feed_stories');if(!w)return null;var x=c('DOM').scry(w,'a[name="snowlift"]').filter(function(aa){return c('DOM').scry(aa,'img').length==1;}),y=x.map(function(aa){return aa.href;}),z=c('arrayContains')(y,this._elem.href);return z?x:[];};v.prototype._loadNextItem=function(w){'use strict';var x=this._scrapProductItemSnowLiftLinks();if(!x)return;var y=x[0];x.every(function(z,aa){if(z.href===this._elem.href){var ba=w?++aa:--aa;if(ba<0){y=x[x.length-1];}else if(ba<x.length)y=x[ba];return false;}return true;}.bind(this));y.click();};v.prototype.shouldHandlePendingTag=function(event){'use strict';var w=this.getTagger();if(!w||!w.tags.length)return false;var x=c('PhotosUtils').absoluteToNormalizedPosition(this.getImage(),c('Vector').getEventPosition(event)),y=w.findNearestTag(x);if(!y||!c('CSS').hasClass(y.node,'tagBoxPending'))return false;c('Arbiter').inform('PhotoTagApproval.PENDING_TAG_PHOTO_CLICK',{id:y.id,version:this.getVersionConst()});return true;};v.prototype.pageListener=function(event){'use strict';var w=c('Event').getKeyCode(event),x=event.getTarget();if(!this.shouldPageOnAction(w,x))return;if(this.shouldHandlePendingTag(event))return;var y=0,z=null,aa=null;if(w==c('Keys').RIGHT||w==q){y=1;c('FunnelLogger').appendActionWithTag(o,'image_prev','key-right');c('PhotoSessionLog').setPagingAction('key_right');this._disableMouseOver=true;}else if(w==c('Keys').LEFT||w==p){y=-1;c('FunnelLogger').appendActionWithTag(o,'image_next','key-left');c('PhotoSessionLog').setPagingAction('key_left');this._disableMouseOver=true;}else if(w==c('Keys').UP){c('PhotoSessionLog').setPagingAction('key_up');this._disableMouseOver=true;z=false;}else if(w==c('Keys').DOWN){c('PhotoSessionLog').setPagingAction('key_down');this._disableMouseOver=true;z=true;}else if(c('Parent').byClass(x,'next')){y=1;c('FunnelLogger').appendActionWithTag(o,'image_next','button-next');c('PhotoSessionLog').setPagingAction('click_next');}else if(c('Parent').byClass(x,'prev')){y=-1;c('FunnelLogger').appendActionWithTag(o,'image_prev','button-prev');c('PhotoSessionLog').setPagingAction('click_prev');}else if(c('Parent').byClass(x,'down')){z=true;c('PhotoSessionLog').setPagingAction('click_down');}else if(c('Parent').byClass(x,'up')){z=false;c('PhotoSessionLog').setPagingAction('click_up');}else if(aa=c('Parent').byClass(x,'seek')){var ba=c('DataStore').get(aa,'seek-fbid');y=this.stream.getRelativeMovement(ba);c('PhotoSessionLog').setPagingAction('seek');}else if(!this.stagePagerPrev){y=1;c('FunnelLogger').appendAction(o,'image_next','click-stage');c('PhotoSessionLog').setPagingAction('click_stage');}else{y=-1;c('FunnelLogger').appendAction(o,'image_prev','click-stage');c('PhotoSessionLog').setPagingAction('click_stage_back');}var ca=c('DOM').scry(this.ufiForm,'input.mentionsHidden'),da=false;for(var ea=0;ea<ca.length;ea++)if(!c('Input').isEmpty(ca[ea])){da=true;break;}if(da||c('CSS').hasClass(this.root,'fbPhotoSnowliftEditMode')){this.warnLeavePage(this.page.bind(this,y));}else{this.page(y,c('UserAgent_DEPRECATED').chrome()&&c('FullScreen').isFullScreen());this._previousZoomScrollPercent=null;}if(null!==z)this._loadNextItem(z);};v.prototype.warnLeavePage=function(w){'use strict';new (c('Dialog'))().setTitle(j._("Are You Sure You Want To Leave This Page?")).setBody(j._("You have unsaved changes that will be lost if you leave the page.")).setButtons([{name:'leave_page',label:j._("Leave This Page"),handler:w},{name:'continue_editing',label:j._("Stay on This Page"),className:'inputaux'}]).setModal(true).show();};v.prototype.getUsesOpaqueCursor=function(){'use strict';return this.stream.getUsesOpaqueCursor();};v.prototype.getOpaqueCursor=function(w){'use strict';return this.stream.getOpaqueCursor(w);};v.prototype.setReachedLeftEnd=function(){'use strict';this.stream.setReachedLeftEnd();};v.prototype.setReachedRightEnd=function(){'use strict';this.stream.setReachedRightEnd();};v.prototype._initLitestandShareAttachments=function(){'use strict';var w=c('DOMQuery').scry(this.root,'.'+c('LitestandShareAttachment').getSimpleCropClass());w.forEach(function(x){return c('LitestandShareAttachment').init(x);});};v.prototype.page=function(w,x,y){'use strict';if(!this.stream.isValidMovement(w)||!this.stream.nonCircularPhotoSetCanPage(w)){this.showPagers(v.PAGER_FADE);return;}var z=this.stream.getCursorAt(this.stream.calculatePositionForMovement(w));if(this.snowflake&&(this.stream.getCursor()==this.firstInSet&&w<0||this.firstInSet==z&&w>0)){this.showPagers(v.PAGER_FADE);return;}this.lastPage=Date.now();this.unhiliteAllTags();this.startingMousePos=null;this.haveLeftBufferRegion=false;this._seenTags={};this._navCount+=w;var aa=this.stream.allLoaded?Math.abs(this._navCount)-this.stream.getLength():null;if(this._extraSlidePivot&&this._albumFBID){if(!this._albumBoundaries.end&&aa===0){this._albumBoundaries.end=this.stream.getCursor();this._albumBoundaries.dir=w;}else if(aa===-1)c('PhotosetSearchPivotData').fetch(this._albumFBID,this.stream);if(!this.onExtraSlide){if(this.stream.getCursor()===this._albumBoundaries.end&&z===this._albumBoundaries.start&&w===this._albumBoundaries.dir){this.showPivotSlide(this._albumFBID,x);return;}else if(this.stream.getCursor()===this._albumBoundaries.start&&z===this._albumBoundaries.end&&w===-this._albumBoundaries.dir)this.showPivotSlide(this._albumFBID,x);}else{this.hidePivotSlide();if(w===-this._albumBoundaries.dir)return;}}var ba=this.getVideoOnStage();if(ba)this.switchVideo(ba,false);if(this.pivots&&this.pivots.page(w))return;c('Arbiter').inform('PhotoSnowlift.PAGE');c('Toggler').hide();this.recacheData();this.stream.moveCursor(w);c('CSS').hide(this.image);if(w!==0){this.storyID=null;this._updateContainerOwnerID();}if(w!==0&&this._isZoomOn)this._setZoomOut();if(this.stream.errorInCurrent()){this.setLoadingState(v.STATE_HTML,true);c('CSS').show(this.errorBox);return;}this.movementDelta+=w;var ca=this.stream.getCurrentImageData();if(ca){var da=this.getImageURL(ca);if(da){if(ca.info.isgraphic){if(this._canSeeGraphicWarning){this.showGraphicWarning();c('PhotoWarningScreen').logGraphic(n.GRAPHIC_PHOTO_SHOWN_WITH_WARNING);}else{this.hideGraphicWarning();c('PhotoWarningScreen').logGraphic(n.GRAPHIC_PHOTO_SHOWN_NO_WARNING);}}else this.hideGraphicWarning();this.switchImage(da,null,true);}else if(ca.video)this.switchVideo(ca.video,true,y);if(!x){this.replaceUrl=true;c('goURI')(ca.info.permalink);}this.setLoadingState(v.STATE_IMAGE_DATA,false);}else{this.setLoadingState(v.STATE_IMAGE_PIXELS,true);this.setLoadingState(v.STATE_IMAGE_DATA,true);}if(this.stream.getCurrentHtml()){this.swapData();}else this.setLoadingState(v.STATE_HTML,true);this.disableAds=!this.isLoggedInViewer||this.stream.isInViewAsMode();this.loadAds();this.setLeftAndRightPagersState();if(!this._extraSlidePivot&&this._showMorePhotos&&this._albumFBID)if(aa===-1){c('PhotosetSearchPivotData').fetch(this._albumFBID,this.stream);}else if(aa===0){c('PhotoTagSearchPivotLogger').logSuggestMorePhotos();this.showMorePhotos(this._albumFBID,true);this.showPagers();this._navCount=0;}else{this.hideMorePhotos();this.hidePagers();}this._initLitestandShareAttachments();};v.prototype.showMorePhotos=function(w,x){'use strict';if(this._showingMorePhotos)return;this._showingMorePhotos=true;if(!this.searchPivot)this.searchPivot=this.overlay.appendChild(document.createElement('div'));c('CSS').addClass(this.stageWrapper,"_5ymv");this.searchPivotComponent=new (c('ReactComponentRenderer'))(c('PhotosetSearchPivot.react'),this.searchPivot);this.searchPivotComponent.setProps({className:"_27g",fbid:w,onclose:this.hideMorePhotos.bind(this),endofalbum:x||false,withBackground:true});};v.prototype.hideMorePhotos=function(){'use strict';if(this.searchPivotComponent&&this._showingMorePhotos){this._showingMorePhotos=false;c('CSS').removeClass(this.stageWrapper,"_5ymv");this.searchPivotComponent.setProps({fbid:null});}};v.prototype.showPivotSlide=function(w,x){'use strict';if(this.onExtraSlide)return;this.onExtraSlide=true;c('CSS').addClass(this.stageWrapper,"_3tvf");if(!this.pivotSlide){this.pivotSlide=c('DOM').create('div');c('DOM').insertBefore(this.stageActions,this.pivotSlide);}this.pivotSlideComponent=new (c('ReactComponentRenderer'))(c('PhotosetPivotSlide.react'),this.pivotSlide);this.pivotSlideComponent.setProps({fbid:w,isAlbum:this._isAlbum,albumOwnerName:this._albumOwnerName,visible:true,onReturn:this.page.bind(this,this._albumBoundaries.dir,x)});};v.prototype.hidePivotSlide=function(){'use strict';if(this.pivotSlideComponent&&this.onExtraSlide){this.pivotSlideComponent.setProps({visible:false});c('CSS').removeClass(this.stageWrapper,"_3tvf");}this.onExtraSlide=false;};v.prototype.logImpressionDetailsForPhoto=function(){'use strict';var w=[].concat(c('DOM').scry(c('$')('fbPhotoSnowliftTagList'),'input.photoImpressionDetails'),c('DOM').scry(c('$')('fbPhotoSnowliftFeedback'),'input.photoImpressionDetails'));if(w.length===0)return;var x={};for(var y=0;y<w.length;y++)x[w[y].name]=w[y].value;if(this.getVideoOnStage()){x.width=0;x.height=0;}else{var z=this.getImageDimensions(this.stream.getCurrentImageData());x.width=z.x;x.height=z.y;}c('PhotoSessionLog').addDetailData(this.stream.getCursor(),x);c('PhotoSnowliftAds').setIsLogAdData(true);};v.prototype.loadAds=function(){'use strict';if(this.disableAds)return;c('PhotoSnowliftAds').loadAdsFromUserActivity();};v.prototype.transitionHandler=function(w){'use strict';if(w.getQueryData().closeTheater||w.getQueryData().permPage||this.returningToStart){if(this.isOpen)this.close();this.transitionHandlerRegistered=false;return false;}if(this.replaceUrl){this.replaceUrl=false;this._uriStack.push(w.getQualifiedURI().toString());c('PageTransitions').transitionComplete(true);return true;}var x=this._uriStack.length;if(x>=2&&this._uriStack[x-2]==w.getQualifiedURI().toString())this._uriStack.pop();var y=this.stream.getCursorForURI(w.getUnqualifiedURI().toString());if(y){var z=this.stream.getRelativeMovement(y);this.page(z,true);c('PageTransitions').transitionComplete(false);return true;}if(this.isOpen){c('PageTransitions').transitionComplete(true);this.close();return true;}this.transitionHandlerRegistered=false;return false;};v.prototype.recacheData=function(){'use strict';if(!this.loadingStates.html){var w=this.stream.getCurrentHtml();for(var x in w){var y=c('$')(x);w[x]=Array.from(y.childNodes);c('DOM').empty(y);}}};v.prototype.reloadIfTimeout=function(){'use strict';if(!c('ImageUtils').hasLoaded(this.image)){var w=this.makeNewImage(this.image.src,true);c('Event').listen(w,'load',this.useImage.bind(this,w,null,true));this._log(w.src);}};v.prototype.useImage=function(w,x,y){var z=arguments.length<=3||arguments[3]===undefined?false:arguments[3];'use strict';if(y&&c('ImageUtils').hasLoaded(this.image))return;var aa=function(){c('DOM').replace(this.image,w);this.image=w;this.adjustStageSize(x);}.bind(this);if(!z||c('ImageUtils').hasLoaded(w)){aa();}else c('Event').listen(w,'load',aa);};v.prototype.makeNewImage=function(w,x){'use strict';if(this.imageLoadingTimer){clearTimeout(this.imageLoadingTimer);this.imageLoadingTimer=null;}else if(!x)this.imageRefreshTimer=setTimeout(this.reloadIfTimeout.bind(this),v.LOADING_TIMEOUT);var y=c('DOM').create('img',{className:'spotlight',alt:''});y.setAttribute('aria-describedby','fbPhotosSnowliftCaption');y.setAttribute('aria-busy','true');var z=function(){clearTimeout(this.imageRefreshTimer);this.image.setAttribute('aria-busy','false');this.setLoadingState(this.STATE_IMAGE_PIXELS,false);setTimeout(function(){if(this.isOpen){this.adjustStageSize();this.adjustForNewData();}}.bind(this),0);}.bind(this);c('Event').listen(y,'load',z);this._log(w);if(c('EncryptedImg').isEncrypted(w)){c('EncryptedImg').insertIntoDOM(w,y);}else y.src=w;return y;};v.prototype.switchImage=function(w,x,y){var z=arguments.length<=3||arguments[3]===undefined?false:arguments[3];'use strict';c('CSS').hide(this.errorBox);if(!z)c('CSS').hide(this.image);this.setLoadingState(this.STATE_IMAGE_PIXELS,true);var aa=this.stream&&this.stream.getCurrentImageData();if(aa){c('PhotoSessionLog').addPhotoView(aa.info,this.shouldShowHiRes(aa),this.fullscreen&&c('FullScreen').isFullScreen());if(this._showHover){var ba=this.stream.getCurrentExtraData();if(ba)c('PhotoTagSearchPivotLogger').logImageImpression('snowlift',String(this.stream.getCursor()),Object.keys(ba.tagRects));}}this.useImage(this.makeNewImage(w,false),x,false,z);if(y)this.stream.preloadImages(this.shouldShowHiRes.bind(this));if(!this._isZoomOn&&this._isZoomAvailable(aa)){c('PhotoSessionLog').addPanoramaImpression();var ca=new (c('Vector'))(this.stage.clientWidth,this.stage.clientHeight);this._displayZoomInButton(ca);}else if(this._hasZoomCapability)c('CSS').hide(this.showZoomInButton);if(this._isZoomOn)this.switchIntoZoomedImage();c('Arbiter').inform('PhotoSnowlift.SWITCH_IMAGE');};v.prototype._conditionDisplayZoomInButton=function(){'use strict';if(!this._hasZoomCapability)return;if(this._isZoomAvailable()){var w=new (c('Vector'))(this.stage.clientWidth,this.stage.clientHeight);this._displayZoomInButton(w);}else c('CSS').hide(this.showZoomInButton);};v.prototype._displayZoomInButton=function(w){'use strict';var x=parseInt(this.image.style.height,10),y=(w.y-x)/2;if(y>=v.ZOOM_BUTTON_TOP_PAD+v.ZOOM_BUTTON_BOT_PAD+v.ZOOM_BUTTON_HEIGHT){var z=y-v.ZOOM_BUTTON_HEIGHT-v.ZOOM_BUTTON_TOP_PAD;c('Style').set(this.showZoomInButton,'bottom',z+'px');}else c('Style').set(this.showZoomInButton,'bottom','60px');c('CSS').show(this.showZoomInButton);};v.prototype._isZoomAvailable=function(w){'use strict';if(typeof w==="undefined")w=this.stream&&this.stream.getCurrentImageData();if(!this._hasZoomCapability||!w||!w.originalDimensions)return false;var x=new (c('Vector'))(this.stage.clientWidth,this.stage.clientHeight),y=w.originalDimensions,z=y.x/y.y,aa=Math.min(x.y*z,y.x);if(!isNaN(z)&&z>2&&y.y>v.MIN_PANORAMA_Y&&x.x*v.MIN_PANO_TO_STAGE_RATIO<aa){return true;}else return false;};v.prototype._setZoomIn=function(){'use strict';this._isZoomOn=true;c('CSS').hide(this.showZoomInButton);c('CSS').hide(this.stageActions);c('CSS').show(this.showZoomOutButton);c('Style').set(this.stage,'overflow','hidden');this.spotlight.disableBehavior(c('LayerHideOnEscape'));this.collapseRHC();};v.prototype._setZoomOut=function(){'use strict';if(!this._hasZoomCapability)return;this._isZoomOn=false;this.spotlight.enableBehavior(c('LayerHideOnEscape'));c('Style').set(this.stage,'overflow','visible');c('CSS').hide(this.showZoomInButton);c('CSS').hide(this.showZoomOutButton);c('CSS').hide(this.zoomedImage);c('CSS').hide(this.outerImageSlider);c('CSS').show(this.stageActions);this.uncollapseRHC();};v.prototype.switchIntoZoomedImage=function(w){'use strict';this._setZoomIn();c('CSS').hide(this.zoomedImage);c('CSS').hide(this.outerImageSlider);var x=this.stream.getCurrentImageData(),y=x.originalDimensions;this.zoomedImage.src=x.url;this.adjustStageSize(y);this._initializeZoomedImagePositions(new (c('Vector'))(parseInt(c('Style').get(this.zoomedImage,'width'),10),parseInt(c('Style').get(this.zoomedImage,'height'),10)));c('CSS').hide(this.image);};v.prototype._adjustInnerImageSlider=function(w){'use strict';var x=this.stage.clientWidth,y=Math.min(100,x/w.x*100);c('Style').set(this.innerImageSlider,'width',y+'%');return y;};v.prototype._getSliderSizeForZoomedImage=function(w){'use strict';var x=v.MAX_SLIDER_HEIGHT*this.stage.clientHeight/w.y,y=v.MAX_SLIDER_WIDTH*this.stage.clientWidth/w.x,z=Math.min(x,y);return new (c('Vector'))(100*w.x*z/this.stage.clientWidth,100*w.y*z/this.stage.clientHeight);};v.prototype._initializeZoomedImagePositions=function(w){'use strict';this._scrollZoomedImageToPercent(this._previousZoomScrollPercent);var x=this._getSliderSizeForZoomedImage(w);c('Style').set(this.outerImageSlider,'width',x.x+'%');c('Style').set(this.outerImageSlider,'height',x.y+'%');c('Style').set(this.outerImageSlider,'left',50-x.x/2+'%');c('Style').set(this.showZoomOutButton,'bottom',x.y*this.stage.clientHeight/100+parseInt(c('Style').get(this.outerImageSlider,'bottom'),10)+20+'px');c('CSS').show(this.zoomedImage);c('CSS').show(this.outerImageSlider);};v.prototype._zoomedImageMouseDown=function(event){'use strict';if(!this._isZoomOn)return;c('CSS').addClass(this.stage,'showSlider');if(this._zoomedImageMouseMoveHandle)this._zoomedImageMouseMoveHandle.remove();var w=false,x=event.getTarget();if(c('Parent').bySelector(x,"._10zv")){this.startSliderMargins=new (c('Vector'))(parseFloat(c('Style').get(this.innerImageSlider,'marginLeft')),parseFloat(c('Style').get(this.innerImageSlider,'marginTop')));this.startImageMargins=null;this.mouseDownStartPosition=new (c('Vector'))(event.clientX,event.clientY);}else if(c('Parent').bySelector(x,"._10zx")){this.startSliderMargins=new (c('Vector'))(parseInt(c('Style').get(this.innerImageSlider,'marginLeft'),10),parseInt(c('Style').get(this.innerImageSlider,'marginTop'),10));this.startImageMargins=null;var y=parseInt(c('Style').get(this.innerImageSlider,'width'),10);this.mouseDownStartPosition=new (c('Vector'))(this.innerImageSlider.getBoundingClientRect().left+y/2,event.clientY);w=true;}else if(c('Parent').bySelector(x,"._10zw")){this.startImageMargins=new (c('Vector'))(parseInt(c('Style').get(this.zoomedImage,'marginLeft'),10),parseInt(c('Style').get(this.zoomedImage,'marginTop'),10));this.startSliderMargins=null;this.mouseDownStartPosition=new (c('Vector'))(event.clientX,event.clientY);}this._zoomedImageMouseMoveHandle=c('Event').listen(this.stage,'mousemove',this._zoomedImagePan.bind(this));if(w){this._zoomedImagePan(event);}else event.kill();};v.prototype._zoomedImageMouseUp=function(event){'use strict';if(this._zoomedImageMouseMoveHandle){c('CSS').removeClass(this.stage,'showSlider');this._zoomedImageMouseMoveHandle.remove();this._zoomedImageMouseMoveHandle=null;var w=parseFloat(c('Style').get(this.zoomedImage,'marginLeft')),x=-this.zoomedImage.width+this.stage.clientWidth;this._previousZoomScrollPercent=w/x;}};v.prototype._zoomedImagePan=function(event){'use strict';var w;if(this.startSliderMargins){w=event.clientX-this.mouseDownStartPosition.x;var x=parseFloat(c('Style').get(this.outerImageSlider,'width')),y=parseFloat(c('Style').get(this.innerImageSlider,'width')),z=Math.max(0,Math.min(x-y,this.startSliderMargins.x+w))/x;c('Style').set(this.innerImageSlider,'marginLeft',100*z+"%");c('Style').set(this.zoomedImage,'marginLeft',-1*z*this.zoomedImage.width+'px');event.kill();}else if(this.startImageMargins){w=1.75*(this.mouseDownStartPosition.x-event.clientX);var aa=Math.min(0,Math.max(this.startImageMargins.x-w,-this.zoomedImage.width+this.stage.clientWidth));c('Style').set(this.zoomedImage,'marginLeft',aa+'px');c('Style').set(this.innerImageSlider,'marginLeft',-aa/this.zoomedImage.width*100+"%");event.kill();}};v.prototype._scrollZoomedImageToPercent=function(w){'use strict';if(w===undefined||w===null)w=.5;var x=new (c('Vector'))(parseInt(c('Style').get(this.zoomedImage,'width'),10),parseInt(c('Style').get(this.zoomedImage,'height'),10));c('Style').set(this.innerImageSlider,'marginLeft',(100-this._adjustInnerImageSlider(x))*w+'%');c('Style').set(this.zoomedImage,'marginLeft',(this.stage.clientWidth-x.x)*w+'px');};v.prototype._preloadNextVideo=function(){'use strict';var w=this.stream.calculatePositionForMovement(1),x=this.stream.getCursorAt(w),y=this.stream.getImageData(x);if(y&&y.video)y.controller.preload();};v.prototype.switchVideo=function(w,x,y){'use strict';this._pauseVideoIfNeeded();var z='swf_'+w;c('DOM').empty(this.videoStage);if(x){this._preloadNextVideo();c('CSS').addClass(this.stageWrapper,'showVideo');var aa=this.stream.getCurrentImageData();if(this.shouldRenderVideoPivots){c('CSS').hide(this.nextPager);c('CSS').hide(this.prevPager);}var ba=aa.video_element;c('DOM').scry(ba,"._ox1")[0].style.cssText='';var ca=null;if(this.pivotsCarouselElement)ca=c('DOMQuery').scry(this.pivotsCarouselElement,"._32_l");if(ca)ca.forEach(function(ga){var ha=ga.getAttribute('data-fbid'),ia=this.stream.getCursor(),ja=c('DOM').find(ga,"._1pqn");if(ha===ia){c('CSS').show(ja);}else c('CSS').hide(ja);}.bind(this));c('CSS').addClass(ba,'videoStageContainer');c('DOM').appendContent(this.videoStage,ba);c('DOM').appendContent(this.videoStage,this.pivotsCarouselElement);if(window[z]&&!c('ge')(z))window[z].write(w);var da='video_warning_'+w,ea=c('ge')(w);if(!this.videoWarnings)this.videoWarnings=[];if(ea&&this.videoWarnings[da])c('DOM').setContent(ea,this.videoWarnings[da]);this._videoPlayerStateManager=aa.controller;this._videoPlayerStateManager.reset();this._videoPlayerStateManager.collectFeedTrackingData();if(this._autoplayVideos){var fa=y||c('VideoPlayerReason').USER;this._videoPlayerStateManager.play(fa);}if(this._autoplayNextVideo)this._videoPlayerStateManager.addListener('finishPlayback',function(){var ga=aa.info.fbid.toString();if(this.haltAutoplay&&ga!==this.stream.fbidList[this.stream.fbidList.length-1]){if(this.autoplayOptionScreenConfig){var ha=this.autoplayOptionScreenConfig.controller;ha.registerCallbacks(ba,this.chooseToReplayVideo.bind(this,this._videoPlayerStateManager),this.handleAutoplay.bind(this,aa));}}else this.handleAutoplay(aa);}.bind(this));setTimeout(this.adjustStageSizeForVideo.bind(this,w),0);}else{window[z]&&window[z].addVariable('video_autoplay',0);this.videoLoadTimer&&clearTimeout(this.videoLoadTimer);c('CSS').removeClass(this.stageWrapper,'showVideo');}};v.prototype.removeAutoplayOptionScreen=function(){'use strict';if(this.autoplayOptionScreenConfig)this.autoplayOptionScreenConfig.controller.removeSelf();};v.prototype.chooseToReplayVideo=function(w){'use strict';w.play(c('VideoPlayerReason').USER);this.removeAutoplayOptionScreen();this.haltAutoplay=false;};v.prototype.handleAutoplay=function(w){'use strict';var x=w.info.fbid.toString();if(x===this.stream.getCursor()&&x!==this.stream.fbidList[this.stream.fbidList.length-1]){c('SnowliftVideoPivotsCarouselController').adjustCarouselOnAutoPlay();this.page(1,false,c('VideoPlayerReason').AUTOPLAY);}this.removeAutoplayOptionScreen();this.haltAutoplay=false;};v.prototype.checkVideoStatus=function(w){'use strict';if(this.videoLoadTimer)clearTimeout(this.videoLoadTimer);var x=this.getVideoOnStage();if(!x){return;}else{if(x!==w)return;this.adjustStageSizeForVideo(w);}};v.prototype.getVideoSize=function(w){'use strict';return new (c('Vector'))(w.getAttribute('data-video-width'),+w.getAttribute('data-video-height')+this.getVideoComponentsHeight(w));};v.prototype.getVideoElement=function(w){'use strict';return c('DOM').scry(this.videoStage,"._ox1")[0];};v.prototype.getVideoComponentsHeight=function(w){'use strict';var x=0,y=c('Parent').bySelector(w,"._1c_u");if(!y)return 0;var z=c('DOM').scry(y,"._2i84");if(z.length){var aa=z[0].getBoundingClientRect();x=aa.bottom-aa.top;}return x;};v.prototype.adjustStageSizeForVideo=function(w){'use strict';var x=this.getVideoElement(w);if(!x){this.videoLoadTimer=setTimeout(this.checkVideoStatus.bind(this,w),200);}else this.adjustStageSize(this.getVideoSize(x));};v.prototype.handleServerError=function(w,x){'use strict';c('DOM').setContent(this.errorBox,w);this.storeFromData(x);};v.prototype.fixButtonText=function(w){'use strict';if(!this.buttonTruncateGk)return;var x=c('DOM').scry(w,".photosTruncatingUIButton"),y=parseInt(c('Style').get(w,'width'),10);if(y>t){var z={tagPhoto:j._("Tag Photo"),doneTagPhoto:j._("Done Tagging"),addLocation:j._("Add Location"),editPhoto:j._("Edit")};for(var aa=0;aa<x.length;aa++){var ba=x[aa];c('CSS').addClass(ba,"_2n0k");c('Tooltip').set(ba,z[ba.getAttribute('data-buttonname')],'below','center');}}};v.prototype.swapData=function(){'use strict';var w,x=this.stream.getCurrentHtml();if(x){this.setLoadingState(v.STATE_HTML,false);for(var y in x){w=c('ge')(y);w&&c('DOM').setContent(w,x[y]);}var z=c('ge')('photosTruncatingUIButtonGroup');z&&this.fixButtonText(z);c('Arbiter').inform('PhotoSnowlift.DATA_CHANGE',Object.assign(this.stream.getCurrentImageData().info,{movement:this.movementDelta}),c('Arbiter').BEHAVIOR_STATE);this.movementDelta=0;if(this.stream.getCurrentExtraData())c('Arbiter').inform('PhotoSnowlift.EXTRA_DATA_CHANGE',this.stream.getCurrentExtraData(),c('Arbiter').BEHAVIOR_STATE);}this.adjustScroller();this.scrollableArea.showScrollbar(false);this.adjustForNewData();this.logImpressionDetailsForPhoto();};v.prototype.updateTotalCount=function(w,x,y){'use strict';var z=this.stream.getCurrentHtml();if(z){var aa=c('$')('fbPhotoSnowliftPositionAndCount');c('DOM').replace(aa,y);aa=y;c('CSS').show(aa);var ba='fbPhotoSnowliftPositionAndCount';z[ba]=Array.from(aa.childNodes);}this.stream.setTotalCount(w);this.stream.setFirstCursorIndex(x);};v.prototype.addPhotoFbids=function(w,x,y,z){'use strict';if(z&&this.sessionID&&z!=this.sessionID)return;var aa=this.stream.getCursor()===null;if(this.shouldRenderVideoPivots&&!this._videoSameAsSource)this.stream.fbidList=[];this.stream.attachToFbidsList(w,x,y);if(y&&aa)this.page(0,true);if(this.pivots&&y)this.pivots.setCycleCount(this.stream.calculateDistance(this.stream.getCursor(),this.stream.firstCursor));if(!this.pagersShown&&this.stream.canPage())this.setStagePagersState('ready');this.setLeftAndRightPagersState();if(this.shouldRenderVideoPivots&&!this._videoSameAsSource){var ba=this.stream.getCursor(),ca=this.stream.calculateDistance(ba,this._mediaFBID);this.stream.moveCursor(ca);}};v.prototype.attachTagger=function(w,x){'use strict';c('DOM').appendContent(this.stageActions,w);if(x)x.setTokenarea(this.taglist);};v.prototype.storeFromData=function(w){'use strict';if(!this.isOpen)return;if(w.pivots)this.pivotsCarouselElement=w.pivots;if(w.autoplay_option_screen_config){this.autoplayOptionScreenConfig=w.autoplay_option_screen_config;if(this.autoplayOptionScreenConfig&&this.autoplayOptionScreenConfig.enabled)this.addHaltAutoplaySubscription();}this.shouldRenderVideoPivots=w.should_render_pivots;if(w.ssid&&this.sessionID&&this.sessionID!=w.ssid)return;var x=this.stream.storeToCache(w);if('error' in x){this.checkState(v.STATE_ERROR);return;}if('init' in w){if(this.shouldRenderVideoPivots)this._videoSameAsSource=w.init.videoSameAsSource;this._mediaFBID=w.init.fbid;this._albumFBID=w.init.album_fbid;this._isAlbum=w.init.is_album;this._albumOwnerName=w.init.album_owner_name;this._autoplayVideos=w.init.autoplay_videos;this._autoplayNextVideo=w.init.autoplay_next_video;}else this._preloadNextVideo();var y='init' in x;if(y){this.initDataFetched(x.init);if(this.openExplicitly){this.replaceUrl=true;c('goURI')(this.stream.getCurrentImageData().info.permalink);}if(this.stream.canPage())this.setStagePagersState('ready');this.setLeftAndRightPagersState();}if('image' in x)this.checkState(v.STATE_IMAGE_DATA,y);if('data' in x)this.checkState(v.STATE_HTML);};v.prototype.setLeftAndRightPagersState=function(){'use strict';if(this.stream.isNonCircularPhotoSet()){c('CSS').conditionClass(this.root,'disableLeft',!this.stream.nonCircularPhotoSetCanPage(-1));c('CSS').conditionClass(this.root,'disableRight',!this.stream.nonCircularPhotoSetCanPage(1));}if(this.snowflake){c('CSS').conditionClass(this.root,'disableLeft',this.stream.getCursor()==this.firstInSet);var w=this.stream.getCursorAt(this.stream.calculatePositionForMovement(1));c('CSS').conditionClass(this.root,'disableRight',w==this.firstInSet);}};v.prototype.setStagePagersState=function(w){'use strict';switch(w){case 'ready':c('CSS').addClass(this.root,'pagingReady');this.pagersShown=true;this._setupNextItemUI();return;case 'active':c('CSS').addClass(this.root,'pagingActivated');return;case 'inactive':c('CSS').removeClass(this.root,'pagingActivated');return;case 'disabled':case 'reset':c('CSS').removeClass(this.root,'pagingReady');return;}};v.prototype.deletePhoto=function(w){'use strict';this.closeRefresh();};v.prototype.closeRefresh=function(){'use strict';this.refreshOnClose=true;this.spotlight.hide();};v.prototype.onHiliteTag=function(w,x){'use strict';if(x.version!=c('PhotosConst').VIEWER_SNOWLIFT)return;var y=x.tag;if(y)this.switchHilitedTags(y,true);};v.prototype.onUpdateTagBox=function(w,x){'use strict';if(x.version==c('PhotosConst').VIEWER_SNOWLIFT)this.updateTagBox(x.id,x.approve);};v.prototype._log=function(w){'use strict';if(this._shouldLog){this._logger&&this._logger.log(w.startsWith('data:')?c('EncryptedImg').dataUrlPrefix(w):w);return true;}return false;};v.prototype._enableMouseOver=function(){'use strict';this._disableMouseOver=false;};v.prototype._interceptMouseOver=function(event){'use strict';if(this._disableMouseOver)event.kill();};v.prototype.isReturningToStart=function(){'use strict';return !!this.returningToStart;};v.prototype._pauseVideoIfNeeded=function(){'use strict';if(this._videoPlayerStateManager){this._videoPlayerStateManager.pause('unloaded');if(c('VideoPlayerAbortLoadingExperiment').canAbort)this._videoPlayerStateManager.abortLoading();}};v.getInstance=function(){'use strict';if(!v._instance)v._instance=new v();return v._instance;};v.initWithSpotlight=function(w,x){'use strict';v.getInstance().init(w,x);};v.addPhotoFbids=function(w,x,y,z){'use strict';v.getInstance().addPhotoFbids(w,x,y,z);};v.setReachedLeftEnd=function(){'use strict';v.getInstance().setReachedLeftEnd();};v.setReachedRightEnd=function(){'use strict';v.getInstance().setReachedRightEnd();};v.attachFollowFlyout=function(w){'use strict';c('DOM').insertAfter(c('$')('fbPhotoSnowliftSubscribe'),w);};v.attachSubscribeFlyout=function(w){'use strict';c('DOM').insertAfter(c('$')('fbPhotoSnowliftSubscribe'),w);};v.attachTagger=function(w,x){'use strict';v.getInstance().attachTagger(w,x);};v.bootstrap=function(w,x){'use strict';if(!v.shouldUseSnowlift(w,x))return;c('FunnelLogger').startFunnel(o);var y=w&&new (c('URI'))(w).getQueryData();if(y&&y.hasOwnProperty('share_id')){c('Bootloader').loadModules(["SpotlightShareViewer"],function(z){z.bootstrap(w,x);});return;}v.getInstance().bootstrap(w,x);};v.shouldUseSnowlift=function(w,x){'use strict';var y=w&&new (c('URI'))(w).getQueryData();if(y&&y.hasOwnProperty('sell_story_id')){v.getInstance().loadFrameIfUninitialized();c('Bootloader').loadModules(["GroupCommerceProductDetail.react"],function(z){z.showDialog(y.sell_story_id,y,x);});return false;}return true;};v.closeRefresh=function(){'use strict';v.getInstance().closeRefresh();};v.deletePhoto=function(w){'use strict';v.getInstance().deletePhoto(w);};v.getImage=function(){'use strict';return v.getInstance().getImage();};v.getImageId=function(){'use strict';return v.getInstance().getImageId();};v.getLoadQuery=function(){'use strict';return v.getInstance().getLoadQuery();};v.getRHCBody=function(){'use strict';return v.getInstance().getRHCBody();};v.getRHCFooter=function(){'use strict';return v.getInstance().getRHCFooter();};v.getRHCHeader=function(){'use strict';return v.getInstance().getRHCHeader();};v.getRoot=function(){'use strict';return v.getInstance().getRoot();};v.likePhotoSkipConfirmation=function(w){'use strict';v.getInstance().likePhotoSkipConfirmation(w);};v.saveTagsFromPayload=function(w){'use strict';v.getInstance().saveTagsFromPayload(w);};v.saveTagsFromPayloadDelayed=function(w){'use strict';setTimeout(v.saveTagsFromPayload.bind(null,w),2000);};v.handleServerError=function(w,x){'use strict';v.getInstance().handleServerError(w,x);};v.setVideoWarning=function(w,x){'use strict';var y=v.getInstance(),z='video_warning_'+w;if(!y.videoWarnings)y.videoWarnings=[];y.videoWarnings[z]=x;};v.storeFromData=function(w){'use strict';v.getInstance().storeFromData(w);};v.swapData=function(){'use strict';v.getInstance().swapData();};v.updateTotalCount=function(w,x,y){'use strict';v.getInstance().updateTotalCount(w,x,y);};v.setVideoRotateURI=function(w){'use strict';v.getInstance().videoRotateURI=w;};Object.assign(v,{STATE_ERROR:'error',STATE_HTML:'html',STATE_IMAGE_PIXELS:'image_pixels',STATE_IMAGE_DATA:'image',LOADING_TIMEOUT:2000,PAGER_FADE:3000,FULL_SCREEN_PADDING:10,STAGE_NORMAL_MAX:{x:960,y:960},STAGE_MIN:{x:520,y:520},PROFILE_PICTURE_BUTTON_WIDTH:140,SIDEBAR_SIZE_MAX:360,MIN_PANORAMA_Y:240,ZOOM_BUTTON_HEIGHT:52,ZOOM_BUTTON_BOT_PAD:60,ZOOM_BUTTON_TOP_PAD:16,MAX_SLIDER_HEIGHT:.075,MAX_SLIDER_WIDTH:.75,MIN_PANO_TO_STAGE_RATIO:1.2,STAGE_CHROME:{x:82,y:42},VIDEO_BOTTOM_BAR_SPACE:40,GOPREV_AREA:120,TIMELINE_STRETCH_WIDTH:843,TIMELINE_STRETCH_MIN:480,MIN_TAG_DISTANCE:83,PADDING_MIN:40,MIN_UFI_HEIGHT:250,COLLECTIONS_UNTAGGED_PHOTOS:3,PHOTOS_OF_YOU_SUGGESTIONS:28,FRIENDS_IN_PHOTOS_SUGGESTIONS:31,MIN_ADS_VISIBLE:1,PINNED_UFI_ADJUSTMENT:11,ADD_COMMENT_HEIGHT:54,_instance:null,touch:c('emptyFunction'),touchMarkup:c('emptyFunction'),PRODUCT_ITEM_PAGER_HILIGHT_DISTANCE:100,PRODUCT_ITEM_PAGER_HEIGHT_OFFSET:70,PRODUCT_ITEM_PAGER_HEIGHT:21,PRODUCT_ITEM_PAGER_MARGIN:20});Object.assign(v.prototype,{switchTimer:null,imageRefreshTimer:null,imageLoadingTimer:null,lastPage:0,currentMinSize:null,currentImageSize:null,resetUriStack:true,thumbSrc:null,shouldStretch:false,stageMax:v.STAGE_NORMAL_MAX,stageChrome:v.STAGE_CHROME,stagePagerPrev:null,ua:null,PhotoTagger:null});f.exports=v;},null);