1 (window
.webpackJsonp
=window
.webpackJsonp
||[]).push([[61],{711:function(t
,e
,a
){"use strict";a
.r(e
);var n
,s
,i
=a(1),o
=a(7),c
=a(0),r
=a(2),l
=a(960),u
=a
.n(l
),d
=a(3),h
=a
.n(d
),g
=a(20),p
=a(626),b
=a(430),m
=a(428),O
=a(6),f
=a(394),j
=a
.n(f
),v
=a(961),_
=a
.n(v
),M
=Object(O
.f
)({placeholder:{id:"hashtag.column_settings.select.placeholder",defaultMessage:"Enter hashtags…"},noOptions:{id:"hashtag.column_settings.select.no_options_message",defaultMessage:"No suggestions found"}}),y
=Object(O
.g
)(n=function(s
){function t(){for(var a
,t
=arguments
.length
,e
=new Array(t
),n
=0;n
<t
;n
++)e
[n
]=arguments
[n
];return a
=s
.call
.apply(s
,[this].concat(e
))||this,Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"state",{open:a
.hasTags()}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"onSelect",function(e
){return function(t
){return a
.props
.onChange(["tags",e
],t
)}}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"onToggle",function(){a
.state
.open
&&a
.hasTags()&&a
.props
.onChange("tags",{}),a
.setState({open:!a
.state
.open
})}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"noOptionsMessage",function(){return a
.props
.intl
.formatMessage(M
.noOptions
)}),a
}Object(o
.a
)(t
,s
);var e
=t
.prototype;return e
.hasTags=function(){var e
=this;return["all","any","none"].map(function(t
){return 0<e
.tags(t
).length
}).includes(!0)},e
.tags=function(t
){var e
=this.props
.settings
.getIn(["tags",t
])||[];return e
.toJSON
?e
.toJSON():e
},e
.modeSelect=function(t
){return Object(i
.a
)("div",{className:"column-settings__row"},void 0,Object(i
.a
)("span",{className:"column-settings__section"},void 0,this.modeLabel(t
)),Object(i
.a
)(_
.a
,{isMulti:!0,autoFocus:!0,value:this.tags(t
),onChange:this.onSelect(t
),loadOptions:this.props
.onLoad
,className:"column-select__container",classNamePrefix:"column-select",name:"tags",placeholder:this.props
.intl
.formatMessage(M
.placeholder
),noOptionsMessage:this.noOptionsMessage
}))},e
.modeLabel=function(t
){switch(t
){case"any":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.any",defaultMessage:"Any of these"});case"all":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.all",defaultMessage:"All of these"});case"none":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.none",defaultMessage:"None of these"});default:return""}},e
.render=function(){return Object(i
.a
)("div",{},void 0,Object(i
.a
)("div",{className:"column-settings__row"},void 0,Object(i
.a
)("div",{className:"setting-toggle"},void 0,Object(i
.a
)(j
.a
,{id:"hashtag.column_settings.tag_toggle",onChange:this.onToggle
,checked:this.state
.open
}),Object(i
.a
)("span",{className:"setting-toggle__label"},void 0,Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_toggle",defaultMessage:"Include additional tags in this column"})))),this.state
.open
&&Object(i
.a
)("div",{className:"column-settings__hashtags"},void 0,this.modeSelect("any"),this.modeSelect("all"),this.modeSelect("none")))},t
}(h
.a
.PureComponent
))||n
,w
=a(206),I
=a(10),C
=Object(g
.connect
)(function(t
,e
){var a
=e
.columnId
,n
=t
.getIn(["settings","columns"]),s
=n
.findIndex(function(t
){return t
.get("uuid")===a
});return a
&&0<=s
?{settings:n
.get(s
).get("params")}:{}},function(a
,t
){var n
=t
.columnId
;return{onChange:function(t
,e
){a(Object(w
.f
)(n
,t
,e
))},onLoad:function(t
){return Object(I
.a
)().get("/api/v2/search",{params:{q:t
}}).then(function(t
){return(t
.data
.hashtags
||[]).map(function(t
){return{value:t
.name
,label:"#"+t
.name
}})})}}})(y
),N
=a(32),S
=a(401);a
.d(e
,"default",function(){return k
});var k
=Object(g
.connect
)(function(t
,e
){return{hasUnread:0<t
.getIn(["timelines","hashtag:"+e
.params
.id
,"unread"])}})(s=function(n
){function t(){for(var s
,t
=arguments
.length
,e
=new Array(t
),a
=0;a
<t
;a
++)e
[a
]=arguments
[a
];return s
=n
.call
.apply(n
,[this].concat(e
))||this,Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"disconnects",[]),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handlePin",function(){var t
=s
.props
,e
=t
.columnId
,a
=t
.dispatch
;a(e
?Object(w
.h
)(e
):Object(w
.e
)("HASHTAG",{id:s
.props
.params
.id
}))}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"title",function(){var t
=[s
.props
.params
.id
];return s
.additionalFor("any")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.any",values:{additional:s
.additionalFor("any")},defaultMessage:"or {additional}"},"any")),s
.additionalFor("all")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.all",values:{additional:s
.additionalFor("all")},defaultMessage:"and {additional}"},"all")),s
.additionalFor("none")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.none",values:{additional:s
.additionalFor("none")},defaultMessage:"without {additional}"},"none")),t
}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"additionalFor",function(t
){var e
=s
.props
.params
.tags
;return e
&&0<(e
[t
]||[]).length
?e
[t
].map(function(t
){return t
.value
}).join("/"):""}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleMove",function(t
){var e
=s
.props
,a
=e
.columnId
;(0,e
.dispatch
)(Object(w
.g
)(a
,t
))}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleHeaderClick",function(){s
.column
.scrollTop()}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"setRef",function(t
){s
.column
=t
}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleLoadMore",function(t
){var e
=s
.props
.params
,a
=e
.id
,n
=e
.tags
;s
.props
.dispatch(Object(N
.q
)(a
,{maxId:t
,tags:n
}))}),s
}Object(o
.a
)(t
,n
);var e
=t
.prototype;return e
._subscribe=function(e
,a
,t
){var n
=this;void 0===t
&&(t
={});var s
=(t
.any
||[]).map(function(t
){return t
.value
}),o
=(t
.all
||[]).map(function(t
){return t
.value
}),i
=(t
.none
||[]).map(function(t
){return t
.value
});[a
].concat(s
).map(function(t
){n
.disconnects
.push(e(Object(S
.c
)(a
,t
,function(t
){var e
=t
.tags
.map(function(t
){return t
.name
});return o
.filter(function(t
){return e
.includes(t
)}).length
===o
.length
&&0===i
.filter(function(t
){return e
.includes(t
)}).length
})))})},e
._unsubscribe=function(){this.disconnects
.map(function(t
){return t()}),this.disconnects
=[]},e
.componentDidMount=function(){var t
=this.props
.dispatch
,e
=this.props
.params
,a
=e
.id
,n
=e
.tags
;this._subscribe(t
,a
,n
),t(Object(N
.q
)(a
,{tags:n
}))},e
.componentWillReceiveProps=function(t
){var e
=this.props
,a
=e
.dispatch
,n
=e
.params
,s
=t
.params
,o
=s
.id
,i
=s
.tags
;o
===n
.id
&&u()(i
,n
.tags
)||(this._unsubscribe(),this._subscribe(a
,o
,i
),this.props
.dispatch(Object(N
.i
)("hashtag:"+o
)),this.props
.dispatch(Object(N
.q
)(o
,{tags:i
})))},e
.componentWillUnmount=function(){this._unsubscribe()},e
.render=function(){var t
=this.props
,e
=t
.hasUnread
,a
=t
.columnId
,n
=t
.multiColumn
,s
=this.props
.params
.id
,o
=!!a
;return h
.a
.createElement(b
.a
,{ref:this.setRef
,name:"hashtag",label:"#"+s
},Object(i
.a
)(m
.a
,{icon:"hashtag",active:e
,title:this.title(),onPin:this.handlePin
,onMove:this.handleMove
,onClick:this.handleHeaderClick
,pinned:o
,multiColumn:n
,showBackButton:!0},void 0,a
&&Object(i
.a
)(C
,{columnId:a
})),Object(i
.a
)(p
.a
,{trackScroll:!o
,scrollKey:"hashtag_timeline-"+a
,timelineId:"hashtag:"+s
,onLoadMore:this.handleLoadMore
,emptyMessage:Object(i
.a
)(O
.b
,{id:"empty_column.hashtag",defaultMessage:"There is nothing in this hashtag yet."})}))},t
}(h
.a
.PureComponent
))||s
}}]);
2 //# sourceMappingURL=hashtag_timeline.js.map