(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{1124:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return D}));var o,i,s=a(0),n=a(1),c=a.n(n),r=a(982),l=a(1411),d=a(12),g=a(17),b=a(4),m=a(7),u=a.n(m),f=a(1358),p=a(227),O=a(26),j=a.n(O),h=a(1450),M=a(14),v=a(51),_=a(3),C=a.n(_),N=a(16),w=a.n(N),k=a(618),I=a(18),S=a(28),y=a(486),L=a(372);const P=Object(b.f)({community:{id:"navigation_bar.community_timeline",defaultMessage:"Local timeline"},home_timeline:{id:"tabs_bar.home",defaultMessage:"Home"},logout:{id:"navigation_bar.logout",defaultMessage:"Logout"},notifications:{id:"tabs_bar.notifications",defaultMessage:"Notifications"},public:{id:"navigation_bar.public_timeline",defaultMessage:"Federated timeline"},settings:{id:"navigation_bar.app_settings",defaultMessage:"App settings"},start:{id:"getting_started.heading",defaultMessage:"Getting started"}});let T=Object(b.g)(((i=class extends I.a{constructor(){super(...arguments),this.handleLogoutClick=e=>(e.preventDefault(),e.stopPropagation(),this.props.onLogout(),!1)}render(){const{intl:e,columns:t,unreadNotifications:a,showNotificationsBadge:o,onSettingsClick:i}=this.props,n=y.b.bind(null,(e=>!t||!t.some((t=>t.get("id")===e))));return Object(s.a)("nav",{className:"drawer--header"},void 0,Object(s.a)(k.a,{"aria-label":e.formatMessage(P.start),title:e.formatMessage(P.start),to:"/getting-started"},void 0,Object(s.a)(S.a,{id:"asterisk"})),n("HOME",Object(s.a)(k.a,{"aria-label":e.formatMessage(P.home_timeline),title:e.formatMessage(P.home_timeline),to:"/home"},void 0,Object(s.a)(S.a,{id:"home"}))),n("NOTIFICATIONS",Object(s.a)(k.a,{"aria-label":e.formatMessage(P.notifications),title:e.formatMessage(P.notifications),to:"/notifications"},void 0,Object(s.a)("span",{className:"icon-badge-wrapper"},void 0,Object(s.a)(S.a,{id:"bell"}),o&&a>0&&Object(s.a)("div",{className:"icon-badge"})))),n("COMMUNITY",Object(s.a)(k.a,{"aria-label":e.formatMessage(P.community),title:e.formatMessage(P.community),to:"/public/local"},void 0,Object(s.a)(S.a,{id:"users"}))),n("PUBLIC",Object(s.a)(k.a,{"aria-label":e.formatMessage(P.public),title:e.formatMessage(P.public),to:"/public"},void 0,Object(s.a)(S.a,{id:"globe"}))),Object(s.a)("a",{"aria-label":e.formatMessage(P.settings),onClick:i,href:"/settings/preferences",title:e.formatMessage(P.settings)},void 0,Object(s.a)(S.a,{id:"cogs"})),Object(s.a)("a",{"aria-label":e.formatMessage(P.logout),onClick:this.handleLogoutClick,href:L.h,title:e.formatMessage(P.logout)},void 0,Object(s.a)(S.a,{id:"sign-out"})))}}).propTypes={columns:w.a.list,unreadNotifications:C.a.number,showNotificationsBadge:C.a.bool,intl:C.a.object,onSettingsClick:C.a.func,onLogout:C.a.func.isRequired},o=i))||o;var x=a(615);const U=Object(b.f)({logoutMessage:{id:"confirmations.logout.message",defaultMessage:"Are you sure you want to log out?"},logoutConfirm:{id:"confirmations.logout.confirm",defaultMessage:"Log out"}});var B,E=Object(b.g)(Object(d.connect)((e=>({columns:e.getIn(["settings","columns"]),unreadNotifications:e.getIn(["notifications","unread"]),showNotificationsBadge:e.getIn(["local_settings","notifications","tab_badge"])})),((e,t)=>{let{intl:a}=t;return{onSettingsClick(t){t.preventDefault(),t.stopPropagation(),e(Object(v.d)("SETTINGS",{}))},onLogout(){e(Object(v.d)("CONFIRM",{message:a.formatMessage(U.logoutMessage),confirm:a.formatMessage(U.logoutConfirm),closeWhenConfirm:!1,onConfirm:()=>Object(x.e)()}))}}}))(T));const A=Object(b.f)({compose:{id:"navigation_bar.compose",defaultMessage:"Compose new post"}});let D=Object(d.connect)(((e,t)=>({elefriend:e.getIn(["compose","elefriend"]),showSearch:t.multiColumn?e.getIn(["search","submitted"])&&!e.getIn(["search","hidden"]):t.isSearchPage})),((e,t)=>{let{intl:a}=t;return{onClickElefriend(){e(Object(g.mb)())},onMount(){e(Object(g.vb)())},onUnmount(){e(Object(g.Gb)())}}}))(B=Object(b.g)(B=class extends c.a.PureComponent{componentDidMount(){const{isSearchPage:e}=this.props;e||this.props.onMount()}componentWillUnmount(){const{isSearchPage:e}=this.props;e||this.props.onUnmount()}render(){const{elefriend:e,intl:t,multiColumn:a,onClickElefriend:o,isSearchPage:i,showSearch:n}=this.props,c=u()("drawer","mbstobon-"+e);return Object(s.a)("div",{className:c,role:"region","aria-label":t.formatMessage(A.compose)},void 0,a&&Object(s.a)(E,{}),(a||i)&&Object(s.a)(f.a,{}),Object(s.a)("div",{className:"drawer__pager"},void 0,!i&&Object(s.a)("div",{className:"drawer__inner"},void 0,Object(s.a)(l.a,{}),Object(s.a)(r.a,{}),Object(s.a)("div",{className:"drawer__inner__mastodon"},void 0,M.mascot?Object(s.a)("img",{alt:"",draggable:"false",src:M.mascot}):Object(s.a)("button",{className:"mastodon",onClick:o}))),Object(s.a)(p.a,{defaultStyle:{x:i?0:-100},style:{x:j()(n||i?0:-100,{stiffness:210,damping:20})}},void 0,(e=>{let{x:t}=e;return Object(s.a)("div",{className:"drawer__inner darker",style:{transform:"translateX("+t+"%)",visibility:-100===t?"hidden":"visible"}},void 0,Object(s.a)(h.a,{}))}))))}})||B)||B}}]);
//# sourceMappingURL=compose-bd393d6c493ecd1f0913.chunk.js.map