pleroma/priv/static/packs/flavours/glitch/async/status.js
2019-06-26 21:06:28 +02:00

2 lines
26 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{646:function(e,t,a){"use strict";a.d(t,"a",function(){return R});var b=a(0),n=a(15),i=a(2),s=a(6),c=a(1),o=a(3),f=a.n(o),r=a(5),l=a.n(r),d=a(26),u=a.n(d),g=a(97),m=a(98),O=a(135),j=a(431),v=a(384),k=a(358),y=a(7),M=a(432),p=a(25),C=a(131),_=a(498),h=a(639),x=a(12),I=a.n(x),w=a(500),R=function(o){function e(){for(var s,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return s=o.call.apply(o,[this].concat(t))||this,Object(c.a)(Object(i.a)(s),"state",{height:null}),Object(c.a)(Object(i.a)(s),"handleAccountClick",function(e){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&s.context.router){e.preventDefault();var t=Object(n.a)({},s.context.router.history.location.state);t.mastodonBackSteps=(t.mastodonBackSteps||0)+1,s.context.router.history.push("/accounts/"+s.props.status.getIn(["account","id"]),t)}e.stopPropagation()}),Object(c.a)(Object(i.a)(s),"parseClick",function(e,t){if(0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&s.context.router){e.preventDefault();var a=Object(n.a)({},s.context.router.history.location.state);a.mastodonBackSteps=(a.mastodonBackSteps||0)+1,s.context.router.history.push(t,a)}e.stopPropagation()}),Object(c.a)(Object(i.a)(s),"handleOpenVideo",function(e,t){s.props.onOpenVideo(e,t)}),Object(c.a)(Object(i.a)(s),"setRef",function(e){s.node=e,s._measureHeight()}),Object(c.a)(Object(i.a)(s),"handleChildUpdate",function(){s._measureHeight()}),Object(c.a)(Object(i.a)(s),"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")}),s}Object(s.a)(e,o);var t=e.prototype;return t._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(h.a)(function(){return t.node&&t.setState({height:Math.ceil(t.node.scrollHeight)+1})}),this.props.onHeightChange&&e&&this.props.onHeightChange())},t.componentDidUpdate=function(e,t){this._measureHeight(t.height!==this.state.height)},t.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,s=t.onToggleHidden,o=t.settings,n={boxSizing:"border-box"},i=this.props.compact;if(!e)return null;var c="",r=null,l="",d="",u="retweet",p="";if(this.props.measureHeight&&(n.height=this.state.height+"px"),e.get("poll"))c=Object(b.a)(w.a,{pollId:e.get("poll")}),r="tasks";else if(0<e.get("media_attachments").size)if(e.get("media_attachments").some(function(e){return"unknown"===e.get("type")}))c=Object(b.a)(v.a,{media:e.get("media_attachments")});else if("video"===e.getIn(["media_attachments",0,"type"])){var h=e.getIn(["media_attachments",0]);c=Object(b.a)(C.default,{preview:h.get("preview_url"),src:h.get("url"),alt:h.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,revealed:!(!o.getIn(["media","reveal_behind_cw"])||!e.get("spoiler_text"))||void 0}),r="video-camera"}else c=Object(b.a)(j.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,revealed:!(!o.getIn(["media","reveal_behind_cw"])||!e.get("spoiler_text"))||void 0}),r="picture-o";else c=Object(b.a)(M.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)}),r="link";return e.get("application")&&(l=Object(b.a)("span",{},void 0," · ",Object(b.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")?u="envelope":"private"===e.get("visibility")&&(u="lock"),d="private"===e.get("visibility")?Object(b.a)("i",{className:"fa fa-"+u}):this.context.router?Object(b.a)(k.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(b.a)("i",{className:"fa fa-"+u}),Object(b.a)("span",{className:"detailed-status__reblogs"},void 0,Object(b.a)(y.c,{value:e.get("reblogs_count")}))):Object(b.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(b.a)("i",{className:"fa fa-"+u}),Object(b.a)("span",{className:"detailed-status__reblogs"},void 0,Object(b.a)(y.c,{value:e.get("reblogs_count")}))),p=this.context.router?Object(b.a)(k.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(b.a)("i",{className:"fa fa-star"}),Object(b.a)("span",{className:"detailed-status__favorites"},void 0,Object(b.a)(y.c,{value:e.get("favourites_count")}))):Object(b.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(b.a)("i",{className:"fa fa-star"}),Object(b.a)("span",{className:"detailed-status__favorites"},void 0,Object(b.a)(y.c,{value:e.get("favourites_count")}))),Object(b.a)("div",{style:n},void 0,f.a.createElement("div",{ref:this.setRef,className:I()("detailed-status",{compact:i}),"data-status-by":e.getIn(["account","acct"])},Object(b.a)("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,Object(b.a)("div",{className:"detailed-status__display-avatar"},void 0,Object(b.a)(g.a,{account:e.get("account"),size:48})),Object(b.a)(m.a,{account:e.get("account"),localDomain:this.props.domain})),Object(b.a)(O.a,{status:e,media:c,mediaIcon:r,expanded:a,collapsed:!1,onExpandedToggle:s,parseClick:this.parseClick,onUpdate:this.handleChildUpdate,disabled:!0}),Object(b.a)("div",{className:"detailed-status__meta"},void 0,Object(b.a)("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener"},void 0,Object(b.a)(y.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),l," · ",d," · ",p," · ",Object(b.a)(_.a,{visibility:e.get("visibility")}))))},e}(p.a);Object(c.a)(R,"contextTypes",{router:l.a.object}),Object(c.a)(R,"propTypes",{status:u.a.map,settings:u.a.map.isRequired,onOpenMedia:l.a.func.isRequired,onOpenVideo:l.a.func.isRequired,onToggleHidden:l.a.func,expanded:l.a.bool,measureHeight:l.a.bool,onHeightChange:l.a.func,domain:l.a.string.isRequired,compact:l.a.bool})},712:function(e,t,a){"use strict";a.r(t);var s,o,n,c=a(15),h=a(0),r=a(2),i=a(6),l=a(1),d=a(4),u=a.n(d),p=a(3),b=a.n(p),f=a(21),g=a(5),m=a.n(g),O=a(12),j=a.n(O),v=a(26),k=a.n(v),y=a(101),M=a(896),C=a(646),_=a(48),x=a(638),I=a(7),w=a(29),R=a(364),D=Object(I.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"}}),N=Object(I.g)((n=o=function(o){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=o.call.apply(o,[this].concat(t))||this,Object(l.a)(Object(r.a)(a),"handleReplyClick",function(){a.props.onReply(a.props.status)}),Object(l.a)(Object(r.a)(a),"handleReblogClick",function(e){a.props.onReblog(a.props.status,e)}),Object(l.a)(Object(r.a)(a),"handleFavouriteClick",function(e){a.props.onFavourite(a.props.status,e)}),Object(l.a)(Object(r.a)(a),"handleBookmarkClick",function(e){a.props.onBookmark(a.props.status,e)}),Object(l.a)(Object(r.a)(a),"handleDeleteClick",function(){a.props.onDelete(a.props.status,a.context.router.history)}),Object(l.a)(Object(r.a)(a),"handleRedraftClick",function(){a.props.onDelete(a.props.status,a.context.router.history,!0)}),Object(l.a)(Object(r.a)(a),"handleDirectClick",function(){a.props.onDirect(a.props.status.get("account"),a.context.router.history)}),Object(l.a)(Object(r.a)(a),"handleMentionClick",function(){a.props.onMention(a.props.status.get("account"),a.context.router.history)}),Object(l.a)(Object(r.a)(a),"handleMuteClick",function(){a.props.onMute(a.props.status.get("account"))}),Object(l.a)(Object(r.a)(a),"handleConversationMuteClick",function(){a.props.onMuteConversation(a.props.status)}),Object(l.a)(Object(r.a)(a),"handleBlockClick",function(){a.props.onBlock(a.props.status)}),Object(l.a)(Object(r.a)(a),"handleReport",function(){a.props.onReport(a.props.status)}),Object(l.a)(Object(r.a)(a),"handlePinClick",function(){a.props.onPin(a.props.status)}),Object(l.a)(Object(r.a)(a),"handleShare",function(){navigator.share({text:a.props.status.get("search_index"),url:a.props.status.get("url")})}),Object(l.a)(Object(r.a)(a),"handleEmbed",function(){a.props.onEmbed(a.props.status)}),Object(l.a)(Object(r.a)(a),"handleCopy",function(){var e=a.props.status.get("url"),t=document.createElement("textarea");t.textContent=e,t.style.position="fixed",document.body.appendChild(t);try{t.select(),document.execCommand("copy")}catch(e){}finally{document.body.removeChild(t)}}),a}return Object(i.a)(e,o),e.prototype.render=function(){var e=this.props,t=e.status,a=e.intl,s=["public","unlisted"].includes(t.get("visibility")),o=t.get("muted"),n=[];s&&(n.push({text:a.formatMessage(D.copy),action:this.handleCopy}),n.push({text:a.formatMessage(D.embed),action:this.handleEmbed}),n.push(null)),w.k===t.getIn(["account","id"])?(s&&n.push({text:a.formatMessage(t.get("pinned")?D.unpin:D.pin),action:this.handlePinClick}),n.push(null),n.push({text:a.formatMessage(o?D.unmuteConversation:D.muteConversation),action:this.handleConversationMuteClick}),n.push(null),n.push({text:a.formatMessage(D.delete),action:this.handleDeleteClick})):(n.push({text:a.formatMessage(D.mention,{name:t.getIn(["account","username"])}),action:this.handleMentionClick}),n.push({text:a.formatMessage(D.direct,{name:t.getIn(["account","username"])}),action:this.handleDirectClick}),n.push(null),n.push({text:a.formatMessage(D.mute,{name:t.getIn(["account","username"])}),action:this.handleMuteClick}),n.push({text:a.formatMessage(D.block,{name:t.getIn(["account","username"])}),action:this.handleBlockClick}),n.push({text:a.formatMessage(D.report,{name:t.getIn(["account","username"])}),action:this.handleReport}),w.h&&(R.a||R.e)&&(n.push(null),void 0!==R.a&&n.push({text:a.formatMessage(D.admin_account,{name:t.getIn(["account","username"])}),href:Object(R.a)(t.getIn(["account","id"]))}),void 0!==R.e&&n.push({text:a.formatMessage(D.admin_status),href:Object(R.e)(t.getIn(["account","id"]),t.get("id"))})));var i="share"in navigator&&"public"===t.get("visibility")&&Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(_.a,{title:a.formatMessage(D.share),icon:"share-alt",onClick:this.handleShare})),c="direct"===t.get("visibility")||"private"===t.get("visibility")&&w.k!==t.getIn(["account","id"]),r="private"===t.get("visibility")?D.reblog_private:D.reblog;return Object(h.a)("div",{className:"detailed-status__action-bar"},void 0,Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(_.a,{title:a.formatMessage(D.reply),icon:null===t.get("in_reply_to_id",null)?"reply":"reply-all",onClick:this.handleReplyClick})),Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(_.a,{disabled:c,active:t.get("reblogged"),title:c?a.formatMessage(D.cannot_reblog):a.formatMessage(r),icon:"retweet",onClick:this.handleReblogClick})),Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(_.a,{className:"star-icon",animate:!0,active:t.get("favourited"),title:a.formatMessage(D.favourite),icon:"star",onClick:this.handleFavouriteClick})),i,Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(_.a,{className:"bookmark-icon",active:t.get("bookmarked"),title:a.formatMessage(D.bookmark),icon:"bookmark",onClick:this.handleBookmarkClick})),Object(h.a)("div",{className:"detailed-status__action-bar-dropdown"},void 0,Object(h.a)(x.a,{size:18,icon:"ellipsis-h",items:n,direction:"left",ariaLabel:"More"})))},e}(b.a.PureComponent),Object(l.a)(o,"contextTypes",{router:m.a.object}),s=n))||s,B=a(625),H=a(49),E=a(19),S=a(363),A=a(23),T=a(134),F=a(93),z=a(191),U=a(427),P=function(o){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=o.call.apply(o,[this].concat(t))||this,Object(l.a)(Object(r.a)(a),"handleClick",function(e){if(window.history.state){var t=a.context.router.history.location.state;e.shiftKey&&t&&t.mastodonBackSteps?a.context.router.history.go(-t.mastodonBackSteps):a.context.router.history.goBack()}else a.context.router.history.push("/")}),a}return Object(i.a)(e,o),e.prototype.render=function(){return Object(h.a)("button",{onClick:this.handleClick,className:"column-back-button"},void 0,Object(h.a)("i",{className:"fa fa-fw fa-chevron-left column-back-button__icon"}),Object(h.a)(I.b,{id:"column_back_button.label",defaultMessage:"Back"}))},e}(b.a.PureComponent);Object(l.a)(P,"contextTypes",{router:m.a.object});var q,V,K,L,J=a(627),W=a(911),Y=a(50),G=a(25),Q=a(343),X=a(229),Z=a(641),$=a(768);a.d(t,"default",function(){return te});var ee=Object(I.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."},blockConfirm:{id:"confirmations.block.confirm",defaultMessage:"Block"},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?"},blockAndReport:{id:"confirmations.block.block_and_report",defaultMessage:"Block & Report"},tootHeading:{id:"column.toot",defaultMessage:"Toots and replies"}}),te=(q=Object(f.connect)(function(){var s=Object(z.f)();return function(o,e){var n=s(o,{id:e.params.statusId}),t=u.a.List(),a=u.a.List();return n&&(t=t.withMutations(function(e){for(var t=n.get("in_reply_to_id");t;)e.unshift(t),t=o.getIn(["contexts","inReplyTos",t])}),a=a.withMutations(function(e){for(var t=[n.get("id")];0<t.length;){var a=t.shift(),s=o.getIn(["contexts","replies",a]);n.get("id")!==a&&e.push(a),s&&s.reverse().forEach(function(e){t.unshift(e)})}})),{status:n,ancestorsIds:t,descendantsIds:a,settings:o.get("local_settings"),askReplyConfirmation:o.getIn(["local_settings","confirm_before_clearing_draft"])&&0!==o.getIn(["compose","text"]).trim().length,domain:o.getIn(["meta","domain"])}}}),Object(I.g)(V=q((L=K=function(s){function e(){for(var i,e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return i=s.call.apply(s,[this].concat(t))||this,Object(l.a)(Object(r.a)(i),"state",{fullscreen:!1,isExpanded:void 0,threadExpanded:void 0,statusId:void 0}),Object(l.a)(Object(r.a)(i),"handleExpandedToggle",function(){i.props.status.get("spoiler_text")&&i.setExpansion(!i.state.isExpanded)}),Object(l.a)(Object(r.a)(i),"handleModalFavourite",function(e){i.props.dispatch(Object(H.p)(e))}),Object(l.a)(Object(r.a)(i),"handleFavouriteClick",function(e,t){e.get("favourited")?i.props.dispatch(Object(H.v)(e)):t&&t.shiftKey||!w.g?i.handleModalFavourite(e):i.props.dispatch(Object(Y.d)("FAVOURITE",{status:e,onFavourite:i.handleModalFavourite}))}),Object(l.a)(Object(r.a)(i),"handlePin",function(e){e.get("pinned")?i.props.dispatch(Object(H.w)(e)):i.props.dispatch(Object(H.s)(e))}),Object(l.a)(Object(r.a)(i),"handleReplyClick",function(e){var t=i.props,a=t.askReplyConfirmation,s=t.dispatch,o=t.intl;s(a?Object(Y.d)("CONFIRM",{message:o.formatMessage(ee.replyMessage),confirm:o.formatMessage(ee.replyConfirm),onDoNotAsk:function(){return s(Object(S.b)(["confirm_before_clearing_draft"],!1))},onConfirm:function(){return s(Object(E.kb)(e,i.context.router.history))}}):Object(E.kb)(e,i.context.router.history))}),Object(l.a)(Object(r.a)(i),"handleModalReblog",function(e){i.props.dispatch(Object(H.t)(e))}),Object(l.a)(Object(r.a)(i),"handleReblogClick",function(e,t){e.get("reblogged")?i.props.dispatch(Object(H.x)(e)):t&&t.shiftKey||!w.b?i.handleModalReblog(e):i.props.dispatch(Object(Y.d)("BOOST",{status:e,onReblog:i.handleModalReblog}))}),Object(l.a)(Object(r.a)(i),"handleBookmarkClick",function(e){e.get("bookmarked")?i.props.dispatch(Object(H.u)(e)):i.props.dispatch(Object(H.o)(e))}),Object(l.a)(Object(r.a)(i),"handleDeleteClick",function(e,t,a){void 0===a&&(a=!1);var s=i.props,o=s.dispatch,n=s.intl;w.d?o(Object(Y.d)("CONFIRM",{message:n.formatMessage(a?ee.redraftMessage:ee.deleteMessage),confirm:n.formatMessage(a?ee.redraftConfirm:ee.deleteConfirm),onConfirm:function(){return o(Object(y.e)(e.get("id"),t,a))}})):o(Object(y.e)(e.get("id"),t,a))}),Object(l.a)(Object(r.a)(i),"handleDirectClick",function(e,t){i.props.dispatch(Object(E.bb)(e,t))}),Object(l.a)(Object(r.a)(i),"handleMentionClick",function(e,t){i.props.dispatch(Object(E.gb)(e,t))}),Object(l.a)(Object(r.a)(i),"handleOpenMedia",function(e,t){i.props.dispatch(Object(Y.d)("MEDIA",{media:e,index:t}))}),Object(l.a)(Object(r.a)(i),"handleOpenVideo",function(e,t){i.props.dispatch(Object(Y.d)("VIDEO",{media:e,time:t}))}),Object(l.a)(Object(r.a)(i),"handleMuteClick",function(e){i.props.dispatch(Object(T.g)(e))}),Object(l.a)(Object(r.a)(i),"handleConversationMuteClick",function(e){e.get("muted")?i.props.dispatch(Object(y.h)(e.get("id"))):i.props.dispatch(Object(y.g)(e.get("id")))}),Object(l.a)(Object(r.a)(i),"handleToggleAll",function(){var e=i.state.isExpanded;i.setState({isExpanded:!e,threadExpanded:!e})}),Object(l.a)(Object(r.a)(i),"handleBlockClick",function(e){var t=i.props,a=t.dispatch,s=t.intl,o=e.get("account");a(Object(Y.d)("CONFIRM",{message:Object(h.a)(I.b,{id:"confirmations.block.message",defaultMessage:"Are you sure you want to block {name}?",values:{name:Object(h.a)("strong",{},void 0,"@",o.get("acct"))}}),confirm:s.formatMessage(ee.blockConfirm),onConfirm:function(){return a(Object(A.z)(o.get("id")))},secondary:s.formatMessage(ee.blockAndReport),onSecondary:function(){a(Object(A.z)(o.get("id"))),a(Object(F.k)(o,e))}}))}),Object(l.a)(Object(r.a)(i),"handleReport",function(e){i.props.dispatch(Object(F.k)(e.get("account"),e))}),Object(l.a)(Object(r.a)(i),"handleEmbed",function(e){i.props.dispatch(Object(Y.d)("EMBED",{url:e.get("url")}))}),Object(l.a)(Object(r.a)(i),"handleHotkeyMoveUp",function(){i.handleMoveUp(i.props.status.get("id"))}),Object(l.a)(Object(r.a)(i),"handleHotkeyMoveDown",function(){i.handleMoveDown(i.props.status.get("id"))}),Object(l.a)(Object(r.a)(i),"handleHotkeyReply",function(e){e.preventDefault(),i.handleReplyClick(i.props.status)}),Object(l.a)(Object(r.a)(i),"handleHotkeyFavourite",function(){i.handleFavouriteClick(i.props.status)}),Object(l.a)(Object(r.a)(i),"handleHotkeyBoost",function(){i.handleReblogClick(i.props.status)}),Object(l.a)(Object(r.a)(i),"handleHotkeyBookmark",function(){i.handleBookmarkClick(i.props.status)}),Object(l.a)(Object(r.a)(i),"handleHotkeyMention",function(e){e.preventDefault(),i.handleMentionClick(i.props.status)}),Object(l.a)(Object(r.a)(i),"handleHotkeyOpenProfile",function(){var e=Object(c.a)({},i.context.router.history.location.state);e.mastodonBackSteps=(e.mastodonBackSteps||0)+1,i.context.router.history.push("/accounts/"+i.props.status.getIn(["account","id"]),e)}),Object(l.a)(Object(r.a)(i),"handleMoveUp",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,o=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size-1,!0);else{var n=s.indexOf(e);-1===n?(n=o.indexOf(e),i._selectChild(s.size+n,!0)):i._selectChild(n-1,!0)}}),Object(l.a)(Object(r.a)(i),"handleMoveDown",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,o=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size+1,!1);else{var n=s.indexOf(e);-1===n?(n=o.indexOf(e),i._selectChild(s.size+n+2,!1)):i._selectChild(n+1,!1)}}),Object(l.a)(Object(r.a)(i),"handleHeaderClick",function(){i.column.scrollTop()}),Object(l.a)(Object(r.a)(i),"setExpansion",function(e){i.setState({isExpanded:e})}),Object(l.a)(Object(r.a)(i),"setRef",function(e){i.node=e}),Object(l.a)(Object(r.a)(i),"setColumnRef",function(e){i.column=e}),Object(l.a)(Object(r.a)(i),"onFullScreenChange",function(){i.setState({fullscreen:Object(X.d)()})}),Object(l.a)(Object(r.a)(i),"shouldUpdateScroll",function(e,t){var a=t.location;return!(((e||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)}),i}Object(i.a)(e,s);var t=e.prototype;return t.componentDidMount=function(){Object(X.a)(this.onFullScreenChange),this.props.dispatch(Object(y.f)(this.props.params.statusId));var e=this.props,t=e.status,a=e.ancestorsIds;if(t&&a&&0<a.size){var s=this.node.querySelectorAll(".focusable")[a.size-1];window.requestAnimationFrame(function(){s.scrollIntoView(!0)})}},e.getDerivedStateFromProps=function(e,t){return t.statusId!==e.params.statusId&&e.params.statusId?(e.dispatch(Object(y.f)(e.params.statusId)),{threadExpanded:void 0,isExpanded:Object(Z.a)(e.settings,e.status),statusId:e.params.statusId}):null},t._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())},t.renderChildren=function(e){var t=this;return e.map(function(e){return Object(h.a)(W.a,{id:e,expanded:t.state.threadExpanded,onMoveUp:t.handleMoveUp,onMoveDown:t.handleMoveDown,contextType:"thread"},e)})},t.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&&0<s.size){var o=this.node.querySelectorAll(".focusable")[s.size-1];window.requestAnimationFrame(function(){o.scrollIntoView(!0)})}}},t.componentWillUnmount=function(){Object(X.b)(this.onFullScreenChange)},t.render=function(){this.setExpansion;var e,t,a=this.props,s=a.status,o=a.settings,n=a.ancestorsIds,i=a.descendantsIds,c=a.intl,r=a.domain,l=this.state,d=l.fullscreen,u=l.isExpanded;if(null===s)return Object(h.a)(B.a,{},void 0,Object(h.a)(P,{}),Object(h.a)(M.a,{}));n&&0<n.size&&(e=Object(h.a)("div",{},void 0,this.renderChildren(n))),i&&0<i.size&&(t=Object(h.a)("div",{},void 0,this.renderChildren(i)));var p={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};return b.a.createElement(B.a,{ref:this.setColumnRef,label:c.formatMessage(ee.detailedStatus)},Object(h.a)(J.a,{icon:"comment",title:c.formatMessage(ee.tootHeading),onClick:this.handleHeaderClick,showBackButton:!0,extraButton:Object(h.a)("button",{className:"column-header__button",title:c.formatMessage(u?ee.hideAll:ee.revealAll),"aria-label":c.formatMessage(u?ee.hideAll:ee.revealAll),onClick:this.handleToggleAll,"aria-pressed":u?"true":"false"},void 0,Object(h.a)("i",{className:"fa fa-"+(u?"eye":"eye-slash")}))}),Object(h.a)(U.a,{scrollKey:"thread",shouldUpdateScroll:this.shouldUpdateScroll},void 0,b.a.createElement("div",{className:j()("scrollable","detailed-status__wrapper",{fullscreen:d}),ref:this.setRef},e,Object(h.a)(Q.HotKeys,{handlers:p},void 0,Object(h.a)("div",{className:"focusable",tabIndex:"0","aria-label":Object($.b)(c,s,!1,!s.get("hidden"))},void 0,Object(h.a)(C.a,{status:s,settings:o,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,expanded:u,onToggleHidden:this.handleExpandedToggle,domain:r}),Object(h.a)(N,{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)))},e}(G.a),Object(l.a)(K,"contextTypes",{router:m.a.object}),Object(l.a)(K,"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}),V=L))||V)||V)}}]);
//# sourceMappingURL=status.js.map