{"version":3,"sources":["webpack:///app/javascript/home/mastodon/mastodon/app/javascript/flavours/glitch/features/account_timeline/index.jsx"],"names":["emptyList","ImmutableList","RemoteHint","_ref2","url","_jsx","TimelineHint","resource","FormattedMessage","id","defaultMessage","AccountTimeline","ImmutablePureComponent","constructor","arguments","_defineProperty","this","column","scrollTop","maxId","props","dispatch","expandAccountTimeline","accountId","withReplies","tagged","params","c","_load","fetchAccount","expandAccountFeaturedTimeline","fetchFeaturedTags","componentDidMount","acct","lookupAccount","componentDidUpdate","prevProps","UNSAFE_componentWillReceiveProps","nextProps","render","statusIds","featuredStatusIds","isLoading","hasMore","suspended","isAccount","hidden","multiColumn","remote","remoteUrl","isEmpty","Column","LoadingIndicator","BundleColumnError","errorType","emptyMessage","forceEmptyState","LimitedAccountHint","remoteMessage","_jsxs","ref","setRef","children","ProfileColumnHeader","onClick","handleHeaderClick","StatusList","prepend","HeaderContainer","hideTabs","alwaysPrepend","append","scrollKey","onLoadMore","handleLoadMore","bindToDocument","timelineId","PropTypes","shape","string","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","state","_ref","getIn","normalizeForLookup","path","concat","getAccountHidden"],"mappings":"iUAyBA,MAAMA,EAAYC,iBAkCZC,EAAaC,IAAA,IAAC,IAAEC,GAAKD,EAAA,OACzBE,YAACC,IAAY,CAACF,IAAKA,EAAKG,SAAUF,YAACG,IAAgB,CAACC,GAAE,mCAAoCC,eAAe,iBAAoB,EAO/H,MAAMC,UAAwBC,IAAuBC,cAAA,SAAAC,WAAAC,YAAA,0BA2E/B,KAClBC,KAAKC,OAAOC,WAAW,IACxBH,YAAA,uBAEgBI,IACfH,KAAKI,MAAMC,SAASC,YAAsBN,KAAKI,MAAMG,UAAW,CAAEJ,QAAOK,YAAaR,KAAKI,MAAMI,YAAaC,OAAQT,KAAKI,MAAMM,OAAOD,SAAU,IACnJV,YAAA,eAEQY,IACPX,KAAKC,OAASU,CAAC,GAChB,CA9DDC,QACE,MAAM,UAAEL,EAAS,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k.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { FormattedMessage } from 'react-intl';\n\nimport { List as ImmutableList } from 'immutable';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { connect } from 'react-redux';\n\nimport { TimelineHint } from 'flavours/glitch/components/timeline_hint';\nimport ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';\nimport BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error';\nimport { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map';\nimport { getAccountHidden } from 'flavours/glitch/selectors';\n\nimport { lookupAccount, fetchAccount } from '../../actions/accounts';\nimport { fetchFeaturedTags } from '../../actions/featured_tags';\nimport { expandAccountFeaturedTimeline, expandAccountTimeline } from '../../actions/timelines';\nimport { LoadingIndicator } from '../../components/loading_indicator';\nimport StatusList from '../../components/status_list';\nimport Column from '../ui/components/column';\n\nimport { LimitedAccountHint } from './components/limited_account_hint';\nimport HeaderContainer from './containers/header_container';\n\nconst emptyList = ImmutableList();\n\nconst mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = false }) => {\n const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]);\n\n if (accountId === null) {\n return {\n isLoading: false,\n isAccount: false,\n statusIds: emptyList,\n };\n } else if (!accountId) {\n return {\n isLoading: true,\n statusIds: emptyList,\n };\n }\n\n const path = withReplies ? `${accountId}:with_replies` : `${accountId}${tagged ? `:${tagged}` : ''}`;\n\n return {\n accountId,\n remote: !!(state.getIn(['accounts', accountId, 'acct']) !== state.getIn(['accounts', accountId, 'username'])),\n remoteUrl: state.getIn(['accounts', accountId, 'url']),\n isAccount: !!state.getIn(['accounts', accountId]),\n statusIds: state.getIn(['timelines', `account:${path}`, 'items'], ImmutableList()),\n featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned${tagged ? `:${tagged}` : ''}`, 'items'], ImmutableList()),\n isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),\n suspended: state.getIn(['accounts', accountId, 'suspended'], false),\n hidden: getAccountHidden(state, accountId),\n };\n};\n\nconst RemoteHint = ({ url }) => (\n } />\n);\n\nRemoteHint.propTypes = {\n url: PropTypes.string.isRequired,\n};\n\nclass AccountTimeline extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.shape({\n acct: PropTypes.string,\n id: PropTypes.string,\n tagged: PropTypes.string,\n }).isRequired,\n accountId: PropTypes.string,\n dispatch: PropTypes.func.isRequired,\n statusIds: ImmutablePropTypes.list,\n featuredStatusIds: ImmutablePropTypes.list,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n withReplies: PropTypes.bool,\n isAccount: PropTypes.bool,\n suspended: PropTypes.bool,\n hidden: PropTypes.bool,\n remote: PropTypes.bool,\n remoteUrl: PropTypes.string,\n multiColumn: PropTypes.bool,\n };\n\n _load () {\n const { accountId, withReplies, params: { tagged }, dispatch } = this.props;\n\n dispatch(fetchAccount(accountId));\n\n if (!withReplies) {\n dispatch(expandAccountFeaturedTimeline(accountId, { tagged }));\n }\n\n dispatch(fetchFeaturedTags(accountId));\n dispatch(expandAccountTimeline(accountId, { withReplies, tagged }));\n }\n\n componentDidMount () {\n const { params: { acct }, accountId, dispatch } = this.props;\n\n if (accountId) {\n this._load();\n } else {\n dispatch(lookupAccount(acct));\n }\n }\n\n componentDidUpdate (prevProps) {\n const { params: { acct, tagged }, accountId, withReplies, dispatch } = this.props;\n\n if (prevProps.accountId !== accountId && accountId) {\n this._load();\n } else if (prevProps.params.acct !== acct) {\n dispatch(lookupAccount(acct));\n } else if (prevProps.params.tagged !== tagged) {\n if (!withReplies) {\n dispatch(expandAccountFeaturedTimeline(accountId, { tagged }));\n }\n dispatch(expandAccountTimeline(accountId, { withReplies, tagged }));\n }\n }\n\n UNSAFE_componentWillReceiveProps (nextProps) {\n const { dispatch } = this.props;\n\n if ((nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) || nextProps.withReplies !== this.props.withReplies) {\n dispatch(fetchAccount(nextProps.params.accountId));\n\n if (!nextProps.withReplies) {\n dispatch(expandAccountFeaturedTimeline(nextProps.params.accountId));\n }\n\n dispatch(expandAccountTimeline(nextProps.params.accountId, { withReplies: nextProps.params.withReplies }));\n }\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n };\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged }));\n };\n\n setRef = c => {\n this.column = c;\n };\n\n render () {\n const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;\n\n if (isLoading && statusIds.isEmpty()) {\n return (\n \n \n \n );\n } else if (!isLoading && !isAccount) {\n return (\n \n );\n }\n\n let emptyMessage;\n\n const forceEmptyState = suspended || hidden;\n\n if (suspended) {\n emptyMessage = ;\n } else if (hidden) {\n emptyMessage = ;\n } else if (remote && statusIds.isEmpty()) {\n emptyMessage = ;\n } else {\n emptyMessage = ;\n }\n\n const remoteMessage = remote ? : null;\n\n return (\n \n \n\n }\n alwaysPrepend\n append={remoteMessage}\n scrollKey='account_timeline'\n statusIds={forceEmptyState ? emptyList : statusIds}\n featuredStatusIds={featuredStatusIds}\n isLoading={isLoading}\n hasMore={!forceEmptyState && hasMore}\n onLoadMore={this.handleLoadMore}\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n timelineId='account'\n />\n \n );\n }\n\n}\n\nexport default connect(mapStateToProps)(AccountTimeline);\n"],"sourceRoot":""}