Pleroma/priv/static/packs/flavours/glitch/async/status.js

2 lines
24 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{645:function(e,t,a){"use strict";a.d(t,"a",function(){return w});var b=a(0),o=a(3),s=a(7),i=a(1),n=a(2),f=a.n(n),c=a(5),r=a.n(c),l=a(27),d=a.n(l),g=a(102),m=a(103),O=a(137),j=a(430),v=a(383),k=a(358),M=a(6),y=a(431),u=a(25),C=a(132),_=a(497),p=a(637),h=a(12),x=a.n(h),I=a(499),w=function(n){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=n.call.apply(n,[this].concat(t))||this,Object(i.a)(Object(o.a)(a),"state",{height:null}),Object(i.a)(Object(o.a)(a),"handleAccountClick",function(e){0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&a.context.router&&(e.preventDefault(),a.context.router.history.push("/accounts/"+a.props.status.getIn(["account","id"]))),e.stopPropagation()}),Object(i.a)(Object(o.a)(a),"parseClick",function(e,t){0===e.button&&!(e.ctrlKey||e.altKey||e.metaKey)&&a.context.router&&(e.preventDefault(),a.context.router.history.push(t)),e.stopPropagation()}),Object(i.a)(Object(o.a)(a),"handleOpenVideo",function(e,t){a.props.onOpenVideo(e,t)}),Object(i.a)(Object(o.a)(a),"setRef",function(e){a.node=e,a._measureHeight()}),Object(i.a)(Object(o.a)(a),"handleChildUpdate",function(){a._measureHeight()}),Object(i.a)(Object(o.a)(a),"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")}),a}Object(s.a)(e,n);var t=e.prototype;return t._measureHeight=function(e){var t=this;this.props.measureHeight&&this.node&&(Object(p.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,n=t.settings,o={boxSizing:"border-box"},i=this.props.compact;if(!e)return null;var c="",r=null,l="",d="",u="retweet",p="";if(this.props.measureHeight&&(o.height=this.state.height+"px"),e.get("poll"))c=Object(b.a)(I.a,{pollId:e.get("poll")});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:n.getIn(["media","letterbox"]),fullwidth:n.getIn(["media","fullwidth"]),preventPlayback:!a,onOpenVideo:this.handleOpenVideo,autoplay:!0,revealed:!(!n.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:n.getIn(["media","letterbox"]),fullwidth:n.getIn(["media","fullwidth"]),hidden:!a,onOpenMedia:this.props.onOpenMedia,revealed:!(!n.getIn(["media","reveal_behind_cw"])||!e.get("spoiler_text"))||void 0}),r="picture-o";else c=Object(b.a)(y.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card",null)});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)(M.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)(M.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)(M.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)(M.c,{value:e.get("favourites_count")}))),Object(b.a)("div",{style:o},void 0,f.a.createElement("div",{ref:this.setRef,className:x()("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}),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)(M.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}(u.a);Object(i.a)(w,"contextTypes",{router:r.a.object}),Object(i.a)(w,"propTypes",{status:d.a.map,settings:d.a.map.isRequired,onOpenMedia:r.a.func.isRequired,onOpenVideo:r.a.func.isRequired,onToggleHidden:r.a.func,expanded:r.a.bool,measureHeight:r.a.bool,onHeightChange:r.a.func,domain:r.a.string.isRequired,compact:r.a.bool})},717:function(e,t,a){"use strict";a.r(t);var s,n,o,i,c,r,l,h=a(0),d=a(3),u=a(7),p=a(1),b=a(4),f=a.n(b),g=a(2),m=a.n(g),O=a(24),j=a(5),v=a.n(j),k=a(12),M=a.n(k),y=a(27),C=a.n(y),_=a(99),x=a(907),I=a(645),w=a(48),R=a(635),D=a(6),N=a(29),E=a(224),H=Object(D.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"}}),A=Object(D.g)((o=n=function(n){function e(){for(var a,e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return a=n.call.apply(n,[this].concat(t))||this,Object(p.a)(Object(d.a)(a),"handleReplyClick",function(){a.props.onReply(a.props.status)}),Object(p.a)(Object(d.a)(a),"handleReblogClick",function(e){a.props.onReblog(a.props.status,e)}),Object(p.a)(Object(d.a)(a),"handleFavouriteClick",function(e){a.props.onFavourite(a.props.status,e)}),Object(p.a)(Object(d.a)(a),"handleBookmarkClick",function(e){a.props.onBookmark(a.props.status,e)}),Object(p.a)(Object(d.a)(a),"handleDeleteClick",function(){a.props.onDelete(a.props.status,a.context.router.history)}),Object(p.a)(Object(d.a)(a),"handleRedraftClick",function(){a.props.onDelete(a.props.status,a.context.router.history,!0)}),Object(p.a)(Object(d.a)(a),"handleDirectClick",function(){a.props.onDirect(a.props.status.get("account"),a.context.router.history)}),Object(p.a)(Object(d.a)(a),"handleMentionClick",function(){a.props.onMention(a.props.status.get("account"),a.context.router.history)}),Object(p.a)(Object(d.a)(a),"handleMuteClick",function(){a.props.onMute(a.props.status.get("account"))}),Object(p.a)(Object(d.a)(a),"handleConversationMuteClick",function(){a.props.onMuteConversation(a.props.status)}),Object(p.a)(Object(d.a)(a),"handleBlockClick",function(){a.props.onBlock(a.props.status)}),Object(p.a)(Object(d.a)(a),"handleReport",function(){a.props.onReport(a.props.status)}),Object(p.a)(Object(d.a)(a),"handlePinClick",function(){a.props.onPin(a.props.status)}),Object(p.a)(Object(d.a)(a),"handleShare",function(){navigator.share({text:a.props.status.get("search_index"),url:a.props.status.get("url")})}),Object(p.a)(Object(d.a)(a),"handleEmbed",function(){a.props.onEmbed(a.props.status)}),Object(p.a)(Object(d.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(u.a)(e,n),e.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(H.copy),action:this.handleCopy}),o.push({text:a.formatMessage(H.embed),action:this.handleEmbed}),o.push(null)),N.k===t.getIn(["account","id"])?(s&&o.push({text:a.formatMessage(t.get("pinned")?H.unpin:H.pin),action:this.handlePinClick}),o.push(null),o.push({text:a.formatMessage(n?H.unmuteConversation:H.muteConversation),action:this.handleConversationMuteClick}),o.push(null),o.push({text:a.formatMessage(H.delete),action:this.handleDeleteClick})):(o.push({text:a.formatMessage(H.mention,{name:t.getIn(["account","username"])}),action:this.handleMentionClick}),o.push({text:a.formatMessage(H.direct,{name:t.getIn(["account","username"])}),action:this.handleDirectClick}),o.push(null),o.push({text:a.formatMessage(H.mute,{name:t.getIn(["account","username"])}),action:this.handleMuteClick}),o.push({text:a.formatMessage(H.block,{name:t.getIn(["account","username"])}),action:this.handleBlockClick}),o.push({text:a.formatMessage(H.report,{name:t.getIn(["account","username"])}),action:this.handleReport}),N.h&&(E.a||E.e)&&(o.push(null),void 0!==E.a&&o.push({text:a.formatMessage(H.admin_account,{name:t.getIn(["account","username"])}),href:Object(E.a)(t.getIn(["account","id"]))}),void 0!==E.e&&o.push({text:a.formatMessage(H.admin_status),href:Object(E.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)(w.a,{title:a.formatMessage(H.share),icon:"share-alt",onClick:this.handleShare})),c="direct"===t.get("visibility")||"private"===t.get("visibility")&&N.k!==t.getIn(["account","id"]),r="private"===t.get("visibility")?H.reblog_private:H.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)(w.a,{title:a.formatMessage(H.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)(w.a,{disabled:c,active:t.get("reblogged"),title:c?a.formatMessage(H.cannot_reblog):a.formatMessage(r),icon:"retweet",onClick:this.handleReblogClick})),Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(w.a,{className:"star-icon",animate:!0,active:t.get("favourited"),title:a.formatMessage(H.favourite),icon:"star",onClick:this.handleFavouriteClick})),i,Object(h.a)("div",{className:"detailed-status__button"},void 0,Object(h.a)(w.a,{className:"bookmark-icon",active:t.get("bookmarked"),title:a.formatMessage(H.bookmark),icon:"bookmark",onClick:this.handleBookmarkClick})),Object(h.a)("div",{className:"detailed-status__action-bar-dropdown"},void 0,Object(h.a)(R.a,{size:18,icon:"ellipsis-h",items:o,direction:"left",ariaLabel:"More"})))},e}(m.a.PureComponent),Object(p.a)(n,"contextTypes",{router:v.a.object}),s=o))||s,B=a(624),S=a(49),F=a(20),T=a(363),z=a(22),U=a(136),P=a(91),q=a(204),V=a(426),K=a(929),L=a(626),J=a(905),W=a(50),Y=a(25),G=a(344),Q=a(231),X=a(639),Z=a(765);a.d(t,"default",function(){return ee});var $=Object(D.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"}}),ee=(i=Object(O.connect)(function(){var s=Object(q.f)();return function(n,e){var o=s(n,{id:e.params.statusId}),t=f.a.List(),a=f.a.List();return o&&(t=t.withMutations(function(e){for(var t=o.get("in_reply_to_id");t;)e.unshift(t),t=n.getIn(["contexts","inReplyTos",t])}),a=a.withMutations(function(e){for(var t=[o.get("id")];0<t.length;){var a=t.shift(),s=n.getIn(["contexts","replies",a]);o.get("id")!==a&&e.push(a),s&&s.reverse().forEach(function(e){t.unshift(e)})}})),{status:o,ancestorsIds:t,descendantsIds:a,settings:n.get("local_settings"),askReplyConfirmation:n.getIn(["local_settings","confirm_before_clearing_draft"])&&0!==n.getIn(["compose","text"]).trim().length,domain:n.getIn(["meta","domain"])}}}),Object(D.g)(c=i((l=r=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(p.a)(Object(d.a)(i),"state",{fullscreen:!1,isExpanded:void 0,threadExpanded:void 0,statusId:void 0}),Object(p.a)(Object(d.a)(i),"handleExpandedToggle",function(){i.props.status.get("spoiler_text")&&i.setExpansion(!i.state.isExpanded)}),Object(p.a)(Object(d.a)(i),"handleModalFavourite",function(e){i.props.dispatch(Object(S.p)(e))}),Object(p.a)(Object(d.a)(i),"handleFavouriteClick",function(e,t){e.get("favourited")?i.props.dispatch(Object(S.v)(e)):t&&t.shiftKey||!N.g?i.handleModalFavourite(e):i.props.dispatch(Object(W.d)("FAVOURITE",{status:e,onFavourite:i.handleModalFavourite}))}),Object(p.a)(Object(d.a)(i),"handlePin",function(e){e.get("pinned")?i.props.dispatch(Object(S.w)(e)):i.props.dispatch(Object(S.s)(e))}),Object(p.a)(Object(d.a)(i),"handleReplyClick",function(e){var t=i.props,a=t.askReplyConfirmation,s=t.dispatch,n=t.intl;s(a?Object(W.d)("CONFIRM",{message:n.formatMessage($.replyMessage),confirm:n.formatMessage($.replyConfirm),onDoNotAsk:function(){return s(Object(T.b)(["confirm_before_clearing_draft"],!1))},onConfirm:function(){return s(Object(F.kb)(e,i.context.router.history))}}):Object(F.kb)(e,i.context.router.history))}),Object(p.a)(Object(d.a)(i),"handleModalReblog",function(e){i.props.dispatch(Object(S.t)(e))}),Object(p.a)(Object(d.a)(i),"handleReblogClick",function(e,t){e.get("reblogged")?i.props.dispatch(Object(S.x)(e)):t&&t.shiftKey||!N.b?i.handleModalReblog(e):i.props.dispatch(Object(W.d)("BOOST",{status:e,onReblog:i.handleModalReblog}))}),Object(p.a)(Object(d.a)(i),"handleBookmarkClick",function(e){e.get("bookmarked")?i.props.dispatch(Object(S.u)(e)):i.props.dispatch(Object(S.o)(e))}),Object(p.a)(Object(d.a)(i),"handleDeleteClick",function(e,t,a){void 0===a&&(a=!1);var s=i.props,n=s.dispatch,o=s.intl;N.d?n(Object(W.d)("CONFIRM",{message:o.formatMessage(a?$.redraftMessage:$.deleteMessage),confirm:o.formatMessage(a?$.redraftConfirm:$.deleteConfirm),onConfirm:function(){return n(Object(_.e)(e.get("id"),t,a))}})):n(Object(_.e)(e.get("id"),t,a))}),Object(p.a)(Object(d.a)(i),"handleDirectClick",function(e,t){i.props.dispatch(Object(F.bb)(e,t))}),Object(p.a)(Object(d.a)(i),"handleMentionClick",function(e,t){i.props.dispatch(Object(F.gb)(e,t))}),Object(p.a)(Object(d.a)(i),"handleOpenMedia",function(e,t){i.props.dispatch(Object(W.d)("MEDIA",{media:e,index:t}))}),Object(p.a)(Object(d.a)(i),"handleOpenVideo",function(e,t){i.props.dispatch(Object(W.d)("VIDEO",{media:e,time:t}))}),Object(p.a)(Object(d.a)(i),"handleMuteClick",function(e){i.props.dispatch(Object(U.g)(e))}),Object(p.a)(Object(d.a)(i),"handleConversationMuteClick",function(e){e.get("muted")?i.props.dispatch(Object(_.h)(e.get("id"))):i.props.dispatch(Object(_.g)(e.get("id")))}),Object(p.a)(Object(d.a)(i),"handleToggleAll",function(){var e=i.state.isExpanded;i.setState({isExpanded:!e,threadExpanded:!e})}),Object(p.a)(Object(d.a)(i),"handleBlockClick",function(e){var t=i.props,a=t.dispatch,s=t.intl,n=e.get("account");a(Object(W.d)("CONFIRM",{message:Object(h.a)(D.b,{id:"confirmations.block.message",defaultMessage:"Are you sure you want to block {name}?",values:{name:Object(h.a)("strong",{},void 0,"@",n.get("acct"))}}),confirm:s.formatMessage($.blockConfirm),onConfirm:function(){return a(Object(z.z)(n.get("id")))},secondary:s.formatMessage($.blockAndReport),onSecondary:function(){a(Object(z.z)(n.get("id"))),a(Object(P.k)(n,e))}}))}),Object(p.a)(Object(d.a)(i),"handleReport",function(e){i.props.dispatch(Object(P.k)(e.get("account"),e))}),Object(p.a)(Object(d.a)(i),"handleEmbed",function(e){i.props.dispatch(Object(W.d)("EMBED",{url:e.get("url")}))}),Object(p.a)(Object(d.a)(i),"handleHotkeyMoveUp",function(){i.handleMoveUp(i.props.status.get("id"))}),Object(p.a)(Object(d.a)(i),"handleHotkeyMoveDown",function(){i.handleMoveDown(i.props.status.get("id"))}),Object(p.a)(Object(d.a)(i),"handleHotkeyReply",function(e){e.preventDefault(),i.handleReplyClick(i.props.status)}),Object(p.a)(Object(d.a)(i),"handleHotkeyFavourite",function(){i.handleFavouriteClick(i.props.status)}),Object(p.a)(Object(d.a)(i),"handleHotkeyBoost",function(){i.handleReblogClick(i.props.status)}),Object(p.a)(Object(d.a)(i),"handleHotkeyMention",function(e){e.preventDefault(),i.handleMentionClick(i.props.status)}),Object(p.a)(Object(d.a)(i),"handleHotkeyOpenProfile",function(){i.context.router.history.push("/accounts/"+i.props.status.getIn(["account","id"]))}),Object(p.a)(Object(d.a)(i),"handleMoveUp",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,n=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size-1);else{var o=s.indexOf(e);-1===o?(o=n.indexOf(e),i._selectChild(s.size+o)):i._selectChild(o-1)}}),Object(p.a)(Object(d.a)(i),"handleMoveDown",function(e){var t=i.props,a=t.status,s=t.ancestorsIds,n=t.descendantsIds;if(e===a.get("id"))i._selectChild(s.size+1);else{var o=s.indexOf(e);-1===o?(o=n.indexOf(e),i._selectChild(s.size+o+2)):i._selectChild(o+1)}}),Object(p.a)(Object(d.a)(i),"handleHeaderClick",function(){i.column.scrollTop()}),Object(p.a)(Object(d.a)(i),"setExpansion",function(e){i.setState({isExpanded:e})}),Object(p.a)(Object(d.a)(i),"setRef",function(e){i.node=e}),Object(p.a)(Object(d.a)(i),"setColumnRef",function(e){i.column=e}),Object(p.a)(Object(d.a)(i),"onFullScreenChange",function(){i.setState({fullscreen:Object(Q.d)()})}),Object(p.a)(Object(d.a)(i),"shouldUpdateScroll",function(e,t){var a=t.location;return!(((e||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)}),i}Object(u.a)(e,s);var t=e.prototype;return t.componentDidMount=function(){Object(Q.a)(this.onFullScreenChange),this.props.dispatch(Object(_.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(_.f)(e.params.statusId)),{threadExpanded:void 0,isExpanded:Object(X.a)(e.settings,e.status),statusId:e.params.statusId}):null},t._selectChild=function(e){var t=this.node.querySelectorAll(".focusable")[e];t&&t.focus()},t.renderChildren=function(e){var t=this;return e.map(function(e){return Object(h.a)(J.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 n=this.node.querySelectorAll(".focusable")[s.size-1];window.requestAnimationFrame(function(){n.scrollIntoView(!0)})}}},t.componentWillUnmount=function(){Object(Q.b)(this.onFullScreenChange)},t.render=function(){this.setExpansion;var e,t,a=this.props,s=a.status,n=a.settings,o=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)(K.a,{}),Object(h.a)(x.a,{}));o&&0<o.size&&(e=Object(h.a)("div",{},void 0,this.renderChildren(o))),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,mention:this.handleHotkeyMention,openProfile:this.handleHotkeyOpenProfile,toggleSpoiler:this.handleExpandedToggle};return m.a.createElement(B.a,{ref:this.setColumnRef,label:c.formatMessage($.detailedStatus)},Object(h.a)(L.a,{icon:"comment",title:c.formatMessage($.tootHeading),onClick:this.handleHeaderClick,showBackButton:!0,extraButton:Object(h.a)("button",{className:"column-header__button",title:c.formatMessage(u?$.hideAll:$.revealAll),"aria-label":c.formatMessage(u?$.hideAll:$.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)(V.a,{scrollKey:"thread",shouldUpdateScroll:this.shouldUpdateScroll},void 0,m.a.createElement("div",{className:M()("scrollable","detailed-status__wrapper",{fullscreen:d}),ref:this.setRef},e,Object(h.a)(G.HotKeys,{handlers:p},void 0,Object(h.a)("div",{className:"focusable",tabIndex:"0","aria-label":Object(Z.b)(c,s,!1,!s.get("hidden"))},void 0,Object(h.a)(I.a,{status:s,settings:n,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,expanded:u,onToggleHidden:this.handleExpandedToggle,domain:r}),Object(h.a)(A,{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}(Y.a),Object(p.a)(r,"contextTypes",{router:v.a.object}),Object(p.a)(r,"propTypes",{params:v.a.object.isRequired,dispatch:v.a.func.isRequired,status:C.a.map,settings:C.a.map.isRequired,ancestorsIds:C.a.list,descendantsIds:C.a.list,intl:v.a.object.isRequired,askReplyConfirmation:v.a.bool,domain:v.a.string.isRequired}),c=l))||c)||c)}}]);
//# sourceMappingURL=status.js.map