YUI.add("hermes-template-notifications-panel",function(n,t){var a=n.Template.Handlebars.revive({1:function(n,t,a,e,s){var l;return"\t\twidth: "+n.escapeExpression("function"==typeof(l=null!=(l=a.width||(null!=t?t.width:t))?l:a.helperMissing)?l.call(null!=t?t:{},{name:"width",hash:{},data:s}):l)+"px;\n"},3:function(n,t,a,e,s){var l;return"\t\theight: "+n.escapeExpression("function"==typeof(l=null!=(l=a.height||(null!=t?t.height:t))?l:a.helperMissing)?l.call(null!=t?t:{},{name:"height",hash:{},data:s}):l)+"px;\n"},5:function(n,t,a,e,s){var l;return'\t\t\t\t\t\t('+n.escapeExpression(n.lambda(null!=(l=null!=t?t.unreadCounts:t)?l.main:l,t))+")\n"},7:function(n,t,a,e,s){var l;return'\t\t\t\t\t('+n.escapeExpression(n.lambda(null!=(l=null!=t?t.unreadCounts:t)?l.admin:l,t))+")\n"},compiler:[7,">= 4.0.0"],main:function(n,t,a,e,s){var l,i=null!=t?t:{},o=a.helperMissing,r=n.escapeExpression;return'
\n\t
\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'+r((a.intlMessage||t&&t.intlMessage||o).call(i,{name:"intlMessage",hash:{intlName:"notifications.NOTIFICATIONS"},data:s}))+"\n"+(null!=(l=a.if.call(i,null!=(l=null!=t?t.unreadCounts:t)?l.main:l,{name:"if",hash:{},fn:n.program(5,s,0),inverse:n.noop,data:s}))?l:"")+'\t\t\t\t\n\t\t\t\t'+r((a.intlMessage||t&&t.intlMessage||o).call(i,{name:"intlMessage",hash:{intlName:"common.ALPHA"},data:s}))+'\n\t\t\t\n\t\t\t\n\t\t\t\t'+r((a.intlMessage||t&&t.intlMessage||o).call(i,{name:"intlMessage",hash:{intlName:"notifications.GROUPS_YOU_ADMIN"},data:s}))+"\n"+(null!=(l=a.if.call(i,null!=(l=null!=t?t.unreadCounts:t)?l.admin:l,{name:"if",hash:{},fn:n.program(7,s,0),inverse:n.noop,data:s}))?l:"")+'\t\t\t\n\t\t
\n\t\t
\n\t
\n\t
\n\t\t'+r((a.outlet||t&&t.outlet||o).call(i,null!=t?t["notifications-list-view"]:t,{name:"outlet",hash:{},data:s}))+'\n\t
\n\t\n
\n"},useData:!0}),e={};n.Array.each([],function(t){var a=n.Template.get("hermes/"+t);a&&(e[t]=a)}),n.Template.register("hermes/notifications-panel",function(t,s){return s=s||{},s.partials=s.partials?n.merge(e,s.partials):e,a(t,s)})},"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("template-lib-helper",function(e,t){var r=require("hermes-core/flog")(t);e.TemplateLibraryHelper=function(t,l){var n=l&&l.localizeLib?l.localizeLib:e.mix({langBundles:["common"]},e.Localizable),i={getTemplate:function(l,i){var o,a=e.Template.get("hermes/"+l),p=n.getLangBundles();if(p.locales=t.lang||n.defaultLang,"function"!=typeof a)throw r.error("Template not found",{topic:this.name,template:l}),new Error("Template not found: "+l);return t.flipper&&(o=t.flipper),function(e){return!(e=e||{}).flippers&&o&&(e.flippers=o.toJSON()),i&&(e.isMobile=i.isMobile,e.cspNonce=i.cspNonce),a(e,{data:{intl:p,flippers:e.flippers}})}}};return e.augment(i,e.EventTarget),i}},"@VERSION@",{requires:["event-custom"]});YUI.add("group-status-helper",function(e,t){require("hermes-core/flog")(t);var n=e.mix({langBundles:["common","groups"]},e.Localizable);e.GroupStatusHelper=function(t,o){var i,s,a=o.groupId,r=new e.TemplateLibraryHelper(t),u={load:function(){var n=this;return e.on("groupStatusHelper:groupStatusChanged",function(e){e.groupId===a&&n.update()}),o.useSearchModel?t.getModel("search-group-models",a).then(function(e){s=e,n.convertGroupInfoModel(e),n.groupRemoteMethods={join:e.registry.remote.join,leave:e.registry.remote.leave}}):t.getModel("group-info-models",a).then(function(e){return s=e,n.convertGroupInfoModel(e),n.groupRemoteMethods={join:e.registry.remote.join,leave:e.registry.remote.leave},e})},initiateJoinGroup:function(){var o=this.getJoinStatus(),s=i.title,a=i.id;if(o.canJoin&&!o.signedIn)return this.signInAndRedirectToGroup(a);if(o.canJoin&&!o.requiresRequest)return this.joinGroup(a);if(o.canJoin&&o.isInvited)return this.joinGroup(a);if(!o.hasJoined&&o.hasRequested&&o.requiresRequest){return new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_HEADER",groupName:s}),message:n.intlMessage({intlName:"groups.GROUP_INVITE_PENDING",groupName:s}),actionButtonLabel:n.intlMessage({intlName:"common.OK"}),showCancelButton:!1}).show(),e.Promise.resolve()}return o.hasJoined||o.hasRequested||!o.requiresRequest?o.hasJoined?(this.fire("groupJoined"),e.fire("groupStatusHelper:groupJoined",{groupId:a}),e.Promise.resolve()):void 0:this.promptForRules().then(e.bind(function(){this.showInviteRequestModal.call(this,a)},this),e.bind(function(){},this))},initiateLeaveGroup:function(){this.showLeaveGroupModal()},showLeaveGroupModal:function(){var o=i.title,s=i.id,a=null,r="";1===i.memberCount&&i.isMember?r=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_LAST_MEMBER",title:o}):i.isAdmin?(r=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_ADMIN",title:o}),r+=n.intlHTMLMessage({intlName:"groups.GROUPS_LEAVE_WARNING_REMOVE_PHOTOS"})):(r=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING",title:o}),r+=n.intlHTMLMessage({intlName:"groups.GROUPS_LEAVE_WARNING_REMOVE_PHOTOS"})),(a=new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_TITLE",title:o}),htmlMessage:r,actionButtonLabel:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_LEAVE_BUTTON"}),cancelButtonLabel:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_CANCEL_BUTTON"}),overlayClassList:"over-droparound-under-modal"})).on("actionClick",e.bind(function(){var e=a.get("container").one("input"),t=e&&e.getDOMNode().checked;this.leaveGroup(s,t)},this)),a.show()},joinGroup:function(){var o=this;return this.promptForRules().then(e.bind(function(){return this.groupRemoteMethods.join({groupModel:s,acceptRules:!0},t).then(function(t){return o.convertGroupInfoModel(t),o.fire("groupJoined"),e.fire("groupStatusHelper:groupJoined",{groupId:a}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:a}),t},function(o){new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"common.OOPS"}),message:n.intlMessage({intlName:"groups.GROUP_JOIN_ERROR"}),actionButtonLabel:n.intlMessage({intlName:"common.OK"}),showCancelButton:!1}).show()})},this),e.bind(function(e){},this))},leaveGroup:function(o,i){var a=this;this.groupRemoteMethods.leave({groupModel:s,deletePhotos:!!i},t).then(function(t){return a.convertGroupInfoModel(t),a.fire("groupLeft"),e.fire("groupStatusHelper:groupLeft",{groupId:o}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:o}),t},function(o){new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"common.OOPS"}),message:n.intlMessage({intlName:"groups.GROUP_LEAVE_ERROR"}),actionButtonLabel:n.intlMessage({intlName:"common.OK"}),showCancelButton:!1}).show()})},signInAndRedirectToGroup:function(o){var s,a=this,r=e.url("/groups/")+o,u=n.intlMessage({intlName:"groups.SIGN_IN_BEFORE_JOIN_MESSAGE",name:i.title}),l=n.intlMessage({intlName:"groups.SIGN_IN_AND_JOIN"}),g=n.intlMessage({intlName:"common.CANCEL"});if(this.signedOutTest)return this.showSignUpModal(o);(s=new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.SIGN_IN_BEFORE_JOIN_TITLE"}),htmlMessage:u,actionButtonLabel:l,cancelButtonLabel:g})).on("actionClick",function(){e.rapidTracker.beacon(a.name,"joinModalSigninClick"),e.SigninHelper.addPendingJoinGroup({id:o},{postLoginUrl:r})}),s.on("cancelClick",function(t){e.rapidTracker.beacon(a.name,"joinModalCancelClick")}),s.show()},showSignUpModal:function(o){var s,a=e.url("/groups/")+o,r=n.intlMessage({intlName:"groups.SIGN_IN_BEFORE_JOIN_TITLE"}),u=n.intlMessage({intlName:"groups.SIGN_UP_AND_JOIN_MESSAGE",name:i.title});(s=new e.Views.SignUpModal({appContext:t,signUpHeaderClass:"avatar group big",signUpHeaderImage:void 0!==this.groupModel.getValue("group")?this.groupModel.getValue("group").getValue("bestIconURL"):this.groupModel.getValue("bestIconURL"),signUpTitle:r,signUpMessage:u,beaconPrefix:"join"})).on("signUpClick",function(t){e.SigninHelper.signUpPendingJoinGroup({id:o},{postLoginUrl:a})}),s.on("signInClick",function(t){e.SigninHelper.addPendingJoinGroup({id:o},{postLoginUrl:a})}),s.show()},promptForRules:function(){return new e.Promise(e.bind(function(o,s){var a=i.secureRules,r=null;a?((r=new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_TITLE"}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_MESSAGE"})+"
"+a+"
",showBodyLines:!1,actionButtonLabel:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_ACCEPT"}),cancelButtonLabel:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_DECLINE"})})).on("actionClick",function(){setTimeout(function(){o()},500)}),r.on("cancelClick",function(){setTimeout(function(){s()},500)}),r.show()):o()},this))},showInviteRequestModal:function(s){var a,u=n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_SEND"}),l=n.intlMessage({intlName:"common.CANCEL"}),g=r.getTemplate("join-group-invite-form",o.viewParams);(a=new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_HEADER",groupName:e.Escape.html(i.title)}),htmlMessage:g({groupName:i.title}),actionButtonLabel:u,cancelButtonLabel:l})).on("actionClick",function(){var o=a.get("container").one(".group-invite-form");if(o){var r=o.get("value");if(r.length>0){var u={group_id:s,message:r,accept_rules:!0};t.callAPI("flickr.groups.joinRequest",u).then(function(t){e.config.win.location.reload()},function(o){var s="";s=o&&7===o.code?n.intlMessage({intlName:"groups.GROUP_INVITE_PENDING",groupName:e.Escape.html(i.title)}):"message"in o?o.message:n.intlMessage({intlName:"common.ERROR"}),new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"common.ERROR"}),message:s,actionButtonLabel:n.intlMessage({intlName:"common.OK"}),showCancelButton:!1}).show()})}else setTimeout(function(){new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"common.ERROR"}),message:n.intlMessage({intlName:"groups.GROUP_INVITE_EMPTY_MESSAGE"}),actionButtonLabel:n.intlMessage({intlName:"common.OK"}),showCancelButton:!1}).show()},300)}}),a.on("activated",function(){var e=a.get("container"),t=e.one("textarea")||!1;e&&t&&t.focus()}),a.show()},getJoinStatus:function(){var e=!1,n=!1,o=!1,s=!1,a=!1,r=t&&t.getViewer(),u=r&&r.signedIn;return e=i.isMember,a=i.isInvited,o=i.hasPendingRequestToJoin,n=2===i.privacy,s=i.isAdmin,{signedIn:u,canJoin:!e&&!o,hasJoined:e,hasRequested:o,isInvited:a,requiresRequest:n,isAdmin:s}},convertGroupInfoModel:function(e){var t=o.useSearchModel?e:e.getValue("group");i={title:t.getValue("title"),id:t.getValue("id"),memberCount:t.getValue("memberCount"),isMember:t.getValue("isMember"),isModerator:t.getValue("isModerator"),isAdmin:t.getValue("isAdmin"),privacy:t.getValue("privacy"),isInvited:e.getValue("isInvited"),hasPendingRequestToJoin:e.getValue("hasPendingRequestToJoin"),secureRules:e.getValue("secureRules")}},getInfo:function(){return{groupAttrs:i,joinStatus:this.getJoinStatus()}},toggleMuteGroup:function(t){var n={object_id:a,object_type:1,pref_type:"GroupBatch",pref_val:t?0:1};return this.insertUserPrefs(n).then(function(n){e.fire("groupStatusHelper:groupMuteToggled",{groupId:a,isMuted:t}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:a})})},insertUserPrefs:function(e){return t.callAPI("flickr.feed.preferences.insertUserPreferences",e)},update:function(){this.convertGroupInfoModel(s)},declineInvite:function(){return s.declineInvite()}};return e.augment(u,e.EventTarget),u}},"@VERSION@",{requires:["event-custom","template-lib-helper"]});YUI.add("base-notification-item-view",function(t,e){var i=require("hermes-core/flog")(e);t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,additionalViewClasses:function(){return["base-notification-item"]},initializer:function(e){this.params=e,this.activityItem=e.activityItem,this.notificationsHelper=new t.NotificationsHelper(this.appContext)},loadState:function(){return t.Promise.resolve()},buildContainer:function(){var t=this.notificationsHelper.getTemplateHtml(this.activityItem);this.setContainerHTML(t)},activate:function(){var e=this.get("container").one(".notification-item");return e&&(e.toggleClass("unseen",!this.activityItem.isSeen),e.toggleClass("muted",this.activityItem.isMuted),this.setupContextMenu()),t.Promise.resolve(this)},handleContextMenuClick:function(){var e,i,n;this.menuConfigData&&(i=(e=this.notificationsHelper.getContextMenuConfig({item:this.params.activityItem,ctxMenuItems:this.menuConfigData})).map(function(t){return{text:t.text,value:t.actionId}}),(n=new t.Views.FluidDroparound({appContext:this.appContext,showDropArrow:!0,observePageResize:!0,anchorOffsetHorizontal:12,anchorOffsetVertical:0,width:250,dismissOnOverlayClick:!0,anchorElement:this.contextMenuButton,menuItems:i,positionFixed:!0,classList:"over-modal notification-context-menu",overlayClassList:"over-modal"})).show(),this.registerEventHandler(n.on("selected",function(t){e.find(function(e){return e.actionId===t.menuItem.value}).onSelected(t),n.close()})))},setupContextMenu:function(){var e=this,n=this.get("container"),o=this.params.activityItem;if(this.contextMenuButton=n.one(".notification-context-menu-button"),this.contextMenuButton)return this.registerEventHandler(this.contextMenuButton.on("click",this.handleContextMenuClick.bind(this))),this.notificationsHelper.loadContextMenuConfig(o).then(function(t){e.menuConfigData=t}).catch(function(e){return i.error({err:e}),t.Promise.resolve()})}})},"@VERSION@",{requires:["flickr-view"],langBundles:["common","relative-dates","notifications"]});YUI.add("hermes-template-follow",function(n,l){var a=n.Template.Handlebars.revive({1:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showNoButton:l,{name:"if",hash:{},fn:n.program(2,e,0),inverse:n.program(4,e,0),data:e}))?s:""},2:function(n,l,a,t,e){return""},4:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showUnblockButton:l,{name:"if",hash:{},fn:n.program(5,e,0),inverse:n.program(7,e,0),data:e}))?s:""},5:function(n,l,a,t,e){return"\t\t\t\n"},7:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showFollowingButton:l,{name:"if",hash:{},fn:n.program(8,e,0),inverse:n.program(10,e,0),data:e}))?s:""},8:function(n,l,a,t,e){return'\t\t\t\t\n'},10:function(n,l,a,t,e){return'\t\t\t\t\n'},12:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.isFluid:l,{name:"if",hash:{},fn:n.program(13,e,0),inverse:n.program(23,e,0),data:e}))?s:""},13:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showNoButton:l,{name:"if",hash:{},fn:n.program(2,e,0),inverse:n.program(14,e,0),data:e}))?s:""},14:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showUnblockButton:l,{name:"if",hash:{},fn:n.program(15,e,0),inverse:n.program(17,e,0),data:e}))?s:""},15:function(n,l,a,t,e){return"\t\t\t\t\n"},17:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showFollowingButton:l,{name:"if",hash:{},fn:n.program(18,e,0),inverse:n.program(21,e,0),data:e}))?s:""},18:function(n,l,a,t,e){var s,o=null!=l?l:{};return'\t\t\t\t\t\n'},19:function(n,l,a,t,e){return"white"},21:function(n,l,a,t,e){var s,o=null!=l?l:{};return'\t\t\t\t\t\n"},23:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showNoButton:l,{name:"if",hash:{},fn:n.program(2,e,0),inverse:n.program(24,e,0),data:e}))?s:""},24:function(n,l,a,t,e){var s;return'\t\t\t\n'+(null!=(s=a.if.call(null!=l?l:{},null!=l?l.showUnblockButton:l,{name:"if",hash:{},fn:n.program(2,e,0),inverse:n.program(25,e,0),data:e}))?s:"")+"\t\t\t\n"},25:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.showFollowingButton:l,{name:"if",hash:{},fn:n.program(26,e,0),inverse:n.program(28,e,0),data:e}))?s:""},26:function(n,l,a,t,e){return"\t\t\t\t\t\t\n"},28:function(n,l,a,t,e){return"\t\t\t\t\t\t\n"},compiler:[7,">= 4.0.0"],main:function(n,l,a,t,e){var s;return null!=(s=a.if.call(null!=l?l:{},null!=l?l.isOnMobile:l,{name:"if",hash:{},fn:n.program(1,e,0),inverse:n.program(12,e,0),data:e}))?s:""},useData:!0}),t={};n.Array.each([],function(l){var a=n.Template.get("hermes/"+l);a&&(t[l]=a)}),n.Template.register("hermes/follow",function(l,e){return e=e||{},e.partials=e.partials?n.merge(t,e.partials):t,a(l,e)})},"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("hermes-template-fluid-modal",function(n,l){var t=n.Template.Handlebars.revive({1:function(n,l,t,a,e){return" html-modal"},3:function(n,l,t,a,e){return" subview-modal"},5:function(n,l,t,a,e){return" flex-layout"},7:function(n,l,t,a,e){return''},9:function(n,l,t,a,e){var i;return'\t\t\n'+(null!=(i=t.if.call(null!=l?l:{},null!=l?l.navBarView:l,{name:"if",hash:{},fn:n.program(10,e,0),inverse:n.program(12,e,0),data:e}))?i:"")+'\t\t\t\n\t\t
\n'},10:function(n,l,t,a,e){return'\t\t\t\t\n'},12:function(n,l,t,a,e){var i;return'\t\t\t\t\n'+(null!=(i=t.if.call(null!=l?l:{},null!=l?l.title:l,{name:"if",hash:{},fn:n.program(13,e,0),inverse:n.program(15,e,0),data:e}))?i:"")+"\t\t\t\t
\n"},13:function(n,l,t,a,e){var i;return"\t\t\t\t\t\t"+n.escapeExpression("function"==typeof(i=null!=(i=t.title||(null!=l?l.title:l))?i:t.helperMissing)?i.call(null!=l?l:{},{name:"title",hash:{},data:e}):i)+"\n"},15:function(n,l,t,a,e){return"\t\t\t\t\t\t"+n.escapeExpression((t.renderTrustedMarkup||l&&l.renderTrustedMarkup||t.helperMissing).call(null!=l?l:{},null!=l?l.htmlTitle:l,{name:"renderTrustedMarkup",hash:{},data:e}))+"\n"},17:function(n,l,t,a,e){return" lines"},19:function(n,l,t,a,e){var i,r,s=null!=l?l:{},o=t.helperMissing;return'\t\t\t\n\t\t\t\t'+n.escapeExpression("function"==typeof(r=null!=(r=t.textMessage||(null!=l?l.textMessage:l))?r:o)?r.call(s,{name:"textMessage",hash:{},data:e}):r)+"\n\t\t\t
\n"},20:function(n,l,t,a,e){return" no-scroll"},22:function(n,l,t,a,e){return" has-footer"},24:function(n,l,t,a,e){var i,r,s=null!=l?l:{},o=t.helperMissing,u=n.escapeExpression;return"\n\t\t\t\t\tpadding-right: "+u("function"==typeof(r=null!=(r=t.contentPadding||(null!=l?l.contentPadding:l))?r:o)?r.call(s,{name:"contentPadding",hash:{},data:e}):r)+"px;\n\t\t\t\t\t"+(null!=(i=t.if.call(s,null!=l?l.showFooter:l,{name:"if",hash:{},fn:n.noop,inverse:n.program(25,e,0),data:e}))?i:"")+"\n\t\t\t\t\tpadding-left: "+u("function"==typeof(r=null!=(r=t.contentPadding||(null!=l?l.contentPadding:l))?r:o)?r.call(s,{name:"contentPadding",hash:{},data:e}):r)+"px;\n\t\t\t\t"},25:function(n,l,t,a,e){var i;return"padding-bottom: "+n.escapeExpression("function"==typeof(i=null!=(i=t.contentPadding||(null!=l?l.contentPadding:l))?i:t.helperMissing)?i.call(null!=l?l:{},{name:"contentPadding",hash:{},data:e}):i)+"px;"},27:function(n,l,t,a,e){var i,r=null!=l?l:{},s=t.helperMissing;return'\t\t\t\n\t\t\t\t'+n.escapeExpression((t.renderTrustedMarkup||l&&l.renderTrustedMarkup||s).call(r,null!=l?l.htmlMessage:l,{name:"renderTrustedMarkup",hash:{},data:e}))+"\n\t\t\t
\n"},29:function(n,l,t,a,e){var i,r=null!=l?l:{};return'\t\t\t\n'},31:function(n,l,t,a,e){var i;return'\t\t\n"},32:function(n,l,t,a,e){var i,r=null!=l?l:{};return'\t\t\t\n"},33:function(n,l,t,a,e){var i,r=null!=l?l:{};return'\t\t\t\t\t'+n.escapeExpression((t.renderTrustedMarkup||l&&l.renderTrustedMarkup||t.helperMissing).call(r,null!=(i=null!=(i=null!=l?l.buttons:l)?i.flavorText:i)?i.text:i,{name:"renderTrustedMarkup",hash:{},data:e}))+"
\n"},34:function(n,l,t,a,e){return" hidden"},36:function(n,l,t,a,e){var i;return'"},38:function(n,l,t,a,e){var i,r=null!=l?l:{};return'"},39:function(n,l,t,a,e){return"danger"},41:function(n,l,t,a,e){return' disabled="disabled"'},compiler:[7,">= 4.0.0"],main:function(n,l,t,a,e){var i,r,s=null!=l?l:{};return'\n\t'+(null!=(i=t.if.call(s,null!=l?l.showCancelX:l,{name:"if",hash:{},fn:n.program(7,e,0),inverse:n.noop,data:e}))?i:"")+"\n"+(null!=(i=t.if.call(s,null!=l?l.showHeader:l,{name:"if",hash:{},fn:n.program(9,e,0),inverse:n.noop,data:e}))?i:"")+'\t
\n'+(null!=(i=t.if.call(s,null!=l?l.textMessage:l,{name:"if",hash:{},fn:n.program(19,e,0),inverse:n.noop,data:e}))?i:"")+(null!=(i=t.if.call(s,null!=l?l.htmlMessage:l,{name:"if",hash:{},fn:n.program(27,e,0),inverse:n.noop,data:e}))?i:"")+(null!=(i=t.if.call(s,null!=l?l.subview:l,{name:"if",hash:{},fn:n.program(29,e,0),inverse:n.noop,data:e}))?i:"")+"\t
\n"+(null!=(i=t.if.call(s,null!=l?l.showFooter:l,{name:"if",hash:{},fn:n.program(31,e,0),inverse:n.noop,data:e}))?i:"")+"
\n"},useData:!0}),a={};n.Array.each([],function(l){var t=n.Template.get("hermes/"+l);t&&(a[l]=t)}),n.Template.register("hermes/fluid-modal",function(l,e){return e=e||{},e.partials=e.partials?n.merge(a,e.partials):a,t(l,e)})},"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("fluid-modal-view",function(e,t){"use strict";var i,n,a=require("hermes-core/flog")(t);i={css:{destinationContainer:"body",closeX:".close-x",buttonCancel:"button.cancel",buttonAction:"button.action",navBarContent:".head .nav",subviewContent:".content.subview",modalContent:".body .content"},options:{}},n={supportsTransform:!1,modal:{height:0,width:0}},e.namespace("Views").FluidModal=e.FlickrView.create(this.name,e.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){this.set("isActiveViewAgnostic",!0);var i=this.get("modalOverlayType");return this.alreadyShowingModal=i.alreadyShowingModal(),this.alreadyShowingModal||(i.add(this),e.OverlayManager.ModalOverlay.setOverlayStyle({overlayClassList:this.get("overlayClassList")})),this},activate:function(){var t=this.get("container"),n=this,a=t.one(i.css.buttonAction);return this.get("showCancelX")&&this.registerEventHandler(t.one(i.css.closeX).on(["click","keydown"],function(e){"click"!==e.type&&13!==e.keyCode||this.handleX(e)},this)),this.get("showFooter")&&this.get("showCancelButton")&&this.get("showButtons")&&this.registerEventHandler(t.one(i.css.buttonCancel).on("click",e.bind(this.handleCancel,this))),this.get("showFooter")&&this.get("showActionButton")&&this.get("showButtons")&&this.registerEventHandler(t.one(i.css.buttonAction).on("click",e.bind(this.handleAction,this))),this.registerEventHandler(this.appContext.flapp.on("activeViewChange",function(e){n.close(e)})),this.registerEventHandler(e.globalEvents.subscribe("window:resize",function(e){n.reposition()})),this.get("navBarView")&&n.get("navBarView").activate(),this.get("subview")&&(n.get("subview").normalizedActivate(),n.registerEventHandler(n.get("subview").on("actionClick",e.bind(n.handleAction,n))),n.registerEventHandler(n.get("subview").on("contentSizeChanged",e.bind(n.reposition,n))),n.registerEventHandler(n.get("subview").on("readyToClose",e.bind(n.close,n)))),this.get("focusOnFirstTabPress")&&this.registerEventHandler(t.ancestor("body").once("key",this.focusOnFirstTab.bind(this),"down:9")),e.Accessibility.manageFocusOutlines(this),this.registerEventHandler(e.on("modal:updateText",function(e){n.set("title",e.title),n.set("cancelButtonLabel",e.cancelText),n.set("actionButtonLabel",e.actionText),t.one(".title").set("textContent",e.title),t.one(".cancel").set("textContent",e.cancelText),t.one(".action").set("textContent",e.actionText)})),a&&(this.actionButtonText=a.get("text")),this.fire("activated"),this},focusOnFirstTab:function(e){var t=this.get("container").one("[tabindex]");t&&t.focus()},clearOutline:function(){var t=e.one(document.activeElement);t&&t.addClass("no-outline")},restoreOutline:function(){var e=this.get("container").one(":focus");e&&e.removeClass("no-outline")},show:function(){return this.initialize().then(null,function(e){a.error("Error initializing modal",{err:e})}),this.isClosed=!1,this.freeze(),e.fire("flickr:setKeyEventScope",this.getKeyEventScope()),this},freeze:function(){e.one("body").setStyles({overflow:"hidden"})},unfreeze:function(){e.one("body").setStyles({overflow:"visible"})},enableActionButton:function(){var e=this.get("container").one("button.action");e&&e.getAttribute("disabled")&&(e.removeAttribute("disabled"),e.set("text",this.actionButtonText))},disableActionButton:function(e){var t=this.get("container").one("button.action");t&&(t.setAttribute("disabled",!0),e&&t.set("innerHTML",this.templates("flickr-balls")({})))},showFlavorText:function(){var e=this.get("container").one(".buttons .flavor-text");e&&e.removeClass("hidden")},hideFlavorText:function(){var e=this.get("container").one(".buttons .flavor-text");e&&e.addClass("hidden")},setFlavorText:function(e,t){var i=this.get("container").one(".buttons .flavor-text");i&&(i.set("innerHTML",e),i.toggleClass("error",!!t))},buildContainer:function(){if(!this.alreadyShowingModal){var t,o=this,s=e.one(i.css.destinationContainer);t={showCancelX:this.get("showCancelX"),title:this.get("title"),htmlTitle:this.get("htmlTitle"),navBarView:!!this.get("navBarView"),noScroll:this.get("noScroll"),textMessage:this.get("textMessage"),htmlMessage:this.get("message")?this.get("message"):this.get("htmlMessage"),subview:!!this.get("subview"),showBodyLines:this.get("showBodyLines"),hideModalOverlay:this.get("hideModalOverlay"),darkOverlay:this.get("darkOverlay"),lightOverlay:this.get("lightOverlay"),showHeader:this.get("showHeader"),showFooter:this.get("showFooter"),buttons:{visible:this.get("showButtons"),action:{visible:this.get("showActionButton"),label:this.get("actionButtonLabel"),disabled:this.get("actionButtonDisabled"),isDangerous:this.get("actionButtonIsDangerous")},cancel:{visible:this.get("showCancelButton"),label:this.get("cancelButtonLabel")}},classList:this.get("classList"),contentPadding:this.get("contentPadding"),flexLayout:this.get("flexLayout")},this.get("buttonFlavorText")&&(t.buttons.flavorText={visible:this.get("showButtonFlavorText"),text:this.get("buttonFlavorText")}),this.setContainerWithTemplate("fluid-modal",t),n.modal.width=this.get("width"),n.modal.minWidth=this.get("minWidth"),n.modal.height=this.get("height"),this.get("navBarView")&&(this.get("navBarView").appContext=o.appContext,this.get("navBarView").initialize().then(function(e){e.on("subviewViewEvent",function(e){e&&e.details&&e.details.length&&(o.get("subview")&&"navigation"===e.details[0]?o.get("subview").fire.apply(o.get("subview"),["parentViewEvent"].concat(e.details)):o.get("subview")&&"search"===e.details[0]&&o.get("subview").fire.apply(o.get("subview"),["parentViewEvent"].concat(e.details)),o.fire.apply(o,e.details))}),o.get("container").one(i.css.navBarContent).appendChild(e.get("container")),o.get("subview")||o.activate()})),this.get("subview")?(this.get("subview").appContext=o.appContext,this.get("subview").set("isActiveViewAgnostic",!0),this.get("subview").initialize().then(function(e){o.on("parentViewEvent",function(t){t&&t.details&&t.details.length&&e.fire.apply(e,["parentViewEvent"].concat(t.details))}),e.on("subviewViewEvent",function(e){e&&e.details&&e.details.length&&(o.get("navBarView")&&"backToList"===e.details[0]&&o.get("navBarView").fire.apply(o.get("navBarView"),["parentViewEvent"].concat(e.details)),o.fire.apply(o,e.details))}),o.get("container").one(i.css.subviewContent).appendChild(e.get("container")),s&&(s.append(o.get("container")),o.reposition()),o.activate()},function(e){a.error("Error initializing modal subview",{err:e})})):s&&(s.append(this.get("container")),this.reposition())}return this},reposition:function(){var t,a,o,s=this.get("container").one(this.get("modalSelector")),l=e.one(e.config.win),r=parseInt(l.get("innerWidth"),10),h=parseInt(l.get("innerHeight"),10),c=n.modal.width?parseInt(n.modal.width,10):parseInt(s.getComputedStyle("width"),10),u={},d=s.one(".body"),g=0,v=this.get("showFooter")?parseInt(s.one(".foot").getComputedStyle("height"),10):0,w=0,b=parseInt(d.getComputedStyle("borderTopWidth"),10)+parseInt(d.getComputedStyle("borderBottomWidth"),10),m={};n.modal.height&&(g=s.one(".head")?parseInt(s.one(".head").getComputedStyle("height"),10):0,w=n.modal.height,s.get("showFooter")&&(v=parseInt(s.one(".foot").getComputedStyle("height"),10)),n.modal.height+g+v+80+b>=h&&(w=h<=700?h-g-v-b:h-g-v-80-b),s.setStyles({maxHeight:"none"}),this.get("flexLayout")&&s.setStyle("height",n.modal.height),this.get("fullWindow")?m.height=this.get("flexLayout")?"auto":w+"px":this.get("maxHeight")&&(m.maxHeight=this.get("flexLayout")?"auto":w+"px"),s.one(i.css.modalContent).setStyles(m)),t=parseInt(s.getComputedStyle("height"),10),a=s.getDOMNode().scrollHeight,o=s.getDOMNode().scrollWidth,u={top:"50%",left:"50%",width:n.modal.width?c+"px":"",marginTop:-t/2+"px",marginLeft:-c/2+"px",minWidth:n.modal.minWidth?n.modal.minWidth+"px":""},t+40>=h||a>=t+1||c+40>=r||o>=c?(h<=700&&n.modal.height?u.maxHeight=h-10+"px":(u.maxHeight=h-40+"px",u.overflow="auto"),u.maxWidth=r-40+"px",u.marginTop=-Math.min(parseInt(u.maxHeight,10),t)/2+"px",u.marginLeft=-Math.min(parseInt(u.maxWidth,10),c)/2+"px"):(u.maxHeight="inherit",u.maxWidth="inherit",u.overflow="visible"),s.setStyles(u)},handleX:function(i){var n=this.get("subview");e.rapidTracker.beacon(t,"modalCancelClick"),n&&n.handleX&&n.handleX(),this.close(i),this.fire("cancelClick",i)},handleCancel:function(i){var n=this.get("subview");e.rapidTracker.beacon(t,"modalCancelClick"),n&&n.handleCancel&&!1===n.handleCancel()||(this.fire("cancelClick",i),this.close(i))},handleAction:function(e){var t=this.get("subview");t&&t.handleAction&&!1===t.handleAction()||(this.fire("actionClick",e),this.get("dismissOnActionClick")&&this.close(e))},close:function(t){e.fire("flickr:removeKeyEventScope",this.getKeyEventScope());var i=this.get("container");this.isClosed=!0,e.one("body").removeClass("scroll-fluid-modal"),this.get("subview")&&this.get("subview").destroy(),this.get("navBarView")&&this.get("navBarView").destroy(),i&&i.remove(!0),this.fire("close",t),this.destroy(),this.get("removeOverlayOnClose")||this.get("modalOverlayType").remove(this)},getKeyEventScope:function(){return this.name+this._yuid},destructor:function(){this.unfreeze(),this.detachAll()}},{ATTRS:{showCancelX:{value:!0},showCancelButton:{value:!0},showBodyLines:{value:!1},showActionButton:{value:!0},hideModalOverlay:{value:!1},darkOverlay:{value:!1},lightOverlay:{value:!1},actionButtonLabel:{valueFn:function(){return this.intlMessage({intlName:"common.OK"})}},actionButtonIsDangerous:{value:!1},cancelButtonLabel:{valueFn:function(){return this.intlMessage({intlName:"common.CANCEL"})}},actionButtonDisabled:{value:!1},showButtons:{value:!0},dismissOnOverlayClick:{value:!1},dismissOnActionClick:{value:!0},title:{value:""},htmlTitle:{value:""},navBarView:{value:null},message:{value:null},textMessage:{value:null},htmlMessage:{value:null},width:{value:0},minWidth:{value:0},height:{value:0},fullWindow:{value:!1},subview:{value:null},classList:{value:""},buttonFlavorText:{value:""},showButtonFlavorText:{value:!0},showHeader:{value:!0},showFooter:{value:!0},noScroll:{value:!1},maxHeight:{value:!0},modalSelector:{value:".modal"},modalOverlayType:{value:e.OverlayManager.ModalOverlay},removeOverlayOnClose:{value:!1},overlayClassList:{value:"",validator:function(t,i){return e.AttributeHelpers.validateString(t)},setter:function(t,i){return e.AttributeHelpers.coerceString(t)}},contentPadding:{value:void 0,validator:function(t,i){return e.AttributeHelpers.validateInteger(t)},setter:function(t,i){return e.AttributeHelpers.coerceInteger(t)}},focusOnFirstTabPress:{value:!0},flexLayout:{value:!1}}})},"@VERSION@",{requires:["flickr-view","hermes-template-fluid-modal","fluid-overlay-manager-view","attribute-helpers"],optionalRequires:["fluid"],langBundles:["common"]});YUI.add("hermes-template-signup-modal",function(a,e){var n=a.Template.Handlebars.revive({1:function(a,e,n,s,l){var i;return" "+a.escapeExpression("function"==typeof(i=null!=(i=n.signUpHeaderClass||(null!=e?e.signUpHeaderClass:e))?i:n.helperMissing)?i.call(null!=e?e:{},{name:"signUpHeaderClass",hash:{},data:l}):i)},3:function(a,e,n,s,l){var i;return" style=\"background-image:url('"+a.escapeExpression("function"==typeof(i=null!=(i=n.signUpHeaderImage||(null!=e?e.signUpHeaderImage:e))?i:n.helperMissing)?i.call(null!=e?e:{},{name:"signUpHeaderImage",hash:{},data:l}):i)+"')\""},compiler:[7,">= 4.0.0"],main:function(a,e,n,s,l){var i,t,r=null!=e?e:{},p=n.helperMissing,g=a.escapeExpression;return'\n\t\n\t
'+g("function"==typeof(t=null!=(t=n.signUpTitle||(null!=e?e.signUpTitle:e))?t:p)?t.call(r,{name:"signUpTitle",hash:{},data:l}):t)+'
\n\t
'+g("function"==typeof(t=null!=(t=n.signUpMessage||(null!=e?e.signUpMessage:e))?t:p)?t.call(r,{name:"signUpMessage",hash:{},data:l}):t)+'
\n\t
\n
\n\n"},useData:!0}),s={};a.Array.each([],function(e){var n=a.Template.get("hermes/"+e);n&&(s[e]=n)}),a.Template.register("hermes/signup-modal",function(e,l){return l=l||{},l.partials=l.partials?a.merge(s,l.partials):s,n(e,l)})},"@VERSION@",{requires:["template-base","handlebars-base"]});