webpackJsonp([39],{1884:function(e,t,a){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=a(6),n=o(s),d=a(4),u=o(d),i=a(5),l=o(i),f=a(7),c=o(f),p=a(8),v=o(p),h=a(222),m=o(h),w=a(24),C=o(w),y=a(54),b=r(y),_=a(291),g=r(_),k=a(1826),L=a(16),E=r(L),U=a(0),x=o(U),B=a(2),j=o(B),F=a(1),O=o(F);a(129);var P=function(e){function t(e){(0,u.default)(this,t);var a=(0,c.default)(this,(t.__proto__||(0,n.default)(t)).call(this,e));return a.onUserChanged=a.onUserChanged.bind(a),(0,x.default)("#root").attr("class","channel-view"),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(0,x.default)("body").addClass("ios"),a.state={user:C.default.getCurrentUser()},a.state.user||b.emitUserLoggedOutEvent("/login"),a}return(0,v.default)(t,e),(0,l.default)(t,[{key:"isValidState",value:function(){return null!=this.state.user}},{key:"onUserChanged",value:function(){var e=C.default.getCurrentUser();E.areObjectsEqual(this.state.user,e)||this.setState({user:e})}},{key:"componentDidMount",value:function(){g.initialize(),C.default.addChangeListener(this.onUserChanged),window.addEventListener("focus",this.onFocusListener),window.addEventListener("blur",this.onBlurListener),(0,x.default)("body").on("mouseenter mouseleave",".post",function(e){"mouseenter"===e.type?((0,x.default)(this).parent("div").prev(".date-separator, .new-separator").addClass("hovered--after"),(0,x.default)(this).parent("div").next(".date-separator, .new-separator").addClass("hovered--before")):((0,x.default)(this).parent("div").prev(".date-separator, .new-separator").removeClass("hovered--after"),(0,x.default)(this).parent("div").next(".date-separator, .new-separator").removeClass("hovered--before"))}),(0,x.default)("body").on("mouseenter mouseleave",".search-item__container .post",function(e){"mouseenter"===e.type?((0,x.default)(this).closest(".search-item__container").find(".date-separator").addClass("hovered--after"),(0,x.default)(this).closest(".search-item__container").next("div").find(".date-separator").addClass("hovered--before")):((0,x.default)(this).closest(".search-item__container").find(".date-separator").removeClass("hovered--after"),(0,x.default)(this).closest(".search-item__container").next("div").find(".date-separator").removeClass("hovered--before"))}),(0,x.default)("body").on("mouseenter mouseleave",".post.post--comment.same--root",function(e){"mouseenter"===e.type?((0,x.default)(this).parent("div").prev(".date-separator, .new-separator").addClass("hovered--comment"),(0,x.default)(this).parent("div").next(".date-separator, .new-separator").addClass("hovered--comment")):((0,x.default)(this).parent("div").prev(".date-separator, .new-separator").removeClass("hovered--comment"),(0,x.default)(this).parent("div").next(".date-separator, .new-separator").removeClass("hovered--comment"))}),(0,x.default)(window).on("keydown.preventBackspace",function(e){8!==e.which||(0,x.default)(e.target).is("input, textarea")||e.preventDefault()}),"true"===window.mm_config.EnableCustomEmoji&&(0,k.loadEmoji)(!1)}},{key:"componentWillUnmount",value:function(){(0,x.default)("#root").attr("class",""),g.close(),C.default.removeChangeListener(this.onUserChanged),(0,x.default)("body").off("click.userpopover"),(0,x.default)("body").off("mouseenter mouseleave",".post"),(0,x.default)("body").off("mouseenter mouseleave",".post.post--comment.same--root"),(0,x.default)(".modal").off("show.bs.modal"),(0,x.default)(window).off("keydown.preventBackspace"),window.removeEventListener("focus",this.onFocusListener),window.removeEventListener("blur",this.onBlurListener)}},{key:"render",value:function(){return this.isValidState()?O.default.cloneElement(this.props.children,{user:this.state.user}):O.default.createElement(m.default,null)}},{key:"onFocusListener",value:function(){b.emitBrowserFocus(!0)}},{key:"onBlurListener",value:function(){b.emitBrowserFocus(!1)}}]),t}(O.default.Component);t.default=P,P.propTypes={children:j.default.object}}});
//# sourceMappingURL=39.0c958b3cbc7fd1e93853.js.map