-webpackJsonp([21],{1016:function(e,t,n){"use strict";var a=n(9),o=n(1017),i=n(155),r=n(8),s=(n.n(r),function(e,t){var n=t.id;return{status:e.getIn(["statuses",n]),checked:e.getIn(["reports","new","status_ids"],Object(r.Set)()).includes(n)}}),c=function(e,t){var n=t.id;return{onToggle:function(t){e(Object(i.m)(n,t.target.checked))}}};t.a=Object(a.connect)(s,c)(o.a)},1017:function(e,t,n){"use strict";n.d(t,"a",function(){return y});var a=n(2),o=n.n(a),i=n(1),r=n.n(i),s=n(3),c=n.n(s),l=n(4),d=n.n(l),u=n(0),h=n.n(u),f=n(882),p=n.n(f),v=n(1018),g=n.n(v),m=n(104),b=n(58),k=n(163),y=function(e){function t(){return r()(this,t),c()(this,e.apply(this,arguments))}return d()(t,e),t.prototype.render=function(){var e=this.props,t=e.status,n=e.checked,a=e.onToggle,i=e.disabled,r=null;if(t.get("reblog"))return null;if(t.get("media_attachments").size>0)if(t.get("media_attachments").some(function(e){return"unknown"===e.get("type")}));else if("video"===t.getIn(["media_attachments",0,"type"])){var s=t.getIn(["media_attachments",0]);r=o()(k.a,{fetchComponent:b.G,loading:this.renderLoadingVideoPlayer},void 0,function(e){return o()(e,{preview:s.get("preview_url"),src:s.get("url"),width:239,height:110,inline:!0,sensitive:t.get("sensitive"),onOpenVideo:g.a})})}else r=o()(k.a,{fetchComponent:b.w,loading:this.renderLoadingMediaGallery},void 0,function(e){return o()(e,{media:t.get("media_attachments"),sensitive:t.get("sensitive"),height:110,onOpenMedia:g.a})});return o()("div",{className:"status-check-box"},void 0,o()("div",{className:"status-check-box__status"},void 0,o()(m.a,{status:t}),r),o()("div",{className:"status-check-box-toggle"},void 0,o()(p.a,{checked:n,onChange:a,disabled:i})))},t}(h.a.PureComponent)},1018:function(e,t){function n(){}e.exports=n},851:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"default",function(){return X});var a,o,i,r,s=n(2),c=n.n(s),l=n(1),d=n.n(l),u=n(3),h=n.n(u),f=n(4),p=n.n(f),v=n(0),g=(n.n(v),n(9)),m=n(155),b=n(19),k=n(5),y=n.n(k),_=n(14),w=n.n(_),C=n(68),O=n(7),j=n(1016),M=n(8),T=(n.n(M),n(12)),S=n.n(T),x=n(100),E=n(882),N=n.n(E),P=n(23),I=Object(O.f)({close:{id:"lightbox.close",defaultMessage:"Close"},placeholder:{id:"report.placeholder",defaultMessage:"Additional comments"},submit:{id:"report.submit",defaultMessage:"Submit"}}),F=function(){var e=Object(C.c)();return function(t){var n=t.getIn(["reports","new","account_id"]);return{isSubmitting:t.getIn(["reports","new","isSubmitting"]),account:e(t,n),comment:t.getIn(["reports","new","comment"]),forward:t.getIn(["reports","new","forward"]),statusIds:Object(M.OrderedSet)(t.getIn(["timelines","account:"+n+":with_replies","items"])).union(t.getIn(["reports","new","status_ids"]))}}},X=(a=Object(g.connect)(F))(o=Object(O.g)((r=i=function(e){function t(){var n,a,o;d()(this,t);for(var i=arguments.length,r=Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=a=h()(this,e.call.apply(e,[this].concat(r))),a.handleCommentChange=function(e){a.props.dispatch(Object(m.i)(e.target.value))},a.handleForwardChange=function(e){a.props.dispatch(Object(m.j)(e.target.checked))},a.handleSubmit=function(){a.props.dispatch(Object(m.l)())},o=n,h()(a,o)}return p()(t,e),t.prototype.componentDidMount=function(){this.props.dispatch(Object(b.l)(this.props.account.get("id"),{withReplies:!0}))},t.prototype.componentWillReceiveProps=function(e){this.props.account!==e.account&&e.account&&this.props.dispatch(Object(b.l)(e.account.get("id"),{withReplies:!0}))},t.prototype.render=function(){var e=this.props,t=e.account,n=e.comment,a=e.intl,o=e.statusIds,i=e.isSubmitting,r=e.forward,s=e.onClose;if(!t)return null;var l=t.get("acct").split("@")[1];return c()("div",{className:"modal-root__modal report-modal"},void 0,c()("div",{className:"report-modal__target"},void 0,c()(P.a,{className:"media-modal__close",title:a.formatMessage(I.close),icon:"times",onClick:s,size:16}),c()(O.b,{id:"report.target",defaultMessage:"Report {target}",values:{target:c()("strong",{},void 0,t.get("acct"))}})),c()("div",{className:"report-modal__container"},void 0,c()("div",{className:"report-modal__comment"},void 0,c()("p",{},void 0,c()(O.b,{id:"report.hint",defaultMessage:"The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:"})),c()("textarea",{className:"setting-text light",placeholder:a.formatMessage(I.placeholder),value:n,onChange:this.handleCommentChange,disabled:i}),l&&c()("div",{},void 0,c()("p",{},void 0,c()(O.b,{id:"report.forward_hint",defaultMessage:"The account is from another server. Send an anonymized copy of the report there as well?"})),c()("div",{className:"setting-toggle"},void 0,c()(N.a,{id:"report-forward",checked:r,disabled:i,onChange:this.handleForwardChange}),c()("label",{htmlFor:"report-forward",className:"setting-toggle__label"},void 0,c()(O.b,{id:"report.forward",defaultMessage:"Forward to {target}",values:{target:l}})))),c()(x.a,{disabled:i,text:a.formatMessage(I.submit),onClick:this.handleSubmit})),c()("div",{className:"report-modal__statuses"},void 0,c()("div",{},void 0,o.map(function(e){return c()(j.a,{id:e,disabled:i},e)})))))},t}(S.a),i.propTypes={isSubmitting:y.a.bool,account:w.a.map,statusIds:w.a.orderedSet.isRequired,comment:y.a.string.isRequired,forward:y.a.bool,dispatch:y.a.func.isRequired,intl:y.a.object.isRequired},o=r))||o)||o},882:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),d=n(0),u=a(d),h=n(10),f=a(h),p=n(5),v=a(p),g=n(883),m=a(g),b=n(884),k=a(b),y=n(885),_=function(e){function t(e){i(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClick=n.handleClick.bind(n),n.handleTouchStart=n.handleTouchStart.bind(n),n.handleTouchMove=n.handleTouchMove.bind(n),n.handleTouchEnd=n.handleTouchEnd.bind(n),n.handleFocus=n.handleFocus.bind(n),n.handleBlur=n.handleBlur.bind(n),n.previouslyChecked=!(!e.checked&&!e.defaultChecked),n.state={checked:!(!e.checked&&!e.defaultChecked),hasFocus:!1},n}return s(t,e),l(t,[{key:"componentWillReceiveProps",value:function(e){"checked"in e&&this.setState({checked:!!e.checked})}},{key:"handleClick",value:function(e){var t=this.input;if(e.target!==t&&!this.moved)return this.previouslyChecked=t.checked,e.preventDefault(),t.focus(),void t.click();var n=this.props.hasOwnProperty("checked")?this.props.checked:t.checked;this.setState({checked:n})}},{key:"handleTouchStart",value:function(e){this.startX=(0,y.pointerCoord)(e).x,this.activated=!0}},{key:"handleTouchMove",value:function(e){if(this.activated&&(this.moved=!0,this.startX)){var t=(0,y.pointerCoord)(e).x;this.state.checked&&t+15<this.startX?(this.setState({checked:!1}),this.startX=t,this.activated=!0):t-15>this.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=t<this.startX+5)}}},{key:"handleTouchEnd",value:function(e){if(this.moved){var t=this.input;if(e.preventDefault(),this.startX){var n=(0,y.pointerCoord)(e).x;!0===this.previouslyChecked&&this.startX+4>n?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4<n&&this.previouslyChecked!==this.state.checked&&(this.setState({checked:!0}),this.previouslyChecked=this.state.checked,t.click()),this.activated=!1,this.startX=null,this.moved=!1}}}},{key:"handleFocus",value:function(e){var t=this.props.onFocus;t&&t(e),this.setState({hasFocus:!0})}},{key:"handleBlur",value:function(e){var t=this.props.onBlur;t&&t(e),this.setState({hasFocus:!1})}},{key:"getIcon",value:function(e){var n=this.props.icons;return n?void 0===n[e]?t.defaultProps.icons[e]:n[e]:null}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,a=(t.icons,o(t,["className","icons"])),i=(0,f.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},n);return u.default.createElement("div",{className:i,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},u.default.createElement("div",{className:"react-toggle-track"},u.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),u.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),u.default.createElement("div",{className:"react-toggle-thumb"}),u.default.createElement("input",c({},a,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(d.PureComponent);t.default=_,_.displayName="Toggle",_.defaultProps={icons:{checked:u.default.createElement(m.default,null),unchecked:u.default.createElement(k.default,null)}},_.propTypes={checked:v.default.bool,disabled:v.default.bool,defaultChecked:v.default.bool,onChange:v.default.func,onFocus:v.default.func,onBlur:v.default.func,className:v.default.string,name:v.default.string,value:v.default.string,id:v.default.string,"aria-labelledby":v.default.string,"aria-label":v.default.string,icons:v.default.oneOfType([v.default.bool,v.default.shape({checked:v.default.node,unchecked:v.default.node})])}},883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=function(){return o.default.createElement("svg",{width:"14",height:"11",viewBox:"0 0 14 11"},o.default.createElement("title",null,"switch-check"),o.default.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}))}},884:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=function(){return o.default.createElement("svg",{width:"10",height:"10",viewBox:"0 0 10 10"},o.default.createElement("title",null,"switch-x"),o.default.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"}))}},885:function(e,t,n){"use strict";function a(e){if(e){var t=e.changedTouches;if(t&&t.length>0){var n=t[0];return{x:n.clientX,y:n.clientY}}var a=e.pageX;if(void 0!==a)return{x:a,y:e.pageY}}return{x:0,y:0}}Object.defineProperty(t,"__esModule",{value:!0}),t.pointerCoord=a}});
+(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{706:function(e,t,n){"use strict";n.r(t);var o,a,i,r=n(0),s=n.n(r),d=n(6),c=n.n(d),l=n(3),u=n.n(l),p=n(7),h=n.n(p),g=n(1),m=n.n(g),f=n(12),v=n(42),b=n(19),w=n(2),_=n.n(w),y=n(17),C=n.n(y),O=n(32),j=n(4),k=n(199),I=n.n(k),M=n(757),N=n.n(M),S=n(96),x=n(16),R=n(119),K=function(e){function t(){return c()(this,t),u()(this,e.apply(this,arguments))}return h()(t,e),t.prototype.render=function(){var e=this.props,t=e.status,n=e.checked,o=e.onToggle,a=e.disabled,i=null;if(t.get("reblog"))return null;if(t.get("media_attachments").size>0)if(t.get("media_attachments").some(function(e){return"unknown"===e.get("type")}));else if("video"===t.getIn(["media_attachments",0,"type"])){var r=t.getIn(["media_attachments",0]);i=s()(R.a,{fetchComponent:x.G,loading:this.renderLoadingVideoPlayer},void 0,function(e){return s()(e,{preview:r.get("preview_url"),src:r.get("url"),alt:r.get("description"),width:239,height:110,inline:!0,sensitive:t.get("sensitive"),onOpenVideo:N.a})})}else i=s()(R.a,{fetchComponent:x.w,loading:this.renderLoadingMediaGallery},void 0,function(e){return s()(e,{media:t.get("media_attachments"),sensitive:t.get("sensitive"),height:110,onOpenMedia:N.a})});return s()("div",{className:"status-check-box"},void 0,s()("div",{className:"status-check-box__status"},void 0,s()(S.a,{status:t}),i),s()("div",{className:"status-check-box-toggle"},void 0,s()(I.a,{checked:n,onChange:o,disabled:a})))},t}(m.a.PureComponent),T=n(5),q=Object(f.connect)(function(e,t){var n=t.id;return{status:e.getIn(["statuses",n]),checked:e.getIn(["reports","new","status_ids"],Object(T.Set)()).includes(n)}},function(e,t){var n=t.id;return{onToggle:function(t){e(Object(v.m)(n,t.target.checked))}}})(K),D=n(18),F=n(79),z=n(20);n.d(t,"default",function(){return A});var P=Object(j.f)({close:{id:"lightbox.close",defaultMessage:"Close"},placeholder:{id:"report.placeholder",defaultMessage:"Additional comments"},submit:{id:"report.submit",defaultMessage:"Submit"}}),A=Object(f.connect)(function(){var e=Object(O.d)();return function(t){var n=t.getIn(["reports","new","account_id"]);return{isSubmitting:t.getIn(["reports","new","isSubmitting"]),account:e(t,n),comment:t.getIn(["reports","new","comment"]),forward:t.getIn(["reports","new","forward"]),statusIds:Object(T.OrderedSet)(t.getIn(["timelines","account:"+n+":with_replies","items"])).union(t.getIn(["reports","new","status_ids"]))}}})(o=Object(j.g)((i=a=function(e){function t(){var n,o,a;c()(this,t);for(var i=arguments.length,r=Array(i),s=0;s<i;s++)r[s]=arguments[s];return n=o=u()(this,e.call.apply(e,[this].concat(r))),o.handleCommentChange=function(e){o.props.dispatch(Object(v.i)(e.target.value))},o.handleForwardChange=function(e){o.props.dispatch(Object(v.j)(e.target.checked))},o.handleSubmit=function(){o.props.dispatch(Object(v.l)())},o.handleKeyDown=function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&o.handleSubmit()},a=n,u()(o,a)}return h()(t,e),t.prototype.componentDidMount=function(){this.props.dispatch(Object(b.l)(this.props.account.get("id"),{withReplies:!0}))},t.prototype.componentWillReceiveProps=function(e){this.props.account!==e.account&&e.account&&this.props.dispatch(Object(b.l)(e.account.get("id"),{withReplies:!0}))},t.prototype.render=function(){var e=this.props,t=e.account,n=e.comment,o=e.intl,a=e.statusIds,i=e.isSubmitting,r=e.forward,d=e.onClose;if(!t)return null;var c=t.get("acct").split("@")[1];return s()("div",{className:"modal-root__modal report-modal"},void 0,s()("div",{className:"report-modal__target"},void 0,s()(z.a,{className:"media-modal__close",title:o.formatMessage(P.close),icon:"times",onClick:d,size:16}),s()(j.b,{id:"report.target",defaultMessage:"Report {target}",values:{target:s()("strong",{},void 0,t.get("acct"))}})),s()("div",{className:"report-modal__container"},void 0,s()("div",{className:"report-modal__comment"},void 0,s()("p",{},void 0,s()(j.b,{id:"report.hint",defaultMessage:"The report will be sent to your instance moderators. You can provide an explanation of why you are reporting this account below:"})),s()("textarea",{className:"setting-text light",placeholder:o.formatMessage(P.placeholder),value:n,onChange:this.handleCommentChange,onKeyDown:this.handleKeyDown,disabled:i}),c&&s()("div",{},void 0,s()("p",{},void 0,s()(j.b,{id:"report.forward_hint",defaultMessage:"The account is from another server. Send an anonymized copy of the report there as well?"})),s()("div",{className:"setting-toggle"},void 0,s()(I.a,{id:"report-forward",checked:r,disabled:i,onChange:this.handleForwardChange}),s()("label",{htmlFor:"report-forward",className:"setting-toggle__label"},void 0,s()(j.b,{id:"report.forward",defaultMessage:"Forward to {target}",values:{target:c}})))),s()(F.a,{disabled:i,text:o.formatMessage(P.submit),onClick:this.handleSubmit})),s()("div",{className:"report-modal__statuses"},void 0,s()("div",{},void 0,a.map(function(e){return s()(q,{id:e,disabled:i},e)})))))},t}(D.a),a.propTypes={isSubmitting:_.a.bool,account:C.a.map,statusIds:C.a.orderedSet.isRequired,comment:_.a.string.isRequired,forward:_.a.bool,dispatch:_.a.func.isRequired,intl:_.a.object.isRequired},o=i))||o)||o},757:function(e,t){e.exports=function(){}}}]);