{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/reblogs/index.jsx"],"names":["messages","defineMessages","refresh","id","defaultMessage","Reblogs","ImmutablePureComponent","constructor","arguments","_defineProperty","this","props","dispatch","fetchReblogs","params","statusId","_debounce","expandReblogs","leading","UNSAFE_componentWillMount","accountIds","render","intl","hasMore","isLoading","multiColumn","_jsx","Column","LoadingIndicator","emptyMessage","FormattedMessage","bindToDocument","ColumnHeader","showBackButton","extraButton","type","className","title","formatMessage","onClick","handleRefresh","Icon","icon","RefreshIcon","ScrollableList","scrollKey","onLoadMore","handleLoadMore","map","AccountContainer","withNote","Helmet","name","content","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","state","getIn","injectIntl"],"mappings":"+RAsBA,MAAMA,EAAWC,YAAe,CAC9BC,QAAS,CAAEC,GAAG,UAAYC,eAAe,aAS3C,MAAMC,UAAgBC,IAAuBC,cAAA,SAAAC,WAAAC,YAAA,sBAkB3B,KACdC,KAAKC,MAAMC,SAASC,YAAaH,KAAKC,MAAMG,OAAOC,UAAU,IAC9DN,YAAA,sBAEgBO,KAAS,KACxBN,KAAKC,MAAMC,SAASK,YAAcP,KAAKC,MAAMG,OAAOC,UAAU,GAC7D,IAAK,CAAEG,SAAS,IAAO,CAZ1BC,4BACOT,KAAKC,MAAMS,YACdV,KAAKC,MAAMC,SAASC,YAAaH,KAAKC,MAAMG,OAAOC,UAEvD,CAUAM,SACE,MAAM,KAAEC,EAAI,WAAEF,EAAU,QAAEG,EAAO,UAAEC,EAAS,YAAEC,GAAgBf,KAAKC,MAEnE,IAAKS,EACH,OACEM,YAACC,IAAM,UACLD,YAACE,IAAgB,KAKvB,MAAMC,EAAeH,YAACI,IAAgB,CAAC3B,GAAE,uBAAwBC,eAAe,iFAEhF,OACEsB,YAACC,IAAM,CAACI,gBAAiBN,QAAY,EACnCC,YAACM,IAAY,CACXC,gBAAc,EACdR,YAAaA,EACbS,YACER,YAAA,UAAQS,KAAK,SAASC,UAAU,wBAAwBC,MAAOf,EAAKgB,cAActC,EAASE,SAAU,aAAYoB,EAAKgB,cAActC,EAASE,SAAUqC,QAAS7B,KAAK8B,oBAAc,EAACd,YAACe,IAAI,CAACtC,GAAG,UAAUuC,KAAMC,SAIjNjB,YAACkB,IAAc,CACbC,UAAU,UACVC,WAAYpC,KAAKqC,eACjBxB,QAASA,EACTC,UAAWA,EACXK,aAAcA,EACdE,gBAAiBN,QAAY,EAE5BL,EAAW4B,KAAI7C,GACduB,YAACuB,IAAgB,CAAU9C,GAAIA,EAAI+C,UAAU,GAAtB/C,MAI3BuB,YAACyB,IAAM,UACLzB,YAAA,QAAM0B,KAAK,SAASC,QAAQ,aAIpC,EAED5C,YArEKJ,EAAO,YAEQ,CACjBS,OAAQwC,IAAUC,OAAOC,WACzB5C,SAAU0C,IAAUG,KAAKD,WACzBpC,WAAYsC,IAAmBC,KAC/BpC,QAAS+B,IAAUM,KACnBpC,UAAW8B,IAAUM,KACrBnC,YAAa6B,IAAUM,KACvBtC,KAAMgC,IAAUC,OAAOC,aA8DZK,6BA7ESC,CAACC,EAAOpD,KAAK,CACnCS,WAAY2C,EAAMC,MAAM,CAAC,aAAc,eAAgBrD,EAAMG,OAAOC,SAAU,UAC9EQ,UAAWwC,EAAMC,MAAM,CAAC,aAAc,eAAgBrD,EAAMG,OAAOC,SAAU,SAC7ES,UAAWuC,EAAMC,MAAM,CAAC,aAAc,eAAgBrD,EAAMG,OAAOC,SAAU,cAAc,MA0E9E8C,CAAyBI,YAAW5D,G","file":"js/features/reblogs-8b072dd5e537ad470af5.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\n\nimport { Helmet } from 'react-helmet';\n\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { connect } from 'react-redux';\n\nimport { debounce } from 'lodash';\n\nimport RefreshIcon from '@/material-icons/400-24px/refresh.svg?react';\nimport { Icon } from 'mastodon/components/icon';\n\nimport { fetchReblogs, expandReblogs } from '../../actions/interactions';\nimport ColumnHeader from '../../components/column_header';\nimport { LoadingIndicator } from '../../components/loading_indicator';\nimport ScrollableList from '../../components/scrollable_list';\nimport AccountContainer from '../../containers/account_container';\nimport Column from '../ui/components/column';\n\nconst messages = defineMessages({\n refresh: { id: 'refresh', defaultMessage: 'Refresh' },\n});\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'items']),\n hasMore: !!state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'next']),\n isLoading: state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'isLoading'], true),\n});\n\nclass Reblogs extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n accountIds: ImmutablePropTypes.list,\n hasMore: PropTypes.bool,\n isLoading: PropTypes.bool,\n multiColumn: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n UNSAFE_componentWillMount () {\n if (!this.props.accountIds) {\n this.props.dispatch(fetchReblogs(this.props.params.statusId));\n }\n }\n\n handleRefresh = () => {\n this.props.dispatch(fetchReblogs(this.props.params.statusId));\n };\n\n handleLoadMore = debounce(() => {\n this.props.dispatch(expandReblogs(this.props.params.statusId));\n }, 300, { leading: true });\n\n render () {\n const { intl, accountIds, hasMore, isLoading, multiColumn } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='status.reblogs.empty' defaultMessage='No one has boosted this post yet. When someone does, they will show up here.' />;\n\n return (\n <Column bindToDocument={!multiColumn}>\n <ColumnHeader\n showBackButton\n multiColumn={multiColumn}\n extraButton={(\n <button type='button' className='column-header__button' title={intl.formatMessage(messages.refresh)} aria-label={intl.formatMessage(messages.refresh)} onClick={this.handleRefresh}><Icon id='refresh' icon={RefreshIcon} /></button>\n )}\n />\n\n <ScrollableList\n scrollKey='reblogs'\n onLoadMore={this.handleLoadMore}\n hasMore={hasMore}\n isLoading={isLoading}\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} withNote={false} />,\n )}\n </ScrollableList>\n\n <Helmet>\n <meta name='robots' content='noindex' />\n </Helmet>\n </Column>\n );\n }\n\n}\n\nexport default connect(mapStateToProps)(injectIntl(Reblogs));\n"],"sourceRoot":""}