YUI.add("photo-selector-photolist-interaction-view",function(t){var e=require("hermes-core/type-validator");t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){return""===this.get("container").get("innerHTML")&&this.setContainerHTML(""),this.hasMultiSelect=t.primaryPhotoListConfig&&t.primaryPhotoListConfig.hasMultiSelect,this.multiSelectLimit=void 0===t.primaryPhotoListConfig.multiSelectLimit?1:t.primaryPhotoListConfig.multiSelectLimit,this.listType=t.primaryPhotoListConfig.type,this.galleryId=t.primaryPhotoListConfig.galleryId,this.isDisabled=!1,this.isDisabledSelected=!1,this},loadState:function(){var e=this,i=[];return"galleryFaves"===this.listType&&this.galleryId&&(i.push(this.appContext.getModelRegistry("gallery-photo-association-models").then(function(t){t.exists(e.galleryId+"-"+e.get("id"))&&(e.isDisabled=!0,e.isDisabledSelected=!0)})),i.push(this.appContext.getModel("gallery-faves-models",this.appContext.getViewer().nsid+"-"+e.galleryId).then(function(t){var i=t.getValue("nonGalleryAddablePhotos").getList(),s=!1;i&&(s=i.some(function(t){return t.id===e.get("model").id})),s&&(e.isDisabled=!0)}))),i.push(this.appContext.getModel("profile-selected-photos-models",this.appContext.getViewer().nsid).then(function(t){t.getValue("photos").getFromListByID(this.get("model").getValue("id"))&&this.set("isActive",!0)}.bind(this))),t.Promise.all(i)},buildContainer:function(){var t=this.get("model");return this.setContainerWithTemplate("photo-selector-photo-list-photo-interaction",{photo:t.toJSON(),photoPageUrl:this.get("photoPageUrl")}),this},activate:function(){var e,i,s=this.get("container"),o=s.one(".disabled-overlay");return this.galleryId&&(e=this.intlMessage({intlName:"gallery.PHOTO_CANT_ADD_TO_GALLERY",mediaType:this.get("model").getValue("mediaType")}),i=this.intlMessage({intlName:"gallery.PHOTO_ALREADY_IN_GALLERY",mediaType:this.get("model").getValue("mediaType")})),this.registerEventHandler(s.on("click",this.selectPhoto.bind(this))),this.hasMultiSelect||this.registerEventHandler(t.on("photoSelector:subviewEvent",this.handleOtherPhotoSelected,this)),this.get("isActive")?this.get("isActive")&&s.addClass("active"):s.removeClass("active"),this.isDisabled&&(s.addClass("disabled"),o.setAttribute("title",e)),this.isDisabledSelected&&(s.addClass("disabled-selected"),o.setAttribute("title",i)),this},selectPhoto:function(e){if(e.halt(),!this.isDisabled)if(this.get("isActive")&&this.hasMultiSelect)this.set("isActive",!1),this.get("container").removeClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"unselectPhotoFromPhotoList",id:this.get("id")});else{if(this.hasMultiSelect)return this.appContext.getModel("profile-selected-photos-models",this.appContext.getViewer().nsid).then(function(e){e.getValue("photos").size()+1<=this.multiSelectLimit&&(this.set("isActive",!0),this.get("container").addClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"selectPhotoFromPhotoList",id:this.get("id")}))}.bind(this));this.set("isActive",!0),this.get("container").addClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"selectPhotoFromPhotoList",id:this.get("id")})}},handleOtherPhotoSelected:function(t){if("selectPhotoFromPhotoList"===t.eventName&&this.get("isActive")){if(t.id===this.get("id"))return;this.set("isActive",!1),this.get("container")._node&&this.get("container").removeClass("active")}}},{ATTRS:{id:{writeOnce:"initOnly",validator:function(t,i){return e.photoId(t)}},model:{writeOnce:"initOnly"},photoPageUrl:{writeOnce:"initOnly"}}})},"@VERSION@",{requires:["flickr-view","hermes-template-photo-selector-photo-list-photo-interaction","attribute-helpers"],optionalRequires:["fluid"],langBundles:["common","gallery"]});YUI.add("hermes-lang-gallery",function(e,o){e.Intl.add("hermes/gallery","en-US",{VIEW_YOUR_GALLERIES:["View your galleries"],GALLERIES_WITH_YOUR_ITEMS:["Galleries with your items"],GALLERY_CURATED_BY:['a gallery curated by <a href="',"${ownerUrl}",'">',"${ownerName}","</a>"],GALLERY_CURATED_BY_YOU:['a gallery curated by <a href="',"${ownerUrl}",'">YOU!</a>'],PRIVATE_GALLERY_CURATED_BY:['a private gallery curated by <a href="',"${ownerUrl}",'">',"${ownerName}","</a>"],YOU_ATTRIBUTION:["YOU!"],DESCRIPTION_READ_MORE:["read more"],DESCRIPTION_READ_LESS:["read less"],BACK_TO_GALLERIES_LIST:["Back to galleries list"],ADD_COMMENT:["Add comment"],EDIT_GALLERY:["Edit gallery"],ADD_A_TITLE:["Add a title"],ADD_A_DESCRIPTION:["Add a description"],COVER_PHOTO:["Cover photo"],CHOOSE_A_COVER_PHOTO:["Choose a cover photo"],CHANGE_COVER_PHOTO:["Change cover photo"],PRIVATE_GALLERY:["Private gallery"],DELETE_GALLERY:["Delete gallery"],GALLERY_CONFIRM_DELETE_MESSAGE:["Are you sure you want to delete this gallery?"],MAKE_GALLERY_PUBLIC:["Make this gallery public?"],GALLERY_PUBLIC_EXPLANATION:["This gallery will be visible to others, and notifications will be sent when you add photos."],LARGE_VIEW_LAYOUT_TITLE:["Large view"],REORDER_PHOTOS_LAYOUT_TITLE:["Reorder photos"],GALLERY_PHOTO_REMOVE_MESSAGE:["This photo will be removed from the gallery."],GALLERY_PHOTO_REMOVE_TITLE:["Remove this photo from the gallery?"],PHOTO_REMOVED:[{type:"select",valueName:"mediaType",options:{photo:["Photo"],video:["Video"],other:["Photo"]}}," removed"],REMOVE_FROM_GALLERY:["Remove from gallery"],GALLERY_REMARK_OWNER_SAYS:["${ownerName}"," says:"],GALLERY_REMARK_WHY:["Why did you choose this ",{type:"select",valueName:"mediaType",options:{photo:["photo"],video:["video"],other:["photo"]}},"?"],IN_THIS_GALLERY:["In this gallery:"],AND_COUNT_MORE:["and ","${count}"," more"],NEW_GALLERY:["New Gallery"],NOTHING_HERE_YET:["Nothing here yet."],NOTHING_HERE_YET_DETAILS:["You can save a photo or video to a gallery from its detail page, or choose from your faves here."],ADD_PHOTOS_AND_VIDEOS:["Add photos and videos"],REMOVING:["Removing..."],ARE_YOU_SURE_REMOVE_PHOTO:["Are you sure you want to remove this ",{type:"select",valueName:"mediaType",options:{photo:["photo"],video:["video"],other:["photo"]}},"?"],ARE_YOU_SURE_REMOVE_VIDEO:["Are you sure you want to remove this video?"],GALLERY_ADD:["Add"],GALLERY_CHOOSE_PHOTOS_LIMIT:[{type:"plural",valueName:"limit",options:{one:"Choose up to ${#} more photo to add to your gallery.",other:"Choose up to ${#} more photos to add to your gallery."}}],GALLERY_FULL_CANT_ADD:["Your gallery is full! To add new photos, you need to remove some first."],GALLERY_EDIT_REMARK_TOOLTIP:["Edit remark"],GALLERY_VIEW_REMARK_TOOLTIP:["View remark"],GALLERY_FEATURED_BANNER_MESSAGE:['You’re looking at the new Flickr galleries. <a href="',"${learnUrl}",'" class="learn-more-link">Learn more</a>. <a href="',"${feedbackUrl}",'" class="feedback-link">Share feedback</a>.'],GALLERY_FEATURED_TITLE:["New Galleries"],GALLERY_FEATURED_DESCRIPTION:["Now with more features and up to 500 photos."],GALLERY_FEATURED_LEARN_MORE:["Learn More"],GALLERY_FEATURED_SUBMIT_FEEDBACK:["Submit Feedback"],PHOTO_CANT_ADD_TO_GALLERY:["This ",{type:"select",valueName:"mediaType",options:{photo:["photo"],video:["video"],other:["photo"]}}," can’t be added to the gallery."],PHOTO_ALREADY_IN_GALLERY:["This ",{type:"select",valueName:"mediaType",options:{photo:["photo"],video:["video"],other:["photo"]}}," is already in the gallery."],USER_HASNT_CREATED_GALLERIES:["${ownerName}"," hasn’t created any galleries yet."],GALLERIES_COUNT:[{type:"plural",valueName:"count",options:{one:["${countString}"," gallery"],other:["${countString}"," galleries"]}}]})},"@VERSION@",{requires:["intl"]});YUI.add("hermes-template-photo-selector-sets-photolist-set-interaction",function(e,t){var a=e.Template.Handlebars.revive({1:function(e,t,a,l,n){var s;return'\t\t\t\t<span class="album-photo-count">'+e.escapeExpression((a.intlMessage||t&&t.intlMessage||a.helperMissing).call(null!=t?t:{},{name:"intlMessage",hash:{selectedCount:null!=(s=null!=t?t.album:t)?s.publicPhotosCount:s,intlName:"album-page.PUBLIC_ITEMS_COUNT"},data:n}))+"</span>\n"},3:function(e,t,a,l,n){var s;return'\t\t\t<span class="album-photo-count">'+e.escapeExpression((a.intlMessage||t&&t.intlMessage||a.helperMissing).call(null!=t?t:{},{name:"intlMessage",hash:{selectedCount:null!=(s=null!=t?t.album:t)?s.totalCount:s,intlName:"album-page.PHOTOS_COUNT"},data:n}))+"</span>\n"},compiler:[7,">= 4.0.0"],main:function(e,t,a,l,n){var s;return'<div class="photo-list-album-interaction photo-selector-album dark">\n\t<div class="interaction-bar">\n\t\t<h4 class="album-title">'+e.escapeExpression(e.lambda(null!=(s=null!=t?t.album:t)?s.title:s,t))+"</h4>\n"+(null!=(s=a.if.call(null!=t?t:{},null!=t?t.publicOnlyPhotos:t,{name:"if",hash:{},fn:e.program(1,n,0),inverse:e.program(3,n,0),data:n}))?s:"")+"\t</div>\n</div>\n"},useData:!0}),l={};e.Array.each([],function(t){var a=e.Template.get("hermes/"+t);a&&(l[t]=a)}),e.Template.register("hermes/photo-selector-sets-photolist-set-interaction",function(t,n){return n=n||{},n.partials=n.partials?e.merge(l,n.partials):l,a(t,n)})},"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("photo-selector-sets-photolist-interaction-view",function(t){var e=require("hermes-core/type-validator");t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){return""===this.get("container").get("innerHTML")&&this.setContainerHTML(""),this.publicOnlyPhotos=t.publicOnlyPhotos,this},loadState:function(){return this.appContext.getModel(this.get("engagementModelName"),this.get("id")).then(function(t){this.set("engagement",t)}.bind(this))},buildContainer:function(){return this.setContainerWithTemplate("photo-selector-sets-photolist-set-interaction",{album:this.get("model").toJSON(),publicOnlyPhotos:this.publicOnlyPhotos,albumPageUrl:this.get("albumPageUrl")}),this},activate:function(){return this.registerEventHandler(this.get("container").on("click",this.selectSet.bind(this))),this},selectSet:function(e){e.halt(),t.fire("photoSelector:subviewEvent",{eventName:"selectSetFromPhotoList",id:this.get("id"),title:this.get("model").getValue("title")})},destructor:function(){}},{ATTRS:{id:{writeOnce:"initOnly",validator:function(t,i){return e.photoId(t)}},model:{writeOnce:"initOnly"},albumPageUrl:{writeOnce:"initOnly"},engagement:{value:null},engagementModelName:{writeOnce:"initOnly",value:null,validator:function(e,i){return t.AttributeHelpers.validateString(e)}}}})},"@VERSION@",{requires:["flickr-view","hermes-template-photo-selector-sets-photolist-set-interaction","attribute-helpers"],optionalRequires:["fluid"],langBundles:["album-page"]});YUI.add("hermes-lang-album-page",function(e,o){e.Intl.add("hermes/album-page","en-US",{PHOTOS_COUNT:[{type:"plural",valueName:"selectedCount",options:{one:"${#} photo",other:"${#} photos"}}],PUBLIC_PHOTOS_COUNT:[{type:"plural",valueName:"selectedCount",options:{one:"${#} public photo",other:"${#} public photos"}}],PUBLIC_ITEMS_COUNT:[{type:"plural",valueName:"selectedCount",options:{one:"${#} public item",other:"${#} public items"}}],VIDEOS_COUNT:[{type:"plural",valueName:"selectedCount",options:{one:"${#} video",other:"${#} videos"}}],VIEWS_COUNT:[{type:"plural",valueName:"selectedCount",options:{one:"${#} view",other:"${#} views"}}],BACK_TO_ALBUMS:["Back to albums list"],EDIT_IN_ORGANIZR:["Edit in Organizr"],EDIT_COVER:["Edit cover"],SELECT_COVER_PHOTO:["Select a cover photo"],SELECT:["Select"],ERROR_COVER_PHOTO:["There was a problem trying to set your cover photo. Please try again."],ERROR_UPDATING_ALBUM_TITLE_DESCRIPTION:["There was an error updating the album's title and description."],ALBUM_ADD_DESCRIPTION:["Click here to enter a description for this album"],ERROR_CREATING_PHOTOBOOK_FROM_ALBUM:["There was a problem creating the book for this album. Please try again later."],ALBUM_DESCRIPTION:["Album description"],CREATE_BOOK_FROM_ALBUM:["Make a book from this Album"],DOWNLOAD_PHOTOS_AND_VIDEO:["Download ",{type:"plural",valueName:"photoCount",options:{one:"${#} photo",other:"${#} photos"}}," & ",{type:"plural",valueName:"videoCount",options:{one:"${#} video",other:"${#} videos"}}],DOWNLOAD_PHOTOS:["Download ",{type:"plural",valueName:"photoCount",options:{one:"${#} photo",other:"${#} photos"}}],DOWNLOAD_VIDEOS:["Download ",{type:"plural",valueName:"videoCount",options:{one:"${#} video",other:"${#} videos"}}],DOWNLOAD_ZIP:["Download zip"],DOWNLOAD_ZIP_PART:["Download zip part ","${partSequence}"],ALOT_OF_PHOTOS:["Wow, that's a lot of photos! Click to download each batch as a zip file."],DOWNLOAD_ALBUM_NOT_AVAILABLE_ERROR:["There are no photos or videos available in this album for you to download."],DOWNLOAD_ALBUM_DISABLED_ERROR:["Album downloading is currently unavailable. Please try again in a minute."],DOWNLOAD_ALBUM_GENERIC_ERROR:["There was an error downloading this album. Please try again."],DOWNLOAD_ALBUM_LICENSE_MESSAGE:["These photos may have one or more license types. Please visit the individual photo page for more information about the license prior to downloading this album."],DOWNLOAD_ALBUM_LICENSE_MESSAGE_ALT:["These photos may have one or more license types. Prior to downloading this album, please visit the individual photo pages to understand the designated license type for each image"],DOWNLOAD_ALBUM_LICENSE_MESSAGE_ALT_2:["These photos may have one or more license types or their rights may be reserved. Prior to downloading this album, please visit the individual photo pages to understand the designated license type for each image."],DOWNLOAD_ALBUM_LEARN_MORE:['Learn more at <a href="https://www.flickr.com/creativecommons" target="_blank">Creative Commons</a>'],CONFIRM_ALBUM_DELETE_NO_CONTENTS_DELETED:["Do you really want to delete this album? (Don't worry, none of the contents will be deleted.)"],DELETE_THIS_ALBUM:["Delete this album"],SHARE_THIS_ALBUM:["Share this album"],CREATE_NEW_ALBUM:["Create new album"],NEW_ALBUM:["New album"],NEW_COLLECTION:["New collection"],VIEW_COLLECTIONS:["View collections"],VIEW_MY_COLLECTIONS:["View my collections"],SORT:["Sort"],SORT_DATE_TAKEN_OLDEST:["Sort by date taken (oldest first)"],SORT_DATE_TAKEN_NEWEST:["Sort by date taken (newest first)"],SORT_DATE_UPLOADED_OLDEST:["Sort by date uploaded (oldest first)"],SORT_DATE_UPLOADED_NEWEST:["Sort by date uploaded (newest first)"],SORT_ALPHABETICALLY:["Alphabetically"],SORT_RANDOMLY:["Randomly"],SORT_REVERSE:["Reverse current order"],SORT_ALMOST_DONE:["Almost done..."],TIMEOUT_FAILURE:["We're having some trouble displaying this album at the moment. Please try again."],OPENGRAPH_DESCRIPTION:["Explore this photo album by ","${owner}"," on Flickr!"]})},"@VERSION@",{requires:["intl"]});YUI.add("photo-selector-view",function(t,e){var o=require("hermes-core/flog")(e),i={};i={horizontal:20,vertical:20},t.FlickrView.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){return""===this.get("container").getHTML()&&this.setContainerWithTemplate("flickr-balls"),this.photoListView,this.searchPhotoListViews=[],this.publicOnlyGroups=t.publicOnlyGroups,this.publicOnlyPhotos=t.publicOnlyPhotos,this.safeOnlyPhotos=t.safeOnlyPhotos||!1,this.enableMultiSelect=t.enableMultiSelect||!1,this.multiSelectLimit=void 0===t.multiSelectLimit?1:t.multiSelectLimit,this.preSelectedPhotos=t.preSelectedPhotos||[],this.clearRegistriesOnDestroy=t.clearRegistriesOnDestroy||!1,this.selectedModels=[],t.enableVideos&&this.set("itemFilterFunction",!1),this.isUploading=!1,this},loadState:function(){var e=this.appContext.getViewer().nsid,o={};return this.safeOnlyPhotos&&(e+="-safe",o.safeSearch="true"),this.publicOnlyPhotos&&(e+="-public",o.viewAs="public"),this.appContext.getModelRegistry("profile-selected-photos-models").then(function(i){i.removeAll();var s={selectionModel:this.appContext.getModel("profile-selected-photos-models",this.appContext.getViewer().nsid),photostreamModel:this.appContext.getModel("photostream-models",e,o),setModelRegistry:this.appContext.getModelRegistry("set-models"),setsModel:this.appContext.getModel("sets-models",this.appContext.getViewer().nsid,{page:1,perPage:25}),profileModel:this.appContext.getModel("person-profile-models",this.appContext.getViewer().nsid)};return new t.FlickrPromise(s).then(this.onLoadStateResolved.bind(this))}.bind(this))},onLoadStateResolved:function(e){if(this.set("selectionModel",e.selectionModel),this.set("photostreamModel",e.photostreamModel),this.set("setsModel",e.setsModel),this.set("setModelRegistry",e.setModelRegistry),this.set("profileModel",e.profileModel),this.preSelectedPhotos&&this.preSelectedPhotos.length>0&&this.get("selectionModel").setValue("photos",this.preSelectedPhotos?this.preSelectedPhotos:[]),0===this.get("photostreamModel").getValue("totalItems")?this.set("photostreamEmpty",!0):this.set("photostreamEmpty",!1),this.get("groupId"))return this.appContext.getModel("group-pool-models",this.get("groupId")).then(function(t){this.set("groupModel",t)}.bind(this),function(t){o.error("error loading group model",{err:t})});this.canUpload=this.get("hasUploadCapabilities")&&!t.UserLimitsHelper.hasReachedUploadLimit(this.get("profileModel"),this.appContext)},moveElementToFirstInArray:function(t,e,o){var i;return t.forEach(function(t,s){t[o]===e&&(i=s)}),t.unshift(t.splice(i,1)[0]),t},buildContainer:function(){return this.setContainerWithTemplate("photo-selector",{hasUploadCapabilities:this.get("hasUploadCapabilities"),canUpload:this.canUpload,searchable:this.get("searchable"),publicOnlyPhotos:this.get("publicOnlyPhotos"),photostreamEmpty:this.get("photostreamEmpty"),hasGroupCapabilities:this.get("groupId")}),this},loadPhotoList:function(e,s){var a,r=this,l=this.get("container"),n=l.one(".photo-selector-photos-wrapper");this.photoListView&&this.photoListView.destroy(),s||(s=!1),a={modelParams:e,fetchParams:e.fetchParams,parentName:this.name,hasMultiSelect:this.enableMultiSelect,multiSelectLimit:this.multiSelectLimit,paginateOnScroll:!0,parentContainer:n,relayoutOnResize:!0,interactionViewName:this.get("interactionViewName"),galleryId:this.get("galleryId"),type:this.get("defaultSelected").type},this.get("itemFilterFunction")&&(a.itemFilterFunction=this.get("itemFilterFunction")),a.layout={targetRowHeight:150,containerWidth:a.parentContainer.get("offsetWidth"),containerPadding:{top:10,right:20,bottom:10,left:20},itemSpacing:i,forceAspectRatio:1,alwaysDisplayOrphans:!1,awakeBoundsToViewportSizeRatio:5,viewportContainerNodeHeight:n.get("offsetHeight")},this.appContext.params.primaryPhotoListConfig=a,this.appContext.getView(this.get("photoListViewName"),{appContext:this.appContext,publicOnlyPhotos:this.publicOnlyPhotos,primaryPhotoListConfig:a,isActiveViewAgnostic:!0,container:l.one(".photo-selector-photos-container")}).then(function(e){return e.initialize().then(function(e){var o,i=l.one(".photo-selector-photos-container"),a=i.one(".photo-list-view"),h=l.one(".loader");n.getDOMNode().scrollTop=0,r.photoListView=e,h&&h.addClass("loaded"),a.hasChildNodes()||(o=s?t.Node.create('<p class="no-results">'+r.intlMessage({intlName:"search.NO_MATCHES_FOR_QUERY_TERM_YOUR"})+"</p>"):r.publicOnlyPhotos?t.Node.create('<p class="no-results">'+r.intlMessage({intlName:"common.PHOTO_SELECTOR_EMPTY_PUBLIC_PHOTOS"})+"</p>"):t.Node.create('<p class="no-results">'+r.intlMessage({intlName:"common.PHOTO_SELECTOR_EMPTY_PHOTOS"})+"</p>"),a.empty(),i.prepend(o)),r.addPhotoToSelection(null)})},function(t){o.error("Error getting view",{err:t})})},loadSelectionPhotoList:function(){var e,s=this,a=this.get("container"),r=a.one(".photo-selector-photos-wrapper");this.photoListView&&this.photoListView.destroy(),(e={parentName:this.name,hasMultiSelect:this.enableMultiSelect,multiSelectLimit:this.multiSelectLimit,paginateOnScroll:!0,initialItems:this.get("selectionModel").getValue("photos").getList(),parentContainer:r,relayoutOnResize:!0,interactionViewName:"photo-selector-selection-interaction-view"}).layout={targetRowHeight:150,containerWidth:e.parentContainer.get("offsetWidth"),containerPadding:{top:10,right:20,bottom:10,left:20},itemSpacing:i,forceAspectRatio:1,alwaysDisplayOrphans:!0,awakeBoundsToViewportSizeRatio:5,viewportContainerNodeHeight:r.get("offsetHeight")},this.get("itemFilterFunction")&&(e.itemFilterFunction=this.get("itemFilterFunction")),this.appContext.params.primaryPhotoListConfig=e,this.appContext.getView(this.get("photoListViewName"),{appContext:this.appContext,publicOnlyPhotos:this.publicOnlyPhotos,primaryPhotoListConfig:e,isActiveViewAgnostic:!0,nsid:this.appContext.getViewer().nsid,container:a.one(".photo-selector-photos-container")}).then(function(e){return e.initialize().then(function(e){var o,i=a.one(".photo-selector-photos-container"),l=i.one(".photo-list-view"),n=a.one(".loader");i.addClass("photo-selector-selection-photolist"),r.getDOMNode().scrollTop=0,s.photoListView=e,n&&n.addClass("loaded"),l.hasChildNodes()||(o=t.Node.create('<p class="no-results">'+s.intlMessage({intlName:"profile.NO_PHOTOS_SELECTED"})+"</p>"),l.empty(),i.prepend(o))})},function(t){o.error("Error getting view",{err:t})})},loadGroupPhotoList:function(e){var s,a=this,r=this.get("container"),l=r.one(".group-photo-selector-photos-wrapper");this.photoListView&&this.photoListView.destroy(),s={modelParams:e,parentName:this.name,paginateOnScroll:!0,parentContainer:l,relayoutOnResize:!0,interactionViewName:this.get("interactionViewName")},this.get("itemFilterFunction")&&(s.itemFilterFunction=this.get("itemFilterFunction")),s.layout={targetRowHeight:150,containerWidth:s.parentContainer.get("offsetWidth"),containerPadding:{top:10,right:20,bottom:10,left:20},itemSpacing:i,forceAspectRatio:1,alwaysDisplayOrphans:!1,awakeBoundsToViewportSizeRatio:5,viewportContainerNodeHeight:l.get("offsetHeight")},this.appContext.params.primaryPhotoListConfig=s,this.appContext.getView(this.get("photoListViewName"),{appContext:this.appContext,publicOnlyPhotos:this.publicOnlyPhotos,primaryPhotoListConfig:s,isActiveViewAgnostic:!0,container:l}).then(function(e){return e.initialize().then(function(e){var o,i=r.one(".group-photo-selector-photos-container"),s=i.one(".photo-list-view");l.getDOMNode().scrollTop=0,a.photoListView=e,r.one(".loader").addClass("loaded"),s.hasChildNodes()||(o=t.Node.create('<p class="no-results">'+a.intlMessage({intlName:"groups.GROUP_POOL_CONTAINS_NO_PUBLIC_PHOTOS"})+"</p>"),s.empty(),i.prepend(o)),a.addPhotoToSelection(null)})},function(t){o.error("Error getting view",{err:t})})},loadSetsPhotoList:function(t){var e,s=this,a=this.get("container");this.photoListView&&this.photoListView.destroy(),(e={modelParams:t,parentName:this.name,paginateOnScroll:!0,parentContainer:a.one(".photo-selector-photos-wrapper"),relayoutOnResize:!0,interactionViewName:this.get("setsInteractionViewName"),engagementModelName:"set-models",viewBeaconRestrictedAttribute:"primaryNeedsInterstitial"}).layout={targetRowHeight:200,containerWidth:e.parentContainer.get("offsetWidth"),containerPadding:{top:10,right:20,bottom:10,left:20},itemSpacing:i,forceAspectRatio:1,alwaysDisplayOrphans:!1,awakeBoundsToViewportSizeRatio:5,viewportContainerNodeHeight:a.one(".photo-selector-photos-wrapper").get("offsetHeight")},this.appContext.params.primaryPhotoListConfig=e,this.appContext.getView(this.get("photoListViewName"),{appContext:this.appContext,publicOnlyPhotos:this.publicOnlyPhotos,primaryPhotoListConfig:e,isActiveViewAgnostic:!0,container:a.one(".photo-selector-photos-container")}).then(function(t){return t.initialize().then(function(t){var e=a.one(".loader");a.one(".photo-selector-photos-container .photo-list-view");a.one(".photo-selector-photos-wrapper").getDOMNode().scrollTop=0,s.photoListView=t,e&&a.one(".loader").addClass("loaded"),s.addPhotoToSelection(null)})},function(t){o.error("Error getting view",{err:t})})},loadSearchPhotoList:function(t){var e,s=this,a=this.get("container"),r=t.photoListContainerSelector?a.one(t.photoListContainerSelector):a.one(".photo-selector-photos-container"),l=t.parentContainerSelector?a.one(t.parentContainerSelector):a.one(".photo-selector-photos-wrapper"),n=t.maxNumRows?this.get("limitedRowsPhotoListViewName"):this.get("photoListViewName");this.searchPhotoListViews&&this.searchPhotoListViews[t.listId]&&this.searchPhotoListViews[t.listId].destroy(),e={modelParams:t.modelParams,parentName:this.name,paginateOnScroll:!0,parentContainer:l,relayoutOnResize:!0,interactionViewName:this.get("interactionViewName"),engagementModelName:"photo-lite-models"},this.get("itemFilterFunction")&&(e.itemFilterFunction=this.get("itemFilterFunction")),e.layout={targetRowHeight:150,containerWidth:e.parentContainer.get("offsetWidth"),containerPadding:{top:10,right:0,bottom:10,left:0},itemSpacing:i,forceAspectRatio:1,maxNumRows:t.maxNumRows?t.maxNumRows:Number.POSITIVE_INFINITY,alwaysDisplayOrphans:!!t.alwaysDisplayOrphans&&t.alwaysDisplayOrphans,awakeBoundsToViewportSizeRatio:5,viewportContainerNodeHeight:l.get("offsetHeight")},this.appContext.params.primaryPhotoListConfig=e,this.appContext.getView(n,{appContext:this.appContext,publicOnlyPhotos:this.publicOnlyPhotos,primaryPhotoListConfig:e,isActiveViewAgnostic:!0,container:r,searchUrl:t.searchUrl,listId:t.listId}).then(function(e){return e.initialize().then(function(e){s.registerEventHandler(e.on("subviewViewEvent",s.handleSubviewEvent,s)),a.one(".photo-selector-search-lists-wrapper").getDOMNode().scrollTop=0,t.parentContainerSelector&&(a.one(t.parentContainerSelector).getDOMNode().scrollTop=0),s.searchPhotoListViews[t.listId]=e,a.one(".loader").addClass("loaded"),s.addPhotoToSelection(null)})},function(t){o.error("Error getting view",{err:t})})},activate:function(){var e,o=this.get("container"),i=this.get("defaultSelected");return this.registerEventHandler(o.on("click",this.handleClick,this)),this.canUpload&&this.registerEventHandler(o.one(".file-select").on("change",this.handleFileSelect,this)),this.registerEventHandler(t.on("photoSelector:subviewEvent",this.handleSubviewEvent,this)),i?"group"===i.type?(e={registryName:"group-pool-models",modelIdOrAttributes:this.get("groupId")+"-public",collectionAttributeName:"photoPageList"},this.publicOnlyGroups&&(e.fetchParams={privacyFilter:1},e.modelIdOrAttributes+="-public"),this.toggleGroupSelector(),this.loadGroupPhotoList(e),this.toggleTitleBar(i.title,"group")):"gallery"===i.type?(e={registryName:"gallery-info-models",modelIdOrAttributes:i.id,collectionAttributeName:"photoList"},this.loadPhotoList(e)):"galleryFaves"===i.type?(e={registryName:"gallery-faves-models",modelIdOrAttributes:this.get("defaultSelected").id,collectionAttributeName:"photoList",fetchParams:{galleryId:this.get("galleryId")}},this.loadPhotoList(e)):(e={registryName:"set-models",modelIdOrAttributes:i.id,collectionAttributeName:"photoPageList",fetchParams:{}},this.publicOnlyPhotos&&(e.modelIdOrAttributes+="-public",e.fetchParams.filter=1),this.safeOnlyPhotos&&(e.modelIdOrAttributes+="-safe",e.fetchParams.moderationFilter=1),this.loadPhotoList(e),this.toggleTitleBar(i.title,"set")):0===this.get("photostreamModel").getValue("totalItems")?this.get("hasUploadCapabilities")?(this.toggleUploader(),this.hideTitleBar()):this.toggleTitleBar(this.intlMessage({intlName:"common.PHOTO_SELECTOR_EMPTY_PUBLIC_PHOTOS"},"empty",!1)):(e={registryName:"photostream-models",modelIdOrAttributes:this.appContext.getViewer().nsid,collectionAttributeName:"photoPageList",fetchParams:{}},this.safeOnlyPhotos&&(e.modelIdOrAttributes+="-safe",e.fetchParams.safeSearch="true"),this.publicOnlyPhotos&&(e.modelIdOrAttributes+="-public",e.fetchParams.viewAs="public"),this.loadPhotoList(e,!1)),this},toggleUploader:function(){this.get("hasUploadCapabilities")&&(this.get("container").one(".photo-selector-photos-wrapper").addClass("is-hiding"),this.photoListView&&this.get("container").one(".photo-selector-photos-container").empty().append(this.templates("flickr-balls")({})),this.get("container").one(".photo-selector-search-lists-wrapper").addClass("is-hiding"),this.get("container").one(".photo-selector-upload").removeClass("is-hiding"),this.get("groupId")&&this.get("container").one(".group-photo-selector-photos-wrapper").addClass("is-hiding"))},toggleSelector:function(){this.get("hasUploadCapabilities")&&this.get("container").one(".photo-selector-upload").addClass("is-hiding"),this.get("container").one(".photo-selector-search-lists-wrapper").addClass("is-hiding"),this.get("groupId")&&this.get("container").one(".group-photo-selector-photos-wrapper").addClass("is-hiding"),this.get("container").one(".photo-selector-photos-wrapper").removeClass("is-hiding")},toggleSearchListsSelector:function(){this.get("hasUploadCapabilities")&&this.get("container").one(".photo-selector-upload").addClass("is-hiding"),this.get("container").one(".photo-selector-photos-wrapper").addClass("is-hiding"),this.photoListView&&this.get("container").one(".photo-selector-photos-container").empty().append(this.templates("flickr-balls")({})),this.get("container").one(".photo-selector-search-lists-wrapper").removeClass("is-hiding"),this.get("groupId")&&this.get("container").one(".group-photo-selector-photos-wrapper").addClass("is-hiding")},toggleGroupSelector:function(){var t=this.get("container").one(".photo-selector-upload");t&&t.addClass("is-hiding"),this.get("container").one(".photo-selector-photos-wrapper").addClass("is-hiding"),this.photoListView&&this.get("groupId")&&this.get("container").one(".group-photo-selector-photos-wrapper").empty().append(this.templates("flickr-balls")({})),this.get("container").one(".photo-selector-search-lists-wrapper").addClass("is-hiding"),this.get("groupId")&&this.get("container").one(".group-photo-selector-photos-wrapper").removeClass("is-hiding")},toggleTitleBar:function(e,o,i){var s=this.get("container"),a=s.one(".photo-selector-title-bar"),r=a.one(".back-to-list"),l="";void 0===i&&(i=!0),"search"===o&&e&&(e='"'+e+'"'),"set"===o?l=this.intlMessage({intlName:"common.PHOTO_SELECTOR_BACK_TO_ALBUM_LIST"}):"search"===o&&(l=this.intlMessage({intlName:"common.PHOTO_SELECTOR_BACK_TO_SEARCH_LIST"})),i?r.removeClass("hidden"):r.addClass("hidden"),r.one(".back-to-list-text").set("text",l),a.one(".title").set("text",t.Handlebars.helpers.truncate(e,120)),a.removeClass("hidden"),s.one(".photo-selector-photos-wrapper").addClass("showing-title"),s.one(".photo-selector-search-lists-wrapper").addClass("showing-title"),this.get("groupId")&&s.one(".group-photo-selector-photos-wrapper").addClass("showing-title")},hideTitleBar:function(){var t=this.get("container");t.one(".photo-selector-title-bar").addClass("hidden"),t.one(".photo-selector-photos-wrapper").removeClass("showing-title"),this.get("groupId")&&t.one(".group-photo-selector-photos-wrapper").removeClass("showing-title")},onParentViewEvent:function(e,o){var i,s,a,r=o[1],l={},n=this.get("searchable"),h=this.get("container").one(".no-results");if("navigation"===o[0])if("upload"===(i=r.target._node.dataset.value))this.get("hasUploadCapabilities")&&(this.toggleUploader(),this.hideTitleBar()),this.get("fileDragDrop")?this.get("fileDragDrop").reset():this.canUpload&&(this.set("fileDragDrop",new t.HtmlFileDragDrop({dropZone:".photo-selector-upload > .drop-zone"})),this.get("fileDragDrop").on("drop",this.handleFileDrop,this));else{if(this.get("hasUploadCapabilities")&&this.toggleSelector(),"group"===i)s={registryName:"group-pool-models",modelIdOrAttributes:this.get("groupId"),collectionAttributeName:"photoPageList"},this.publicOnlyGroups&&(s.fetchParams={privacyFilter:1},s.modelIdOrAttributes+="-public"),this.toggleGroupSelector(),this.loadGroupPhotoList(s);else if("photostream"===i){if(0===this.get("photostreamModel").getValue("totalItems"))return h&&h.remove(),void(this.get("hasUploadCapabilities")?(this.toggleUploader(),this.hideTitleBar()):this.toggleTitleBar(this.intlMessage({intlName:"common.PHOTO_SELECTOR_EMPTY_PUBLIC_PHOTOS"},"empty",!1)));s={registryName:"photostream-models",modelIdOrAttributes:this.appContext.getViewer().nsid,collectionAttributeName:"photoPageList",fetchParams:{}},this.safeOnlyPhotos&&(s.modelIdOrAttributes+="-safe",s.fetchParams.safeSearch="true"),this.publicOnlyPhotos&&(s.modelIdOrAttributes+="-public",s.fetchParams.viewAs="public"),this.loadPhotoList(s)}else if("sets"===i){if(0===this.get("setsModel").getValue("totalItems")){var p=this.get("container").one(".photo-list-view");return h&&h.remove(),this.toggleTitleBar(this.intlMessage({intlName:"common.PHOTO_SELECTOR_NO_ALBUMS"},"empty",!1)),void p.empty()}s={registryName:"sets-models",modelIdOrAttributes:this.appContext.getViewer().nsid,collectionAttributeName:"albumsList"},this.loadSetsPhotoList(s)}else"gallery"===i?(s={registryName:"gallery-info-models",modelIdOrAttributes:this.get("galleryId"),collectionAttributeName:"photoList"},this.loadPhotoList(s)):"galleryFaves"===i?(s={registryName:"gallery-faves-models",modelIdOrAttributes:this.get("defaultSelected").id,collectionAttributeName:"photoList",fetchParams:{galleryId:this.get("galleryId")}},this.loadPhotoList(s)):this.loadSelectionPhotoList();this.hideTitleBar()}else"search"===o[0]&&(a=new t.SearchUrl(r.apiParams,this.appContext),this.toggleSearchListsSelector(),n.yours&&(this.searchUrlYourPhotos=new t.SearchUrl(r.apiParams,this.appContext),this.searchUrlYourPhotos.setAPIParam("user_id",this.appContext.getViewer().nsid),n.contacts||n.everyone?(l.listId="yours",l.photoListContainerSelector=".photo-selector-search-list-yours .photo-selector-search-list-container",l.parentContainerSelector=".photo-selector-search-list-yours",l.maxNumRows=1,l.alwaysDisplayOrphans=!0,l.searchUrl=this.searchUrlYourPhotos,l.modelParams={registryName:"search-photos-lite-models",modelIdOrAttributes:this.searchUrlYourPhotos.getId(),collectionAttributeName:"photos",fetchParams:{apiParams:this.searchUrlYourPhotos.getAPIParams()}},this.publicOnlyPhotos&&(s.fetchParams.privacyFilter=1),this.loadSearchPhotoList(l)):(this.toggleSelector(),s={registryName:"search-photos-lite-models",modelIdOrAttributes:this.searchUrlYourPhotos.getId(),collectionAttributeName:"photos",fetchParams:{apiParams:this.searchUrlYourPhotos.getAPIParams(),additionalExtras:["o_dims"]}},this.publicOnlyPhotos&&(s.fetchParams.privacyFilter=1),this.loadPhotoList(s,!0))),n.contacts&&(this.searchUrlContactsPhotos=new t.SearchUrl(r.apiParams,this.appContext),this.searchUrlContactsPhotos.setAPIParam("user_id",this.appContext.getViewer().nsid),this.searchUrlContactsPhotos.setAPIParam("contacts","all"),l.listId="contacts",l.photoListContainerSelector=".photo-selector-search-list-contacts .photo-selector-search-list-container",l.parentContainerSelector=".photo-selector-search-list-contacts",l.maxNumRows=1,l.alwaysDisplayOrphans=!0,l.searchUrl=this.searchUrlContactsPhotos,l.modelParams={registryName:"search-photos-lite-models",modelIdOrAttributes:this.searchUrlContactsPhotos.getId(),collectionAttributeName:"photos",fetchParams:{apiParams:this.searchUrlContactsPhotos.getAPIParams()}},this.loadSearchPhotoList(l)),n.everyone&&(this.searchUrlEveryonePhotos=new t.SearchUrl(r.apiParams,this.appContext),l.listId="everyone",l.photoListContainerSelector=".photo-selector-search-list-everyone .photo-selector-search-list-container",l.parentContainerSelector=".photo-selector-search-list-everyone",l.maxNumRows=1,l.alwaysDisplayOrphans=!0,l.searchUrl=this.searchUrlEveryonePhotos,l.modelParams={registryName:"search-photos-lite-models",modelIdOrAttributes:r.id,collectionAttributeName:"photos",fetchParams:{apiParams:this.searchUrlEveryonePhotos.getAPIParams()}},this.loadSearchPhotoList(l)),this.toggleTitleBar(a.getAPIParams().text,"search",!1))},handleSubviewEvent:function(e){var o,i,s;return"selectPhotoFromPhotoList"===e.eventName?(o={photoModel:this.appContext.getModel("photo-models",e.id)},new t.FlickrPromise(o).then(function(t){t.photoModel.isOwner&&this.set("photoSource",this.get("photoSourceOwnImage")),this.enableMultiSelect&&this.hasReachMultiSelectLimit()||this.addPhotoToSelection(t.photoModel.id,t.photoModel)}.bind(this))):"unselectPhotoFromPhotoList"===e.eventName?(o={photoModel:this.appContext.getModel("photo-models",e.id)},new t.FlickrPromise(o).then(function(t){t.photoModel.isOwner&&this.set("photoSource",this.get("photoSourceOwnImage")),this.removePhotoFromSelection(t.photoModel.id,t.photoModel)}.bind(this))):"selection:remove"===e.eventName?(o={photoModel:this.appContext.getModel("photo-models",e.model.getValue("id"))},new t.FlickrPromise(o).then(function(t){t.photoModel.isOwner&&this.set("photoSource",this.get("photoSourceOwnImage")),this.removePhotoFromSelection(t.photoModel.id,t.photoModel,!0)}.bind(this))):void("selectSetFromPhotoList"===e.eventName?(i={registryName:"set-models",modelIdOrAttributes:e.id,collectionAttributeName:"photoPageList",fetchParams:{}},this.publicOnlyPhotos&&(i.modelIdOrAttributes+="-public",i.fetchParams.filter=1),this.safeOnlyPhotos&&(i.modelIdOrAttributes+="-safe",i.fetchParams.moderationFilter=1),this.loadPhotoList(i,!1),this.toggleTitleBar(e.title,"set")):e.details&&"viewEntireSearchList"===e.details[0]&&(i={registryName:"search-photos-lite-models",modelIdOrAttributes:e.details[1].searchUrl.getId(),collectionAttributeName:"photos",fetchParams:{apiParams:e.details[1].searchUrl.getAPIParams()}},this.publicOnlyPhotos&&(i.fetchParams.privacyFilter=1),this.toggleSelector(),this.loadPhotoList(i),s="search.YOUR_PHOTOS","contacts"===e.details[1].list?s="search.FROM_YOUR_CONTACTS":"everyone"===e.details[1].list&&(s="search.EVERYONES_PHOTOS"),s=this.intlMessage({intlName:s}),this.toggleTitleBar(s+": "+e.details[1].searchUrl.getAPIParams().text,"search")))},handleClick:function(t){var e=t.target;this.isUploading||(e.ancestor(".back-to-list",!0)?this.fire("subviewViewEvent","backToList"):e.ancestor(".simulate-file-select",!0)&&(t.halt(),this.get("container").one(".file-select").set("value",""),this.get("container").one(".file-select").getDOMNode().click()))},handleSelectPhoto:function(e){var o;if(o={photoModel:this.appContext.getModel("photo-models",e.getData("photo-id"))},!e.hasClass("invalid"))return this.set("photoSource",this.get("photoSourceOwnImage")),new t.FlickrPromise(o).then(function(t){this.addPhotoToSelection(t.photoModel.id,t.photoModel)}.bind(this))},hasReachMultiSelectLimit:function(){return this.get("selectionModel").getValue("photos").size()===this.multiSelectLimit},addPhotoToSelection:function(e,o){if(null===e)this.set("selected",null),t.fire("photoSelector:unselected");else if(e&&this.enableMultiSelect){var i=this.get("selectionModel").getValue("photos");this.hasReachMultiSelectLimit()||i.find(o)||(i.push(o),t.fire("photoSelector:selected",{hasWarning:!1,photoId:e}),this.updateSelectCountText(i.size()))}else e&&(this.set("selected",e),t.fire("photoSelector:selected",{hasWarning:!1,photoId:e}))},updateSelectCountText:function(e){var o=this.multiSelectLimit-e;t.fire("photoSelector:updateCount",{count:o})},removePhotoFromSelection:function(e,o,i){var s=this.get("selectionModel").getValue("photos");if(s.find(o)){s.removeFromList(e)&&(t.fire("photoSelector:unselected",{hasWarning:!1,photoId:e,wasLastPhotoSelected:0===s.size()}),this.updateSelectCountText(s.size()),i&&this.loadSelectionPhotoList())}},handlePhotoSetSelector:function(t){var e;this.get("hasUploadCapabilities")&&this.toggleSelector(),e={registryName:"set-models",modelIdOrAttributes:this.publicOnlyPhotos?t+"-public":t,collectionAttributeName:"photoPageList"},this.publicOnlyPhotos&&(e.fetchParams={filter:1}),this.loadPhotoList(e)},handlePhotoUploaded:function(t){this.appContext.getModelRegistry("photostream-models").then(function(e){e.attributeSearch({normalizedId:this.appContext.getViewer().nsid},!0).forEach(function(t){e.remove(t)}),this.addPhotoToSelection(t.id,t),this.fire("actionClick",t),this.resetUploader()}.bind(this),function(t){this.appContext.err(t)}.bind(this))},handleFileSelect:function(t){var e;(e=t.target.getDOMNode().files[0])&&e.name&&this.uploadFile(e)},pollTicket:function(e){if(this.uploadTimer){if(t.moment().diff(this.uploadTimer,"seconds")>this.get("maxUploadTimeAllowed"))return this.showUploadError("GENERIC")}else this.uploadTimer=t.moment();this.appContext.callAPI("flickr.photos.upload.checkTickets",{tickets:e}).then(function(t){var o;t&&t.stat&&("ok"!==t.stat&&this.showUploadError("GENERIC"),t.uploader&&t.uploader.ticket instanceof Array&&(o=t.uploader.ticket[0])&&o.id===e&&(1===o.complete?this.appContext.getModel("photo-models",o.photoid).then(this.handlePhotoUploaded.bind(this),function(t){this.showUploadError("GENERIC")}):2===o.complete?this.showUploadError("FILE_TYPE"):setTimeout(function(){this.pollTicket(e)}.bind(this),1e3)))}.bind(this),function(t){this.showUploadError("GENERIC")}.bind(this))},resetUploader:function(){this.clearUploadError(),this.get("container").one(".drop-zone").removeClass("uploading"),this.get("container").removeClass("uploading"),this.isUploading=!1,this.uploadTimer=void 0},uploadFile:function(e){var i,s,a,r=new FormData,l=t.config.flickr.api.hostname_client_upload;this.clearUploadError(),this.get("container").one(".drop-zone").addClass("uploading"),this.get("container").addClass("uploading"),this.isUploading=!0,r.append("api_key",t.config.flickr.api.site_key),r.append("csrf",t.config.flickr.csrf.token),r.append("photo",e,e.name),r.append("async","1"),r.append("is_public","0"),r.append("is_friend","0"),r.append("is_family","0"),r.append("content_type","1"),(i=this._imgFileXhr=new XMLHttpRequest).open("POST",l,!0),i.withCredentials=!0,s=function(t){var e="object"==typeof t?t.target.statusText:t+"";o.error("Error during upload",{statusText:e}),this.resetUploader(),this.showUploadError("GENERIC")},a=function(e){var o,i,a,r;try{r=t.one(e.currentTarget.responseXML),i=r.one("rsp").getAttribute("stat")}catch(t){i="",o=""}return"ok"!==i?s((i||"empty")+": "+(o||"no message")):(a=r.one("ticketid").get("text"),this.pollTicket(a))},i.addEventListener("load",a.bind(this)),i.addEventListener("error",s.bind(this)),i.send(r)},clearUploadError:function(){this.get("container").one(".upload-error").setHTML("")},showUploadError:function(t){this.resetUploader(),this.get("container").one(".upload-error").setHTML(this.intlMessage({intlName:this.get("errorMessages")[t]})),this.get("fileDragDrop").showError()},handleFileDrop:function(t){this.isUploading||(t instanceof Error?this.showUploadError(t.message):this.uploadFile(t))},destructor:function(){this.photoListView&&this.photoListView.destroy()}},{ATTRS:{maxUploadTimeAllowed:{readOnly:!0,value:20},errorMessages:{readOnly:!0,value:{GENERIC:"common.PHOTO_SELECTOR_ERROR_MESSAGE_GENERIC",FILE_TYPE:"common.PHOTO_SELECTOR_ERROR_MESSAGE_FILE_TYPE",FILE_SIZE:"common.PHOTO_SELECTOR_ERROR_MESSAGE_FILE_SIZE",FILE_COUNT:"common.PHOTO_SELECTOR_ERROR_MESSAGE_FILE_COUNT",LOW_QUALITY:"common.PHOTO_SELECTOR_ERROR_MESSAGE_LOW_QUALITY",COLOR_SPACE:"common.PHOTO_SELECTOR_ERROR_MESSAGE_COLOR_SPACE"}},photoSourceOwnImage:{readOnly:!0,value:1},hasUploadCapabilities:{value:!0},photoListViewName:{value:"photo-selector-photolist-view"},limitedRowsPhotoListViewName:{value:"photo-selector-limited-rows-photolist-view"},searchable:{value:{yours:!0,contacts:!0,everyone:!0}},interactionViewName:{value:"photo-selector-photolist-interaction-view"},setsInteractionViewName:{value:"photo-selector-sets-photolist-interaction-view"},itemFilterFunction:{value:function(t){return!t.getValue("isVideo")}},defaultSelected:{value:!1},selected:{},groupId:{},galleryId:{}}})},"@VERSION@",{requires:["flickr-view","flickr-promise","flickr-api","html-file-dragdrop","hermes-template-photo-selector","photo-selector-photolist-view","photo-selector-limited-rows-photolist-view","photo-selector-photolist-interaction-view","photo-selector-sets-photolist-interaction-view","user-limits-helper"],optional:["search-photos-lite-models"],langBundles:["common","wallart","search","groups","profile","upload-blocking"]});YUI.add("hermes-lang-wallart",function(e,o){e.Intl.add("hermes/wallart","en-US",{WALL_ART:["Wall Art"],YOU_CANCELLED_THIS_ITEM_ON_DATE:["You cancelled this item order on ",{type:"date",valueName:"date",format:"monthYear"}],YOU_ORDERED_THIS_ITEM_ON_DATE:["You ordered this item on ",{type:"date",valueName:"date",format:"monthYear"}],RETURN_TO_YOUR_ORDER_HISTORY:["Return to your order history"],SELECT_A_PHOTO:["Select a photo"],SELECT_PRODUCT:["Select product"],PHOTO_MOUNT:["Photo Mount"],CANVAS:["Canvas"],CANVAS_WRAP:["Canvas Wrap"],PREMIUM_LUSTRE:["Premium Lustre"],GLOSSY:["Glossy"],MATTE:["Matte"],SIZE:["Size"],CHECKOUT:["Checkout"],REORDER:["Reorder"],TOTAL:["Total"],UPLOAD:["Upload"],CURATED_COLLECTIONS:["Curated Collections"],CREATIVE_COMMONS:["Creative Commons"],NASA:["NASA"],ABSTRACT:["Abstract"],ANIMALS:["Animals"],PATTERNS:["Patterns"],FOOD:["Food"],LANDSCAPES:["Landscapes"],TRAVEL:["Travel"],MY_ALBUMS:["My Albums"],PRODUCT_DROPUP_CANVAS:['Artist-grade canvas wrapped around 1.25" wood frame'],PRODUCT_DROPUP_MOUNTED:['Archival photo paper finished with 1" wood-textured edge'],MATERIAL_DROPUP_LUSTRE:["Professional Crystal Archive - Premium Lustre"],MATERIAL_DROPUP_GLOSSY:["Professional Crystal Archive - Glossy"],MATERIAL_DROPUP_MATTE:["Professional Crystal Archive - Matte"],SIZES_MODAL_SIZES_NOT_AVAILABLE:["Some sizes not available due to the resolution of the photo. Learn More."],MOUNTED_SAFE_AREA:["The area outside of the solid-line will not be printed. <br>Inside the line is the safe area."],CANVAS_SAFE_AREA:["The area outside of the dotted-line will be printed on the wrap. <br>Inside the line will be printed on the front."],SAVING:["Saving..."],SAVED:["All changes saved"],WITH_CODE:["with code:"],FREE_SHIPPING_WITH_CODE:["Free shipping with code:"],PRODUCT_DESCRIPTION_CANVAS_PART_1_8X10:['8" x 10" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_10X8:['10" x 8" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_12X12:['12" x 12" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_11X14:['11" x 14" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_14X11:['14" x 11" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_16X20:['16" x 20" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_20X16:['20" x 16" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_20X24:['20" x 24" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_24X20:['24" x 20" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_20X30:['20" x 30" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_1_30X20:['30" x 20" gallery wrap'],PRODUCT_DESCRIPTION_CANVAS_PART_2:['1.25" stretcher bars<br>Impact resistant frame<br>Includes hardware to hang'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_8X10:['8" x 10" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_10X8:['10" x 8" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_12X12:['12" x 12" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_11X14:['11" x 14" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_14X11:['14" x 11" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_16X20:['16" x 20" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_20X16:['20" x 16" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_20X30:['20" x 30" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_1_30X20:['30" x 20" mounted print'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_MATTE:['Matte finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_GLOSSY:['Glossy finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_LUSTRE:['Premium lustre finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_MATTE_KICKSTAND:['Matte finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging and kickstand for table-top display'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_GLOSSY_KICKSTAND:['Glossy finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging and kickstand for table-top display'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_LUSTRE_KICKSTAND:['Premium lustre finish<br>1" wood-textured edge<br>Pre-drilled holes for easy hanging and kickstand for table-top display'],PHOTO_TOO_SMALL_IN_SELECTED_SIZE:['This photo is too small to print in your selected size. We\'ll automatically find the next best size for you. <a href="http://help.yahoo.com/kb/index?page=content&y=PROD_FLICKR&locale=en_US&id=SLN22567">Learn more.</a>'],BAD_SIZES:['Some sizes not available due to the resolution of the photo. <a target="_blank" href="http://help.yahoo.com/kb/index?page=content&y=PROD_FLICKR&locale=en_US&id=SLN22567">Learn More</a>'],NOT_AVAILABLE:["Not available due to photo resolution"],UPLOADR_ERROR_MESSAGE_GENERIC:["There was a problem uploading your photo. Please try again."],UPLOADR_ERROR_MESSAGE_FILE_TYPE:["Looks like this photo has an invalid file type. Upload a photo that is either a PNG or JPG."],UPLOADR_ERROR_MESSAGE_FILE_SIZE:["Looks like this photo is too large to upload. The largest photo size we can upload is 250 MB."],UPLOADR_ERROR_MESSAGE_FILE_COUNT:["Select only one photo to upload."],UPLOADR_ERROR_MESSAGE_LOW_QUALITY:['Looks like this photo doesn\'t meet the minimum requirements to get printed. Please choose a photo that\'s at least 975 &times; 825 pixels. Learn more about <a href="http://help.yahoo.com/kb/index?page=content&y=PROD_FLICKR&locale=en_US&id=SLN22567" target="_blank">requirements</a> for print products.'],UPLOADR_ERROR_MESSAGE_COLOR_SPACE:['Sorry, we cannot print photos with a CMYK or ProPhoto RGB colorspace. We recommend photos with an sRGB color space. <a href="https://help.yahoo.com/kb/flickr/creations-faq-sln22216.html?impressions=true#cont33" target="_blank">Learn more</a>.'],DRAG_DROP_TO_UPLOAD:['Drag and drop your photo to upload or <a href="#" class="simulate-file-select">browse</a>.'],PHOTOS_UPLOADED_AS_PRIVATE:['Photos uploaded here will be added to your <a href="/me/">Photostream</a> as private.'],LOW_QUALITY_ZOOM_HANDLE_TOOLTIP_CANVAS:["At this zoom level, your photo will print at a low quality. Please zoom out to purchase."],LOW_QUALITY_ZOOM_HANDLE_TOOLTIP_MOUNTED:["At this zoom level, your photo will print at a low quality. Please zoom out to purchase."],INITIAL_DIALOG_CANVAS_DISABLED:["Canvas Wrap is not available for this photo due to its low resolution. Canvas Wrap requires a minimum 975px x 825px."],INITIAL_DIALOG_MOUNTED_DISABLED:["Photo Mount is not available for this photo due to its low resolution. Photo Mount requires a minimum 1000px x 800px."],GO_BACK:["Go back"],PHOTO_NOT_LARGE_ENOUGH_TO_ROTATE:["This photo is not large enough to rotate into a different orientation."],CHANGE_SIZE:["Change size"],CHANGE_PHOTO:["Change photo"],CREATIONS:["Creations"],VIEW_ORDER_HISTORY:["View order history"],COMPLETED:["Completed"],IN_PROGRESS:["In progress"],CREATE_NEW:["Create new"],CREATIONS_EMPTY_WALLART:["No Wall Art to show"],CREATIONS_EMPTY_BOOKS:["No Photo Books to show"],CREATIONS_EMPTY_TERTIARY:['We\'ll display in progress and completed creations here.<br>Learn more about <a href="/create" title="">Wall Art</a> and <a href="/create" title="">Photo Books</a>.'],CREATIONS_NOT_ABLE_DELETE:["We were not able to delete this creation. Please try again later."],PHOTO_FOR_WALLART_DELETED:["The photo for this wall art was deleted"],DELETE_THIS_WALLART:["Delete this wall art"],REORDER_THIS_WALLART:["Reorder this wall art"],EDIT_THIS_WALLART:["Edit this wall art"],CHANGE_PAPER:["Change paper"],MATERIAL_DROPUP_LUSTRE_NEW:['Lustre\'s pearl-like finish gives your photo a "true-to-life" look. It provides the color saturation of glossy but the fingerprint resistance of matte.'],MATERIAL_DROPUP_GLOSSY_NEW:["A sleek, glossy finish with high-contrast appearance so your photos appear crisp and sharp. Great for highly reflective photos of water, metal or sky."],MATERIAL_DROPUP_MATTE_NEW:["An elegant, matte finish with lower contrast to enhance the texture of your photo. Resists fingerprints and is great for black and white photos."],ON_SALE:["On Sale"],PRODUCT_DESCRIPTION_CANVAS_PART_2_PREVIEW:['<span>1.25" stretcher bars</span><span>Impact resistant frame</span><span>Includes hardware to hang</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_MATTE_PREVIEW:['<span>Matte finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_GLOSSY_PREVIEW:['<span>Glossy finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_LUSTRE_PREVIEW:['<span>Premium lustre finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_MATTE_KICKSTAND_PREVIEW:['<span>Matte finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging and kickstand for table-top display</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_GLOSSY_KICKSTAND_PREVIEW:['<span>Glossy finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging and kickstand for table-top display</span>'],PRODUCT_DESCRIPTION_MOUNTED_PART_2_LUSTRE_KICKSTAND_PREVIEW:['<span>Premium lustre finish</span><span>1" wood-textured edge</span><span>Pre-drilled holes for easy hanging and kickstand for table-top display</span>'],PHOTO_BOOK:["Photo Book"],GLOSSY_HARDCOVER_BOOK_PREMIUM_LUSTRE_PAPER:['11" x 8.5" glossy hardcover book with premium lustre paper'],LOW_QUALITY_WARNING:["This photo cannot be printed because the resolution is too low."],INVALID_COLORSPACE_WARNING:["This photo cannot be printed because it uses a colorspace that is not supported."],LOW_QUALITY_TYPE_WARNING:["This photo cannot be printed with this type of wallart because the resolution is too low."],NO_COMPLETED_ORDER:["No completed orders."]})},"@VERSION@",{requires:["intl"]});