pleroma/priv/static/packs/flavours/glitch/async/status.js
2020-01-22 16:00:23 +01:00

2 lines
27 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{689:function(e,t,a){"use strict";a.d(t,"a",function(){return B});var s=a(0),n=a(13),o=a(2),i=a(7),c=a(1),r=a(3),l=a.n(r),d=a(5),u=a.n(d),p=a(18),h=a.n(p),b=a(92),g=a(94),f=a(150),m=a(464),O=a(256),j=a(310),v=a(6),k=a(465),y=a(19),M=a(83),_=a(289),C=a(531),x=a(677),I=a(10),w=a.n(I),R=a(533),D=a(25),B=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return t=e.call.apply(e,[this].concat(s))||this,Object(c.a)(Object(o.a)(t),"state",{height:null}),Object(c.a)(Object(o.a)(t),"handleAccountClick",function(e){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&t.context.router){e.preventDefault();var a=Object(n.default)({},t.context.router.history.location.state);a.mastodonBackSteps=(a.mastodonBackSteps||0)+1,t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]),a)}e.stopPropagation()}),Object(c.a)(Object(o.a)(t),"parseClick",function(e,a){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&t.context.router){e.preventDefault();var s=Object(n.default)({},t.context.router.history.location.state);s.mastodonBackSteps=(s.mastodonBackSteps||0)+1,t.context.router.history.push(a,s)}e.stopPropagation()}),Object(c.a)(Object(o.a)(t),"handleOpenVideo",function(e,a){t.props.onOpenVideo(e,a)}),Object(c.a)(Object(o.a)(t),"setRef",function(e){t.node=e,t._measureHeight()}),Object(c.a)(Object(o.a)(t),"handleChildUpdate",function(){t._measureHeight()}),Object(c.a)(Object(o.a)(t),"handleModalLink",function(e){var t;e.preventDefault(),t="A"!==e.target.nodeName?e.target.parentNode.href:e.target.href,window.open(t,"mastodon-intent","width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes")}),t}Object(i.a)(t,e);var a=t.prototype;return a._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(x.a)(function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})}),this.props.onHeightChange&&e&&this.props.onHeightChange())},a.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},a.render=function(){var e=this.props.status&&this.props.status.get("reblog")?this.props.status.get("reblog"):this.props.status,t=this.props,a=t.expanded,n=t.onToggleHidden,o=t.settings,i={boxSizing:"border-box"},c=this.props.compact;if(!e)return null;var r=null,d=null,u="",p="",h="retweet",y="";if(this.props.measureHeight&&(i.height=this.state.height+"px"),e.get("poll"))r=Object(s.a)(R.a,{pollId:e.get("poll")}),d="tasks";else if(e.get("media_attachments").size>0)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))r=Object(s.a)(O.a,{media:e.get("media_attachments")});else if("audio"===e.getIn(["media_attachments",0,"type"])){var x=e.getIn(["media_attachments",0]);r=Object(s.a)(_.default,{src:x.get("url"),alt:x.get("description"),duration:x.getIn(["meta","original","duration"],0),height:110,preload:!0}),d="music"}else if("video"===e.getIn(["media_attachments",0,"type"])){var I=e.getIn(["media_attachments",0]);r=Object(s.a)(M.default,{preview:I.get("preview_url"),blurhash:I.get("blurhash"),src:I.get("url"),alt:I.get("description"),inline:!0,sensitive:e.get("sensitive"),letterbox:o.getIn(["media","letterbox"]),fullwidth:o.getIn(["media","fullwidth"]),preventPlayback:!a,onOpenVideo:this.handleOpenVideo,autoplay:!0,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="video-camera"}else r=Object(s.a)(m.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),letterbox:o.getIn(["media","letterbox"]),fullwidth:o.getIn(["media","fullwidth"]),hidden:!a,onOpenMedia:this.props.onOpenMedia,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="picture-o";else e.get("card")&&(r=Object(s.a)(k.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card")}),d="link");return e.get("application")&&(u=Object(s.a)("span",{},void 0," · ",Object(s.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?h="envelope":"private"===e.get("visibility")&&(h="lock"),p="private"===e.get("visibility")?Object(s.a)(D.a,{id:h}):this.context.router?Object(s.a)(j.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(s.a)(D.a,{id:h}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(v.c,{value:e.get("reblogs_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(D.a,{id:h}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(v.c,{value:e.get("reblogs_count")}))),y=this.context.router?Object(s.a)(j.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(s.a)(D.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void 0,Object(s.a)(v.c,{value:e.get("favourites_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(D.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void 0,Object(s.a)(v.c,{value:e.get("favourites_count")}))),Object(s.a)("div",{style:i},void 0,l.a.createElement("div",{ref:this.setRef,className:w()("detailed-status",{compact:c}),"data-status-by":e.getIn(["account","acct"])},Object(s.a)("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,Object(s.a)("div",{className:"detailed-status__display-avatar"},void 0,Object(s.a)(b.a,{account:e.get("account"),size:48})),Object(s.a)(g.a,{account:e.get("account"),localDomain:this.props.domain})),Object(s.a)(f.a,{status:e,media:r,mediaIcon:d,expanded:a,collapsed:!1,onExpandedToggle:n,parseClick:this.parseClick,onUpdate:this.handleChildUpdate,tagLinks:o.get("tag_misleading_links"),rewriteMentions:o.get("rewrite_mentions"),disabled:!0}),Object(s.a)("div",{className:"detailed-status__meta"},void 0,Object(s.a)("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener"},void 0,Object(s.a)(v.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),u," · ",p," · ",y," · ",Object(s.a)(C.a,{visibility:e.get("visibility")}))))},t}(y.a);Object(c.a)(B,"contextTypes",{router:u.a.object}),Object(c.a)(B,"propTypes",{status:h.a.map,settings:h.a.map.isRequired,onOpenMedia:u.a.func.isRequired,onOpenVideo:u.a.func.isRequired,onToggleHidden:u.a.func,expanded:u.a.bool,measureHeight:u.a.bool,onHeightChange:u.a.func,domain:u.a.string.isRequired,compact:u.a.bool,showMedia:u.a.bool,onToggleMediaVisibility:u.a.func})},750:function(e,t,a){"use strict";a.r(t);var s,n,o,i=a(0),c=a(13),r=a(2),l=a(7),d=a(1),u=a(4),p=a.n(u),h=a(3),b=a.n(h),g=a(12),f=a(5),m=a.n(f),O=a(10),j=a.n(O),v=a(18),k=a.n(v),y=a(53),M=a(109),_=a(969),C=a(689),x=a(40),I=a(673),w=a(6),R=a(15),D=a(144),B=Object(w.f)({delete:{id:"status.delete",defaultMessage:"Delete"},redraft:{id:"status.redraft",defaultMessage:"Delete & re-draft"},direct:{id:"status.direct",defaultMessage:"Direct message @{name}"},mention:{id:"status.mention",defaultMessage:"Mention @{name}"},reply:{id:"status.reply",defaultMessage:"Reply"},reblog:{id:"status.reblog",defaultMessage:"Boost"},reblog_private:{id:"status.reblog_private",defaultMessage:"Boost to original audience"},cannot_reblog:{id:"status.cannot_reblog",defaultMessage:"This post cannot be boosted"},favourite:{id:"status.favourite",defaultMessage:"Favourite"},bookmark:{id:"status.bookmark",defaultMessage:"Bookmark"},mute:{id:"status.mute",defaultMessage:"Mute @{name}"},muteConversation:{id:"status.mute_conversation",defaultMessage:"Mute conversation"},unmuteConversation:{id:"status.unmute_conversation",defaultMessage:"Unmute conversation"},block:{id:"status.block",defaultMessage:"Block @{name}"},report:{id:"status.report",defaultMessage:"Report @{name}"},share:{id:"status.share",defaultMessage:"Share"},pin:{id:"status.pin",defaultMessage:"Pin on profile"},unpin:{id:"status.unpin",defaultMessage:"Unpin from profile"},embed:{id:"status.embed",defaultMessage:"Embed"},admin_account:{id:"status.admin_account",defaultMessage:"Open moderation interface for @{name}"},admin_status:{id:"status.admin_status",defaultMessage:"Open this status in the moderation interface"},copy:{id:"status.copy",defaultMessage:"Copy link to status"}}),S=Object(w.g)((o=n=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),n=0;n<a;n++)s[n]=arguments[n];return t=e.call.apply(e,[this].concat(s))||this,Object(d.a)(Object(r.a)(t),"handleReplyClick",function(){t.props.onReply(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleReblogClick",function(e){t.props.onReblog(t.props.status,e)}),Object(d.a)(Object(r.a)(t),"handleFavouriteClick",function(e){t.props.onFavourite(t.props.status,e)}),Object(d.a)(Object(r.a)(t),"handleBookmarkClick",function(e){t.props.onBookmark(t.props.status,e)}),Object(d.a)(Object(r.a)(t),"handleDeleteClick",function(){t.props.onDelete(t.props.status,t.context.router.history)}),Object(d.a)(Object(r.a)(t),"handleRedraftClick",function(){t.props.onDelete(t.props.status,t.context.router.history,!0)}),Object(d.a)(Object(r.a)(t),"handleDirectClick",function(){t.props.onDirect(t.props.status.get("account"),t.context.router.history)}),Object(d.a)(Object(r.a)(t),"handleMentionClick",function(){t.props.onMention(t.props.status.get("account"),t.context.router.history)}),Object(d.a)(Object(r.a)(t),"handleMuteClick",function(){t.props.onMute(t.props.status.get("account"))}),Object(d.a)(Object(r.a)(t),"handleConversationMuteClick",function(){t.props.onMuteConversation(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleBlockClick",function(){t.props.onBlock(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleReport",function(){t.props.onReport(t.props.status)}),Object(d.a)(Object(r.a)(t),"handlePinClick",function(){t.props.onPin(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleShare",function(){navigator.share({text:t.props.status.get("search_index"),url:t.props.status.get("url")})}),Object(d.a)(Object(r.a)(t),"handleEmbed",function(){t.props.onEmbed(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleCopy",function(){var e=t.props.status.get("url"),a=document.createElement("textarea");a.textContent=e,a.style.position="fixed",document.body.appendChild(a);try{a.select(),document.execCommand("copy")}catch(e){}finally{document.body.removeChild(a)}}),t}return Object(l.a)(t,e),t.prototype.render=function(){var e=this.props,t=e.status,a=e.intl,s=["public","unlisted"].includes(t.get("visibility")),n=t.get("muted"),o=[];s&&(o.push({text:a.formatMessage(B.copy),action:this.handleCopy}),o.push({text:a.formatMessage(B.embed),action:this.handleEmbed}),o.push(null)),R.m===t.getIn(["account","id"])?(s&&o.push({text:a.formatMessage(t.get("pinned")?B.unpin:B.pin),action:this.handlePinClick}),o.push(null),o.push({text:a.formatMessage(n?B.unmuteConversation:B.muteConversation),action:this.handleConversationMuteClick}),o.push(null),o.push({text:a.formatMessage(B.delete),action:this.handleDeleteClick})):(o.push({text:a.formatMessage(B.mention,{name:t.getIn(["account","username"])}),action:this.handleMentionClick}),o.push({text:a.formatMessage(B.direct,{name:t.getIn(["account","username"])}),action:this.handleDirectClick}),o.push(null),o.push({text:a.formatMessage(B.mute,{name:t.getIn(["account","username"])}),action:this.handleMuteClick}),o.push({text:a.formatMessage(B.block,{name:t.getIn(["account","username"])}),action:this.handleBlockClick}),o.push({text:a.formatMessage(B.report,{name:t.getIn(["account","username"])}),action:this.handleReport}),R.j&&(D.a||D.g)&&(o.push(null),void 0!==D.a&&o.push({text:a.formatMessage(B.admin_account,{name:t.getIn(["account","username"])}),href:Object(D.a)(t.getIn(["account","id"]))}),void 0!==D.g&&o.push({text:a.formatMessage(B.admin_status),href:Object(D.g)(t.getIn(["account","id"]),t.get("id"))})));var c="share"in navigator&&"public"===t.get("visibility")&&Object(i.a)("div",{className:"detailed-status__button"},void 0,Object(i.a)(x.a,{title:a.formatMessage(B.share),icon:"share-alt",onClick:this.handleShare})),r="direct"===t.get("visibility")||"private"===t.get("visibility")&&R.m!==t.getIn(["account","id"]),l="private"===t.get("visibility")?B.reblog_private:B.reblog;return Object(i.a)("div",{className:"detailed-status__action-bar"},void 0,Object(i.a)("div",{className:"detailed-status__button"},void 0,Object(i.a)(x.a,{title:a.formatMessage(B.reply),icon:null===t.get("in_reply_to_id",null)?"reply":"reply-all",onClick:this.handleReplyClick})),Object(i.a)("div",{className:"detailed-status__button"},void 0,Object(i.a)(x.a,{disabled:r,active:t.get("reblogged"),title:r?a.formatMessage(B.cannot_reblog):a.formatMessage(l),icon:"retweet",onClick:this.handleReblogClick})),Object(i.a)("div",{className:"detailed-status__button"},void 0,Object(i.a)(x.a,{className:"star-icon",animate:!0,active:t.get("favourited"),title:a.formatMessage(B.favourite),icon:"star",onClick:this.handleFavouriteClick})),c,Object(i.a)("div",{className:"detailed-status__button"},void 0,Object(i.a)(x.a,{className:"bookmark-icon",active:t.get("bookmarked"),title:a.formatMessage(B.bookmark),icon:"bookmark",onClick:this.handleBookmarkClick})),Object(i.a)("div",{className:"detailed-status__action-bar-dropdown"},void 0,Object(i.a)(I.a,{size:18,icon:"ellipsis-h",items:o,direction:"left",ariaLabel:"More"})))},t}(b.a.PureComponent),Object(d.a)(n,"contextTypes",{router:m.a.object}),s=o))||s,H=a(662),T=a(49),E=a(16),N=a(297),A=a(117),F=a(219),V=a(98),U=a(148),z=a(460),P=a(25),q=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),n=0;n<a;n++)s[n]=arguments[n];return t=e.call.apply(e,[this].concat(s))||this,Object(d.a)(Object(r.a)(t),"handleClick",function(e){if(window.history.state){var a=t.context.router.history.location.state;e.shiftKey&&a&&a.mastodonBackSteps?t.context.router.history.go(-a.mastodonBackSteps):t.context.router.history.goBack()}else t.context.router.history.push("/")}),t}return Object(l.a)(t,e),t.prototype.render=function(){return Object(i.a)("button",{onClick:this.handleClick,className:"column-back-button"},void 0,Object(i.a)(P.a,{id:"chevron-left",className:"column-back-button__icon",fixedWidth:!0}),Object(i.a)(w.b,{id:"column_back_button.label",defaultMessage:"Back"}))},t}(b.a.PureComponent);Object(d.a)(q,"contextTypes",{router:m.a.object});var K,L,W,J,Y=a(664),G=a(999),Q=a(42),X=a(19),Z=a(287),$=a(251),ee=a(682),te=a(829);a.d(t,"default",function(){return se});var ae=Object(w.f)({deleteConfirm:{id:"confirmations.delete.confirm",defaultMessage:"Delete"},deleteMessage:{id:"confirmations.delete.message",defaultMessage:"Are you sure you want to delete this status?"},redraftConfirm:{id:"confirmations.redraft.confirm",defaultMessage:"Delete & redraft"},redraftMessage:{id:"confirmations.redraft.message",defaultMessage:"Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it."},revealAll:{id:"status.show_more_all",defaultMessage:"Show more for all"},hideAll:{id:"status.show_less_all",defaultMessage:"Show less for all"},detailedStatus:{id:"status.detailed_status",defaultMessage:"Detailed conversation view"},replyConfirm:{id:"confirmations.reply.confirm",defaultMessage:"Reply"},replyMessage:{id:"confirmations.reply.message",defaultMessage:"Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?"},tootHeading:{id:"column.toot",defaultMessage:"Toots and replies"}}),se=(K=Object(g.connect)(function(){var e=Object(U.f)(),t=Object(y.a)([function(e,t){return t.id},function(e){return e.getIn(["contexts","inReplyTos"])}],function(e,t){var a=p.a.List();return a=a.withMutations(function(a){for(var s=e;s;)a.unshift(s),s=t.get(s)})}),a=Object(y.a)([function(e,t){return t.id},function(e){return e.getIn(["contexts","replies"])},function(e){return e.get("statuses")}],function(e,t,a){for(var s=[],n=[e];n.length>0;){var o=n.shift(),i=t.get(o);e!==o&&s.push(o),i&&i.reverse().forEach(function(e){n.unshift(e)})}var c=s.findIndex(function(e){return a.get(e).get("in_reply_to_account_id")!==a.get(e).get("account")});return-1!==c&&s.forEach(function(e,t){t>c&&a.get(e).get("in_reply_to_account_id")===a.get(e).get("account")&&(s.splice(t,1),s.splice(c,0,e),c+=1)}),p.a.List(s)});return function(s,n){var o=e(s,{id:n.params.statusId}),i=p.a.List(),c=p.a.List();return o&&(i=t(s,{id:o.get("in_reply_to_id")}),c=a(s,{id:o.get("id")})),{status:o,ancestorsIds:i,descendantsIds:c,settings:s.get("local_settings"),askReplyConfirmation:s.getIn(["local_settings","confirm_before_clearing_draft"])&&0!==s.getIn(["compose","text"]).trim().length,domain:s.getIn(["meta","domain"])}}}),Object(w.g)(L=K((J=W=function(e){function t(){for(var t,a=arguments.length,s=new Array(a),n=0;n<a;n++)s[n]=arguments[n];return t=e.call.apply(e,[this].concat(s))||this,Object(d.a)(Object(r.a)(t),"state",{fullscreen:!1,isExpanded:void 0,threadExpanded:void 0,statusId:void 0,loadedStatusId:void 0,showMedia:void 0,revealBehindCW:void 0}),Object(d.a)(Object(r.a)(t),"handleExpandedToggle",function(){t.props.status.get("spoiler_text")&&t.setExpansion(!t.state.isExpanded)}),Object(d.a)(Object(r.a)(t),"handleToggleMediaVisibility",function(){t.setState({showMedia:!t.state.showMedia})}),Object(d.a)(Object(r.a)(t),"handleModalFavourite",function(e){t.props.dispatch(Object(T.p)(e))}),Object(d.a)(Object(r.a)(t),"handleFavouriteClick",function(e,a){e.get("favourited")?t.props.dispatch(Object(T.v)(e)):a&&a.shiftKey||!R.h?t.handleModalFavourite(e):t.props.dispatch(Object(Q.d)("FAVOURITE",{status:e,onFavourite:t.handleModalFavourite}))}),Object(d.a)(Object(r.a)(t),"handlePin",function(e){e.get("pinned")?t.props.dispatch(Object(T.w)(e)):t.props.dispatch(Object(T.s)(e))}),Object(d.a)(Object(r.a)(t),"handleReplyClick",function(e){var a=t.props,s=a.askReplyConfirmation,n=a.dispatch,o=a.intl;n(s?Object(Q.d)("CONFIRM",{message:o.formatMessage(ae.replyMessage),confirm:o.formatMessage(ae.replyConfirm),onDoNotAsk:function(){return n(Object(N.b)(["confirm_before_clearing_draft"],!1))},onConfirm:function(){return n(Object(E.lb)(e,t.context.router.history))}}):Object(E.lb)(e,t.context.router.history))}),Object(d.a)(Object(r.a)(t),"handleModalReblog",function(e){var a=t.props.dispatch;e.get("reblogged")?a(Object(T.x)(e)):a(Object(T.t)(e))}),Object(d.a)(Object(r.a)(t),"handleReblogClick",function(e,a){var s=t.props,n=s.settings,o=s.dispatch;n.get("confirm_boost_missing_media_description")&&e.get("media_attachments").some(function(e){return!e.get("description")})&&!e.get("reblogged")?o(Object(Q.d)("BOOST",{status:e,onReblog:t.handleModalReblog,missingMediaDescription:!0})):a&&a.shiftKey||!R.b?t.handleModalReblog(e):o(Object(Q.d)("BOOST",{status:e,onReblog:t.handleModalReblog}))}),Object(d.a)(Object(r.a)(t),"handleBookmarkClick",function(e){e.get("bookmarked")?t.props.dispatch(Object(T.u)(e)):t.props.dispatch(Object(T.o)(e))}),Object(d.a)(Object(r.a)(t),"handleDeleteClick",function(e,a,s){void 0===s&&(s=!1);var n=t.props,o=n.dispatch,i=n.intl;R.e?o(Object(Q.d)("CONFIRM",{message:i.formatMessage(s?ae.redraftMessage:ae.deleteMessage),confirm:i.formatMessage(s?ae.redraftConfirm:ae.deleteConfirm),onConfirm:function(){return o(Object(M.e)(e.get("id"),a,s))}})):o(Object(M.e)(e.get("id"),a,s))}),Object(d.a)(Object(r.a)(t),"handleDirectClick",function(e,a){t.props.dispatch(Object(E.bb)(e,a))}),Object(d.a)(Object(r.a)(t),"handleMentionClick",function(e,a){t.props.dispatch(Object(E.hb)(e,a))}),Object(d.a)(Object(r.a)(t),"handleOpenMedia",function(e,a){t.props.dispatch(Object(Q.d)("MEDIA",{media:e,index:a}))}),Object(d.a)(Object(r.a)(t),"handleOpenVideo",function(e,a){t.props.dispatch(Object(Q.d)("VIDEO",{media:e,time:a}))}),Object(d.a)(Object(r.a)(t),"handleMuteClick",function(e){t.props.dispatch(Object(A.g)(e))}),Object(d.a)(Object(r.a)(t),"handleConversationMuteClick",function(e){e.get("muted")?t.props.dispatch(Object(M.j)(e.get("id"))):t.props.dispatch(Object(M.h)(e.get("id")))}),Object(d.a)(Object(r.a)(t),"handleToggleAll",function(){var e=t.state.isExpanded;t.setState({isExpanded:!e,threadExpanded:!e})}),Object(d.a)(Object(r.a)(t),"handleBlockClick",function(e){var a=t.props.dispatch,s=e.get("account");a(Object(F.f)(s))}),Object(d.a)(Object(r.a)(t),"handleReport",function(e){t.props.dispatch(Object(V.k)(e.get("account"),e))}),Object(d.a)(Object(r.a)(t),"handleEmbed",function(e){t.props.dispatch(Object(Q.d)("EMBED",{url:e.get("url")}))}),Object(d.a)(Object(r.a)(t),"handleHotkeyToggleSensitive",function(){t.handleToggleMediaVisibility()}),Object(d.a)(Object(r.a)(t),"handleHotkeyMoveUp",function(){t.handleMoveUp(t.props.status.get("id"))}),Object(d.a)(Object(r.a)(t),"handleHotkeyMoveDown",function(){t.handleMoveDown(t.props.status.get("id"))}),Object(d.a)(Object(r.a)(t),"handleHotkeyReply",function(e){e.preventDefault(),t.handleReplyClick(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleHotkeyFavourite",function(){t.handleFavouriteClick(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleHotkeyBoost",function(){t.handleReblogClick(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleHotkeyBookmark",function(){t.handleBookmarkClick(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleHotkeyMention",function(e){e.preventDefault(),t.handleMentionClick(t.props.status)}),Object(d.a)(Object(r.a)(t),"handleHotkeyOpenProfile",function(){var e=Object(c.default)({},t.context.router.history.location.state);e.mastodonBackSteps=(e.mastodonBackSteps||0)+1,t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]),e)}),Object(d.a)(Object(r.a)(t),"handleMoveUp",function(e){var a=t.props,s=a.status,n=a.ancestorsIds,o=a.descendantsIds;if(e===s.get("id"))t._selectChild(n.size-1,!0);else{var i=n.indexOf(e);-1===i?(i=o.indexOf(e),t._selectChild(n.size+i,!0)):t._selectChild(i-1,!0)}}),Object(d.a)(Object(r.a)(t),"handleMoveDown",function(e){var a=t.props,s=a.status,n=a.ancestorsIds,o=a.descendantsIds;if(e===s.get("id"))t._selectChild(n.size+1,!1);else{var i=n.indexOf(e);-1===i?(i=o.indexOf(e),t._selectChild(n.size+i+2,!1)):t._selectChild(i+1,!1)}}),Object(d.a)(Object(r.a)(t),"handleHeaderClick",function(){t.column.scrollTop()}),Object(d.a)(Object(r.a)(t),"setExpansion",function(e){t.setState({isExpanded:e})}),Object(d.a)(Object(r.a)(t),"setRef",function(e){t.node=e}),Object(d.a)(Object(r.a)(t),"setColumnRef",function(e){t.column=e}),Object(d.a)(Object(r.a)(t),"onFullScreenChange",function(){t.setState({fullscreen:Object($.d)()})}),Object(d.a)(Object(r.a)(t),"shouldUpdateScroll",function(e,t){var a=t.location;return!(((e||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)}),t}Object(l.a)(t,e);var a=t.prototype;return a.componentDidMount=function(){Object($.a)(this.onFullScreenChange),this.props.dispatch(Object(M.f)(this.props.params.statusId));var e=this.props,t=e.status,a=e.ancestorsIds;if(t&&a&&a.size>0){var s=this.node.querySelectorAll(".focusable")[a.size-1];window.requestAnimationFrame(function(){s.scrollIntoView(!0)})}},t.getDerivedStateFromProps=function(e,t){var a={},s=!1;e.params.statusId&&t.statusId!==e.params.statusId&&(e.dispatch(Object(M.f)(e.params.statusId)),a.threadExpanded=void 0,a.statusId=e.params.statusId,s=!0);var n=e.settings.getIn(["media","reveal_behind_cw"]);return n!==t.revealBehindCW&&(a.revealBehindCW=n,n&&(a.showMedia=Object(te.b)(e.status,e.settings)),s=!0),e.status&&t.loadedStatusId!==e.status.get("id")&&(a.showMedia=Object(te.b)(e.status,e.settings),a.loadedStatusId=e.status.get("id"),a.isExpanded=Object(ee.a)(e.settings,e.status),s=!0),s?a:null},a._selectChild=function(e,t){var a=this.node,s=a.querySelectorAll(".focusable")[e];s&&(t&&a.scrollTop>s.offsetTop?s.scrollIntoView(!0):!t&&a.scrollTop+a.clientHeight<s.offsetTop+s.offsetHeight&&s.scrollIntoView(!1),s.focus())},a.renderChildren=function(e){var t=this;return e.map(function(e){return Object(i.a)(G.a,{id:e,expanded:t.state.threadExpanded,onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown,contextType:"thread"},e)})},a.componentDidUpdate=function(e){if(this.props.params.statusId&&(this.props.params.statusId!==e.params.statusId||e.ancestorsIds.size<this.props.ancestorsIds.size)){var t=this.props,a=t.status,s=t.ancestorsIds;if(a&&s&&s.size>0){var n=this.node.querySelectorAll(".focusable")[s.size-1];window.requestAnimationFrame(function(){n.scrollIntoView(!0)})}}},a.componentWillUnmount=function(){Object($.b)(this.onFullScreenChange)},a.render=function(){this.setExpansion;var e,t,a=this.props,s=a.status,n=a.settings,o=a.ancestorsIds,c=a.descendantsIds,r=a.intl,l=a.domain,d=this.state,u=d.fullscreen,p=d.isExpanded;if(null===s)return Object(i.a)(H.a,{},void 0,Object(i.a)(q,{}),Object(i.a)(_.a,{}));o&&o.size>0&&(e=Object(i.a)("div",{},void 0,this.renderChildren(o))),c&&c.size>0&&(t=Object(i.a)("div",{},void 0,this.renderChildren(c)));var h={moveUp:this.handleHotkeyMoveUp,moveDown:this.handleHotkeyMoveDown,reply:this.handleHotkeyReply,favourite:this.handleHotkeyFavourite,boost:this.handleHotkeyBoost,bookmark:this.handleHotkeyBookmark,mention:this.handleHotkeyMention,openProfile:this.handleHotkeyOpenProfile,toggleSpoiler:this.handleExpandedToggle,toggleSensitive:this.handleHotkeyToggleSensitive};return b.a.createElement(H.a,{ref:this.setColumnRef,label:r.formatMessage(ae.detailedStatus)},Object(i.a)(Y.a,{icon:"comment",title:r.formatMessage(ae.tootHeading),onClick:this.handleHeaderClick,showBackButton:!0,extraButton:Object(i.a)("button",{className:"column-header__button",title:r.formatMessage(p?ae.hideAll:ae.revealAll),"aria-label":r.formatMessage(p?ae.hideAll:ae.revealAll),onClick:this.handleToggleAll,"aria-pressed":p?"true":"false"},void 0,Object(i.a)(P.a,{id:s.get("hidden")?"eye-slash":"eye"}))}),Object(i.a)(z.a,{scrollKey:"thread",shouldUpdateScroll:this.shouldUpdateScroll},void 0,b.a.createElement("div",{className:j()("scrollable","detailed-status__wrapper",{fullscreen:u}),ref:this.setRef},e,Object(i.a)(Z.HotKeys,{handlers:h},void 0,Object(i.a)("div",{className:"focusable",tabIndex:"0","aria-label":Object(te.c)(r,s,!1,!s.get("hidden"))},void 0,Object(i.a)(C.a,{status:s,settings:n,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,expanded:p,onToggleHidden:this.handleExpandedToggle,domain:l,showMedia:this.state.showMedia,onToggleMediaVisibility:this.handleToggleMediaVisibility}),Object(i.a)(S,{status:s,onReply:this.handleReplyClick,onFavourite:this.handleFavouriteClick,onReblog:this.handleReblogClick,onBookmark:this.handleBookmarkClick,onDelete:this.handleDeleteClick,onDirect:this.handleDirectClick,onMention:this.handleMentionClick,onMute:this.handleMuteClick,onMuteConversation:this.handleConversationMuteClick,onBlock:this.handleBlockClick,onReport:this.handleReport,onPin:this.handlePin,onEmbed:this.handleEmbed}))),t)))},t}(X.a),Object(d.a)(W,"contextTypes",{router:m.a.object}),Object(d.a)(W,"propTypes",{params:m.a.object.isRequired,dispatch:m.a.func.isRequired,status:k.a.map,settings:k.a.map.isRequired,ancestorsIds:k.a.list,descendantsIds:k.a.list,intl:m.a.object.isRequired,askReplyConfirmation:m.a.bool,domain:m.a.string.isRequired}),L=J))||L)||L)}}]);
//# sourceMappingURL=status.js.map