{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/mutes/index.js"],"names":["messages","Object","react_intl__WEBPACK_IMPORTED_MODULE_7__","heading","id","defaultMessage","Mutes","react_redux__WEBPACK_IMPORTED_MODULE_6__","state","accountIds","getIn","handleLoadMore","lodash_debounce__WEBPACK_IMPORTED_MODULE_4___default","_this","props","dispatch","_actions_mutes__WEBPACK_IMPORTED_MODULE_15__","leading","componentWillMount","this","render","_props","intl","shouldUpdateScroll","babel_runtime_helpers_jsx__WEBPACK_IMPORTED_MODULE_0___default","_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","_components_loading_indicator__WEBPACK_IMPORTED_MODULE_11__","emptyMessage","icon","formatMessage","_components_column_back_button_slim__WEBPACK_IMPORTED_MODULE_13__","_components_scrollable_list__WEBPACK_IMPORTED_MODULE_16__","scrollKey","onLoadMore","map","_containers_account_container__WEBPACK_IMPORTED_MODULE_14__","react_immutable_pure_component__WEBPACK_IMPORTED_MODULE_8__","propTypes","params","prop_types__WEBPACK_IMPORTED_MODULE_9___default","a","object","isRequired","func","react_immutable_proptypes__WEBPACK_IMPORTED_MODULE_10___default","list"],"mappings":"sVAcMA,EAAWC,OAAAC,EAAA,EAAAD,EACfE,SAAAC,GAAA,eAAAC,eAAA,iBASmBC,EAFpBL,OAAAM,EAAA,QAAAN,CAJuB,SAAAO,GAAA,OACtBC,WAAYD,EAAME,OAAO,aAAc,QAAS,eAIjDT,OAAAC,EAAA,EAAAD,iLAeCU,eAAiBC,IAAS,WACxBC,EAAKC,MAAMC,SAASd,OAAAe,EAAA,EAAAf,KACnB,KAAOgB,SAAS,6CANnBC,8BACEC,KAAKL,MAAMC,SAASd,OAAAe,EAAA,EAAAf,iBAOtBmB,kBAAU,IAAAC,EACyCF,KAAKL,MAA9CQ,EADAD,EACAC,KAAMC,EADNF,EACME,mBAAoBd,EAD1BY,EAC0BZ,WAElC,IAAKA,EACH,OAAAe,IACGC,EAAA,UADH,EAAAD,IAEKE,EAAA,OAKP,IAAMC,EAAAH,IAAgBtB,EAAA,GAAhBE,GAAoC,qBAApCC,eAAwE,qCAE9E,OAAAmB,IACGC,EAAA,GADHG,KACe,aADfzB,QACqCmB,EAAKO,cAAc7B,EAASG,eADjE,EAAAqB,IAEKM,EAAA,MAFLN,IAGKO,EAAA,GAHLC,UAIgB,QAJhBC,WAKkBd,KAAKR,eALvBY,mBAM0BA,EAN1BI,aAOoBA,QAPpB,EASOlB,EAAWyB,IAAI,SAAA9B,GAAA,OAAAoB,IACbW,EAAA,GADa/B,GACiBA,GAARA,WAzCAgC,EAAA,KAE1BC,WACLC,OAAQC,EAAAC,EAAUC,OAAOC,WACzB3B,SAAUwB,EAAAC,EAAUG,KAAKD,WACzBnB,mBAAoBgB,EAAAC,EAAUG,KAC9BlC,WAAYmC,EAAAJ,EAAmBK,KAC/BvB,KAAMiB,EAAAC,EAAUC,OAAOC","file":"features/mutes.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { debounce } from 'lodash';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButtonSlim from '../../components/column_back_button_slim';\nimport AccountContainer from '../../containers/account_container';\nimport { fetchMutes, expandMutes } from '../../actions/mutes';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst messages = defineMessages({\n  heading: { id: 'column.mutes', defaultMessage: 'Muted users' },\n});\n\nconst mapStateToProps = state => ({\n  accountIds: state.getIn(['user_lists', 'mutes', 'items']),\n});\n\n@connect(mapStateToProps)\n@injectIntl\nexport default class Mutes extends ImmutablePureComponent {\n\n  static propTypes = {\n    params: PropTypes.object.isRequired,\n    dispatch: PropTypes.func.isRequired,\n    shouldUpdateScroll: PropTypes.func,\n    accountIds: ImmutablePropTypes.list,\n    intl: PropTypes.object.isRequired,\n  };\n\n  componentWillMount () {\n    this.props.dispatch(fetchMutes());\n  }\n\n  handleLoadMore = debounce(() => {\n    this.props.dispatch(expandMutes());\n  }, 300, { leading: true });\n\n  render () {\n    const { intl, shouldUpdateScroll, accountIds } = this.props;\n\n    if (!accountIds) {\n      return (\n        <Column>\n          <LoadingIndicator />\n        </Column>\n      );\n    }\n\n    const emptyMessage = <FormattedMessage id='empty_column.mutes' defaultMessage=\"You haven't muted any users yet.\" />;\n\n    return (\n      <Column icon='volume-off' heading={intl.formatMessage(messages.heading)}>\n        <ColumnBackButtonSlim />\n        <ScrollableList\n          scrollKey='mutes'\n          onLoadMore={this.handleLoadMore}\n          shouldUpdateScroll={shouldUpdateScroll}\n          emptyMessage={emptyMessage}\n        >\n          {accountIds.map(id =>\n            <AccountContainer key={id} id={id} />\n          )}\n        </ScrollableList>\n      </Column>\n    );\n  }\n\n}\n"],"sourceRoot":""}