From 78529cb1f853eeb1f8cf7ca904cf14dd7e784331 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 2 Jul 2021 03:05:33 -0600 Subject: [PATCH 1/6] Update PublicApiController --- app/Http/Controllers/PublicApiController.php | 58 ++++++++------------ 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 50f0e9e3e..212ee31f0 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -290,6 +290,7 @@ class PublicApiController extends Controller $max = $request->input('max_id'); $limit = $request->input('limit') ?? 3; $user = $request->user(); + $amin = SnowflakeService::byDate(now()->subDays(90)); $key = 'user:last_active_at:id:'.$user->id; $ttl = now()->addMinutes(5); @@ -309,64 +310,49 @@ class PublicApiController extends Controller $id = $min ?? $max; $timeline = Status::select( 'id', - 'uri', - 'caption', - 'rendered', 'profile_id', 'type', - 'in_reply_to_id', - 'reblog_of_id', - 'is_nsfw', 'scope', - 'local', - 'reply_count', - 'comments_disabled', - 'place_id', - 'likes_count', - 'reblogs_count', - 'created_at', - 'updated_at' + 'local' )->where('id', $dir, $id) + ->where('id', '>', $amin) ->whereIn('type', ['text', 'photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereNotIn('profile_id', $filtered) ->whereLocal(true) ->whereScope('public') - ->where('created_at', '>', now()->subMonths(6)) - ->orderBy('created_at', 'desc') + ->orderBy('id', 'desc') ->limit($limit) - ->get(); + ->get() + ->map(function($s) use ($user) { + $status = StatusService::get($s->id); + $status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id); + return $status; + }); + $res = $timeline->toArray(); } else { $timeline = Status::select( 'id', - 'uri', - 'caption', - 'rendered', 'profile_id', 'type', - 'in_reply_to_id', - 'reblog_of_id', - 'is_nsfw', 'scope', - 'local', - 'reply_count', - 'comments_disabled', - 'created_at', - 'place_id', - 'likes_count', - 'reblogs_count', - 'updated_at' + 'local' )->whereIn('type', ['text', 'photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) + ->where('id', '>', $amin) ->whereNotIn('profile_id', $filtered) ->with('profile', 'hashtags', 'mentions') ->whereLocal(true) ->whereScope('public') - ->where('created_at', '>', now()->subMonths(6)) - ->orderBy('created_at', 'desc') - ->simplePaginate($limit); + ->orderBy('id', 'desc') + ->limit($limit) + ->get() + ->map(function($s) use ($user) { + $status = StatusService::get($s->id); + $status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id); + return $status; + }); + $res = $timeline->toArray(); } - $fractal = new Fractal\Resource\Collection($timeline, new StatusTransformer()); - $res = $this->fractal->createData($fractal)->toArray(); return response()->json($res); } From f215ee26b350442f7aa5f5c7fc188c55f1ca41dd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Jul 2021 23:00:59 -0600 Subject: [PATCH 2/6] Update moderator api, expire cached status --- app/Http/Controllers/InternalApiController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index ad34f92ae..23bb687ba 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -333,6 +333,7 @@ class InternalApiController extends Controller Cache::forget('_api:statuses:recent_9:' . $status->profile_id); Cache::forget('profile:embed:' . $status->profile_id); + StatusService::del($status->id); return ['msg' => 200]; } From 51a277e1aefdbb217ca00625eda98bd95a075946 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Jul 2021 23:40:54 -0600 Subject: [PATCH 3/6] Update StatusHashtagService, fix null status bug --- app/Services/StatusHashtagService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/StatusHashtagService.php b/app/Services/StatusHashtagService.php index d656e436a..497fe8642 100644 --- a/app/Services/StatusHashtagService.php +++ b/app/Services/StatusHashtagService.php @@ -30,6 +30,9 @@ class StatusHashtagService { ->map(function ($i, $k) use ($id) { return self::getStatus($i, $id); }) + ->filter(function ($i) { + return isset($i['status']) && !empty($i['status']); + }) ->all(); } @@ -72,4 +75,4 @@ class StatusHashtagService { { return ['status' => StatusService::get($statusId)]; } -} \ No newline at end of file +} From 950fc27773124efaab242e48b55ce9f726862860 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Jul 2021 23:42:46 -0600 Subject: [PATCH 4/6] Update components --- resources/assets/js/components/Timeline.vue | 517 +----------------- .../js/components/partials/ContextMenu.vue | 44 +- .../js/components/partials/StatusCard.vue | 460 +--------------- 3 files changed, 73 insertions(+), 948 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index a266b3a8a..d0562adba 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -398,140 +398,6 @@ - - { - status.favourites_count = res.data.count; - }).catch(err => { - status.favourited = !status.favourited; - status.favourites_count = count; - swal('Error', 'Something went wrong, please try again later.', 'error'); - }); - window.navigator.vibrate(200); - if(status.favourited) { - setTimeout(function() { - event.target.classList.add('animate__animated', 'animate__bounce'); - },100); - } - }, - - shareStatus(status, $event) { - if($('body').hasClass('loggedIn') == false) { - return; - } - - this.closeModals(); - - axios.post('/i/share', { - item: status.id - }).then(res => { - status.reblogs_count = res.data.count; - status.reblogged = !status.reblogged; - if(status.reblogged) { - swal('Success', 'You shared this post', 'success'); - } else { - swal('Success', 'You unshared this post', 'success'); - } - }).catch(err => { - swal('Error', 'Something went wrong, please try again later.', 'error'); - }); - }, - - timestampFormat(timestamp) { - let ts = new Date(timestamp); - return ts.toDateString() + ' ' + ts.toLocaleTimeString(); - }, - redirect(url) { window.location.href = url; return; }, - statusOwner(status) { - let sid = status.account.id; - let uid = this.profile.id; - if(sid == uid) { - return true; - } else { - return false; - } - }, - - fetchStatusComments(status, card) { - // axios.get('/api/v2/status/'+status.id+'/replies', - // { - // params: { - // limit: 6 - // } - // }) - // .then(res => { - // let data = res.data.filter(res => { - // return res.sensitive == false; - // }); - // this.replies = _.reverse(data); - // setTimeout(function() { - // document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) { - // i.href = App.util.format.rewriteLinks(i); - // }); - // }, 500); - // }).catch(err => { - // }) - let url = '/api/v2/comments/'+status.account.id+'/status/'+status.id; - axios.get(url) - .then(response => { - let self = this; - // this.results = this.layout == 'metro' ? - // _.reverse(response.data.data) : - // response.data.data; - this.replies = _.reverse(response.data.data); - this.pagination = response.data.meta.pagination; - if(this.replies.length > 0) { - $('.load-more-link').removeClass('d-none'); - } - $('.postCommentsLoader').addClass('d-none'); - $('.postCommentsContainer').removeClass('d-none'); - // setTimeout(function() { - // document.querySelectorAll('.status-comment .postCommentsContainer .comment-body a').forEach(function(i, e) { - // i.href = App.util.format.rewriteLinks(i); - // }); - // }, 500); - }).catch(error => { - if(!error.response) { - $('.postCommentsLoader .lds-ring') - .attr('style','width:100%') - .addClass('pt-4 font-weight-bold text-muted') - .text('An error occurred, cannot fetch comments. Please try again later.'); - } else { - switch(error.response.status) { - case 401: - $('.postCommentsLoader .lds-ring') - .attr('style','width:100%') - .addClass('pt-4 font-weight-bold text-muted') - .text('Please login to view.'); - break; - - default: - $('.postCommentsLoader .lds-ring') - .attr('style','width:100%') - .addClass('pt-4 font-weight-bold text-muted') - .text('An error occurred, cannot fetch comments. Please try again later.'); - break; - } - } - }); - }, - - followingModal() { - if(this.following.length > 0) { - this.$refs.followingModal.show(); - return; - } - axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/following', { - params: { - page: this.followingCursor - } - }) - .then(res => { - this.following = res.data; - this.followingCursor++; - }); - if(res.data.length < 10) { - this.followingMore = false; - } - this.$refs.followingModal.show(); - }, - - followersModal() { - if(this.followers.length > 0) { - this.$refs.followerModal.show(); - return; - } - axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/followers', { - params: { - page: this.followerCursor - } - }) - .then(res => { - this.followers = res.data; - this.followerCursor++; - }) - if(res.data.length < 10) { - this.followerMore = false; - } - this.$refs.followerModal.show(); - }, - - followingLoadMore() { - axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/following', { - params: { - page: this.followingCursor - } - }) - .then(res => { - if(res.data.length > 0) { - this.following.push(...res.data); - this.followingCursor++; - } - if(res.data.length < 10) { - this.followingMore = false; - } - }); - }, - - followersLoadMore() { - axios.get('/api/pixelfed/v1/accounts/'+this.profile.id+'/followers', { - params: { - page: this.followerCursor - } - }) - .then(res => { - if(res.data.length > 0) { - this.followers.push(...res.data); - this.followerCursor++; - } - if(res.data.length < 10) { - this.followerMore = false; - } - }); - }, - - lightbox(status) { - window.location.href = status.media_attachments[0].url; - return; - this.lightboxMedia = status.media_attachments[0]; - this.$refs.lightboxModal.show(); - }, - - expLc(status) { - if(this.config.ab.lc == false) { - return true; - } - if(this.statusOwner(status) == true) { - return true; - } - return false; - }, - expRec() { //return; @@ -1223,33 +829,6 @@ }); }, - followAction(status) { - let id = status.account.id; - - axios.post('/i/follow', { - item: id - }).then(res => { - this.feed.forEach(s => { - if(s.account.id == id) { - s.account.relationship.following = !s.account.relationship.following; - } - }); - - let username = status.account.acct; - - if(status.account.relationship.following) { - swal('Follow successful!', 'You are now following ' + username, 'success'); - } else { - swal('Unfollow successful!', 'You are no longer following ' + username, 'success'); - } - - }).catch(err => { - if(err.response.data.message) { - swal('Error', err.response.data.message, 'error'); - } - }); - }, - owner(status) { return this.profile.id === status.account.id; }, @@ -1335,80 +914,38 @@ }) }, - ctxCopyEmbed() { - navigator.clipboard.writeText(this.ctxEmbedPayload); - this.ctxEmbedShowCaption = true; - this.ctxEmbedShowLikes = false; - this.ctxEmbedCompactMode = false; - this.$refs.ctxEmbedModal.hide(); - }, + commentFocus(status, $event) { + if(status.comments_disabled) { + return; + } + + // if(this.status && this.status.id == status.id) { + // this.$refs.replyModal.show(); + // return; + // } + + this.status = status; + this.replies = {}; + this.replyStatus = {}; + this.replyText = ''; + this.replyId = status.id; + this.replyStatus = status; + // this.$refs.replyModal.show(); + this.fetchStatusComments(status, ''); + + $('nav').hide(); + $('footer').hide(); + $('.mobile-footer-spacer').attr('style', 'display:none !important'); + $('.mobile-footer').attr('style', 'display:none !important'); + this.currentLayout = 'comments'; + window.history.pushState({}, '', this.statusUrl(status)); + return; + }, formatCount(count) { return App.util.format.count(count); }, - statusUrl(status) { - if(status.local == true) { - return status.url; - } - - return '/i/web/post/_/' + status.account.id + '/' + status.id; - }, - - profileUrl(status) { - if(status.local == true) { - return status.account.url; - } - - return '/i/web/profile/_/' + status.account.id; - }, - - statusCardUsernameFormat(status) { - if(status.account.local == true) { - return status.account.username; - } - - let fmt = window.App.config.username.remote.format; - let txt = window.App.config.username.remote.custom; - let usr = status.account.username; - let dom = document.createElement('a'); - dom.href = status.account.url; - dom = dom.hostname; - - switch(fmt) { - case '@': - return usr + '@' + dom + ''; - break; - - case 'from': - return usr + ' from ' + dom + ''; - break; - - case 'custom': - return usr + ' ' + txt + ' ' + dom + ''; - break; - - default: - return usr + '@' + dom + ''; - break; - } - }, - - previewUrl(status) { - return status.sensitive ? '/storage/no-preview.png?v=' + new Date().getTime() : status.media_attachments[0].preview_url; - }, - - previewBackground(status) { - let preview = this.previewUrl(status); - return 'background-image: url(' + preview + ');'; - }, - - trimCaption(caption, len = 60) { - return _.truncate(caption, { - length: len - }); - }, - hasStory() { axios.get('/api/stories/v0/exists/'+this.profile.id) .then(res => { diff --git a/resources/assets/js/components/partials/ContextMenu.vue b/resources/assets/js/components/partials/ContextMenu.vue index ebca5a7d8..f5d966b62 100644 --- a/resources/assets/js/components/partials/ContextMenu.vue +++ b/resources/assets/js/components/partials/ContextMenu.vue @@ -356,7 +356,6 @@ ctxModMenuClose() { this.closeModals(); - this.$refs.ctxModal.show(); }, ctxModOtherMenuClose() { @@ -490,6 +489,7 @@ }).then(res => { swal('Success', 'Successfully added content warning', 'success'); status.sensitive = true; + self.closeModals(); self.ctxModMenuClose(); }).catch(err => { swal( @@ -497,6 +497,7 @@ 'Something went wrong, please try again later.', 'error' ); + self.closeModals(); self.ctxModMenuClose(); }); } @@ -520,6 +521,7 @@ }).then(res => { swal('Success', 'Successfully added content warning', 'success'); status.sensitive = false; + self.closeModals(); self.ctxModMenuClose(); }).catch(err => { swal( @@ -527,6 +529,7 @@ 'Something went wrong, please try again later.', 'error' ); + self.closeModals(); self.ctxModMenuClose(); }); } @@ -552,8 +555,10 @@ return f.id != status.id; }); swal('Success', 'Successfully unlisted post', 'success'); + self.closeModals(); self.ctxModMenuClose(); }).catch(err => { + self.closeModals(); self.ctxModMenuClose(); swal( 'Error', @@ -581,9 +586,10 @@ item_type: 'status' }).then(res => { swal('Success', 'Successfully marked account as spammer', 'success'); + self.closeModals(); self.ctxModMenuClose(); }).catch(err => { - console.log(err); + self.closeModals(); self.ctxModMenuClose(); swal( 'Error', @@ -625,7 +631,39 @@ } return '/i/web/post/_/' + status.account.id + '/' + status.id; - } + }, + + deletePost(status) { + if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) { + return; + } + + if(window.confirm('Are you sure you want to delete this post?') == false) { + return; + } + + axios.post('/i/delete', { + type: 'status', + item: status.id + }).then(res => { + this.$emit('status-delete', status.id); + this.closeModals(); + }).catch(err => { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + }); + }, + + owner(status) { + return this.profile.id === status.account.id; + }, + + admin() { + return this.profile.is_admin == true; + }, + + ownerOrAdmin(status) { + return this.owner(status) || this.admin(); + }, } } diff --git a/resources/assets/js/components/partials/StatusCard.vue b/resources/assets/js/components/partials/StatusCard.vue index 9f654e6da..6bf7b9609 100644 --- a/resources/assets/js/components/partials/StatusCard.vue +++ b/resources/assets/js/components/partials/StatusCard.vue @@ -124,6 +124,7 @@ ref="contextMenu" :status="status" :profile="profile" + v-on:status-delete="statusDeleted" /> @@ -166,49 +167,6 @@ replyText: '', replyNsfw: false, emoji: window.App.util.emoji, - ctxMenuStatus: false, - ctxMenuRelationship: false, - ctxEmbedPayload: false, - copiedEmbed: false, - replySending: false, - ctxEmbedShowCaption: true, - ctxEmbedShowLikes: false, - ctxEmbedCompactMode: false, - confirmModalTitle: 'Are you sure?', - confirmModalIdentifer: null, - confirmModalType: false, - tributeSettings: { - collection: [ - { - trigger: '@', - menuShowMinLength: 2, - values: (function (text, cb) { - let url = '/api/compose/v0/search/mention'; - axios.get(url, { params: { q: text }}) - .then(res => { - cb(res.data); - }) - .catch(err => { - console.log(err); - }) - }) - }, - { - trigger: '#', - menuShowMinLength: 2, - values: (function (text, cb) { - let url = '/api/compose/v0/search/hashtag'; - axios.get(url, { params: { q: text }}) - .then(res => { - cb(res.data); - }) - .catch(err => { - console.log(err); - }) - }) - } - ] - }, } }, @@ -305,65 +263,10 @@ } }, - // ctxMenu() { - // this.$emit('ctx-menu', this.status); - // }, - commentFocus(status, $event) { this.$emit('comment-focus', status); }, - muteProfile(status) { - if($('body').hasClass('loggedIn') == false) { - return; - } - axios.post('/i/mute', { - type: 'user', - item: status.account.id - }).then(res => { - this.feed = this.feed.filter(s => s.account.id !== status.account.id); - swal('Success', 'You have successfully muted ' + status.account.acct, 'success'); - }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); - }); - }, - - blockProfile(status) { - if($('body').hasClass('loggedIn') == false) { - return; - } - - axios.post('/i/block', { - type: 'user', - item: status.account.id - }).then(res => { - this.feed = this.feed.filter(s => s.account.id !== status.account.id); - swal('Success', 'You have successfully blocked ' + status.account.acct, 'success'); - }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); - }); - }, - - deletePost(status) { - if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) { - return; - } - - if(window.confirm('Are you sure you want to delete this post?') == false) { - return; - } - - axios.post('/i/delete', { - type: 'status', - item: status.id - }).then(res => { - this.$emit('status-delete', status.id); - this.closeModals(); - }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); - }); - }, - commentSubmit(status, $event) { this.replySending = true; let id = status.id; @@ -386,132 +289,6 @@ this.replySending = false; }, - moderatePost(status, action, $event) { - let username = status.account.username; - let msg = ''; - let self = this; - switch(action) { - case 'addcw': - msg = 'Are you sure you want to add a content warning to this post?'; - swal({ - title: 'Confirm', - text: msg, - icon: 'warning', - buttons: true, - dangerMode: true - }).then(res => { - if(res) { - axios.post('/api/v2/moderator/action', { - action: action, - item_id: status.id, - item_type: 'status' - }).then(res => { - swal('Success', 'Successfully added content warning', 'success'); - status.sensitive = true; - self.ctxModMenuClose(); - }).catch(err => { - swal( - 'Error', - 'Something went wrong, please try again later.', - 'error' - ); - self.ctxModMenuClose(); - }); - } - }); - break; - - case 'remcw': - msg = 'Are you sure you want to remove the content warning on this post?'; - swal({ - title: 'Confirm', - text: msg, - icon: 'warning', - buttons: true, - dangerMode: true - }).then(res => { - if(res) { - axios.post('/api/v2/moderator/action', { - action: action, - item_id: status.id, - item_type: 'status' - }).then(res => { - swal('Success', 'Successfully added content warning', 'success'); - status.sensitive = false; - self.ctxModMenuClose(); - }).catch(err => { - swal( - 'Error', - 'Something went wrong, please try again later.', - 'error' - ); - self.ctxModMenuClose(); - }); - } - }); - break; - - case 'unlist': - msg = 'Are you sure you want to unlist this post?'; - swal({ - title: 'Confirm', - text: msg, - icon: 'warning', - buttons: true, - dangerMode: true - }).then(res => { - if(res) { - axios.post('/api/v2/moderator/action', { - action: action, - item_id: status.id, - item_type: 'status' - }).then(res => { - this.feed = this.feed.filter(f => { - return f.id != status.id; - }); - swal('Success', 'Successfully unlisted post', 'success'); - self.ctxModMenuClose(); - }).catch(err => { - self.ctxModMenuClose(); - swal( - 'Error', - 'Something went wrong, please try again later.', - 'error' - ); - }); - } - }); - break; - } - }, - - followAction(status) { - let id = status.account.id; - - axios.post('/i/follow', { - item: id - }).then(res => { - this.feed.forEach(s => { - if(s.account.id == id) { - s.account.relationship.following = !s.account.relationship.following; - } - }); - - let username = status.account.acct; - - if(status.account.relationship.following) { - swal('Follow successful!', 'You are now following ' + username, 'success'); - } else { - swal('Unfollow successful!', 'You are no longer following ' + username, 'success'); - } - - }).catch(err => { - if(err.response.data.message) { - swal('Error', err.response.data.message, 'error'); - } - }); - }, - owner(status) { return this.profile.id === status.account.id; }, @@ -526,242 +303,15 @@ ctxMenu() { this.$refs.contextMenu.open(); - // let status = this.status; - // this.ctxMenuStatus = status; - // this.ctxEmbedPayload = window.App.util.embed.post(status.url); - // if(status.account.id == this.profile.id) { - // this.ctxMenuRelationship = false; - // this.$refs.ctxModal.show(); - // } else { - // axios.get('/api/pixelfed/v1/accounts/relationships', { - // params: { - // 'id[]': status.account.id - // } - // }).then(res => { - // this.ctxMenuRelationship = res.data[0]; - // this.$refs.ctxModal.show(); - // }); - // } - }, - - closeCtxMenu(truncate) { - this.copiedEmbed = false; - this.ctxMenuStatus = false; - this.ctxMenuRelationship = false; - this.$refs.ctxModal.hide(); - this.$refs.ctxReport.hide(); - this.$refs.ctxReportOther.hide(); - this.closeModals(); - }, - - ctxMenuCopyLink() { - let status = this.ctxMenuStatus; - navigator.clipboard.writeText(status.url); - this.closeModals(); - return; - }, - - ctxMenuGoToPost() { - let status = this.ctxMenuStatus; - window.location.href = this.statusUrl(status); - this.closeCtxMenu(); - return; - }, - - ctxMenuFollow() { - let id = this.ctxMenuStatus.account.id; - axios.post('/i/follow', { - item: id - }).then(res => { - let username = this.ctxMenuStatus.account.acct; - this.closeCtxMenu(); - setTimeout(function() { - swal('Follow successful!', 'You are now following ' + username, 'success'); - }, 500); - }); - }, - - ctxMenuUnfollow() { - let id = this.ctxMenuStatus.account.id; - axios.post('/i/follow', { - item: id - }).then(res => { - let username = this.ctxMenuStatus.account.acct; - if(this.scope == 'home') { - this.feed = this.feed.filter(s => { - return s.account.id != this.ctxMenuStatus.account.id; - }); - } - this.closeCtxMenu(); - setTimeout(function() { - swal('Unfollow successful!', 'You are no longer following ' + username, 'success'); - }, 500); - }); - }, - - ctxMenuReportPost() { - this.$refs.ctxModal.hide(); - this.$refs.ctxReport.show(); - return; - }, - - ctxMenuEmbed() { - this.closeModals(); - this.$refs.ctxEmbedModal.show(); - }, - - ctxMenuShare() { - this.$refs.ctxModal.hide(); - this.$refs.ctxShareModal.show(); - }, - - closeCtxShareMenu() { - this.$refs.ctxShareModal.hide(); - this.$refs.ctxModal.show(); - }, - - ctxCopyEmbed() { - navigator.clipboard.writeText(this.ctxEmbedPayload); - this.ctxEmbedShowCaption = true; - this.ctxEmbedShowLikes = false; - this.ctxEmbedCompactMode = false; - this.$refs.ctxEmbedModal.hide(); - }, - - ctxModMenuShow() { - this.$refs.ctxModal.hide(); - this.$refs.ctxModModal.show(); - }, - - ctxModOtherMenuShow() { - this.$refs.ctxModal.hide(); - this.$refs.ctxModModal.hide(); - this.$refs.ctxModOtherModal.show(); - }, - - ctxModMenu() { - this.$refs.ctxModal.hide(); - }, - - ctxModMenuClose() { - this.closeModals(); - this.$refs.ctxModal.show(); - }, - - ctxModOtherMenuClose() { - this.closeModals(); - this.$refs.ctxModModal.show(); - }, - - formatCount(count) { - return App.util.format.count(count); - }, - - openCtxReportOtherMenu() { - let s = this.ctxMenuStatus; - this.closeCtxMenu(); - this.ctxMenuStatus = s; - this.$refs.ctxReportOther.show(); - }, - - ctxReportMenuGoBack() { - this.$refs.ctxReportOther.hide(); - this.$refs.ctxReport.hide(); - this.$refs.ctxModal.show(); - }, - - ctxReportOtherMenuGoBack() { - this.$refs.ctxReportOther.hide(); - this.$refs.ctxModal.hide(); - this.$refs.ctxReport.show(); - }, - - sendReport(type) { - let id = this.ctxMenuStatus.id; - - swal({ - 'title': 'Confirm Report', - 'text': 'Are you sure you want to report this post?', - 'icon': 'warning', - 'buttons': true, - 'dangerMode': true - }).then((res) => { - if(res) { - axios.post('/i/report/', { - 'report': type, - 'type': 'post', - 'id': id, - }).then(res => { - this.closeCtxMenu(); - swal('Report Sent!', 'We have successfully received your report.', 'success'); - }).catch(err => { - swal('Oops!', 'There was an issue reporting this post.', 'error'); - }) - } else { - this.closeCtxMenu(); - } - }); - }, - - closeModals() { - this.$refs.ctxModal.hide(); - this.$refs.ctxModModal.hide(); - this.$refs.ctxModOtherModal.hide(); - this.$refs.ctxShareModal.hide(); - this.$refs.ctxEmbedModal.hide(); - this.$refs.ctxReport.hide(); - this.$refs.ctxReportOther.hide(); - this.$refs.ctxConfirm.hide(); - this.$refs.lightboxModal.hide(); - this.$refs.replyModal.hide(); - this.$refs.ctxStatusModal.hide(); - }, - - openCtxStatusModal() { - this.closeModals(); - this.$refs.ctxStatusModal.show(); - }, - - openConfirmModal() { - this.closeModals(); - this.$refs.ctxConfirm.show(); - }, - - closeConfirmModal() { - this.closeModals(); - this.confirmModalTitle = 'Are you sure?'; - this.confirmModalType = false; - this.confirmModalIdentifer = null; - }, - - confirmModalConfirm() { - switch(this.confirmModalType) { - case 'post.delete': - axios.post('/i/delete', { - type: 'status', - item: this.confirmModalIdentifer - }).then(res => { - this.feed = this.feed.filter(s => { - return s.id != this.confirmModalIdentifer; - }); - this.closeConfirmModal(); - }).catch(err => { - this.closeConfirmModal(); - swal('Error', 'Something went wrong. Please try again later.', 'error'); - }); - break; - } - - this.closeConfirmModal(); - }, - - confirmModalCancel() { - this.closeConfirmModal(); }, timeAgo(ts) { return App.util.format.timeAgo(ts); }, + + statusDeleted(status) { + this.$emit('status-delete', status); + } } } From 38726d699f82f462c916cc189066b3ef4d4e703c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 5 Jul 2021 23:43:33 -0600 Subject: [PATCH 5/6] Update compiled assets --- public/js/timeline.js | 2 +- public/mix-manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/timeline.js b/public/js/timeline.js index 5984660c5..e16307f14 100644 --- a/public/js/timeline.js +++ b/public/js/timeline.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{"2Jpm":function(t,e,n){"use strict";n.r(e);var i={props:["status"],methods:{playOrPause:function(t){var e=t.target;1==e.getAttribute("playing")?(e.removeAttribute("playing"),e.pause()):(e.setAttribute("playing",1),e.play())}}},s=n("KHd+"),o=Object(s.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1==t.status.sensitive?n("div",[n("details",{staticClass:"details-animated"},[n("summary",[n("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),n("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),n("div",{staticClass:"embed-responsive embed-responsive-1by1"},[n("video",{staticClass:"video",attrs:{preload:"none",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id},on:{click:function(e){return t.playOrPause(e)}}},[n("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])])]):n("div",{staticClass:"embed-responsive embed-responsive-16by9"},[n("video",{staticClass:"video",attrs:{controls:"",preload:"metadata",loop:"",poster:t.status.media_attachments[0].preview_url,"data-id":t.status.id}},[n("source",{attrs:{src:t.status.media_attachments[0].url,type:t.status.media_attachments[0].mime}})])])}),[],!1,null,null,null);e.default=o.exports},"4KG8":function(t,e,n){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n>>0,s=arguments[1],o=0;o container for the click");n.selectItemAtIndex(i.getAttribute("data-index"),e),n.hideMenu()}else n.current.element&&!n.current.externalTrigger&&(n.current.externalTrigger=!1,setTimeout((function(){return n.hideMenu()})))}},{key:"keyup",value:function(t,e){if(t.inputEvent&&(t.inputEvent=!1),t.updateSelection(this),27!==e.keyCode){if(!t.tribute.allowSpaces&&t.tribute.hasTrailingSpace)return t.tribute.hasTrailingSpace=!1,t.commandEvent=!0,void t.callbacks().space(e,this);if(!t.tribute.isActive)if(t.tribute.autocompleteMode)t.callbacks().triggerChar(e,this,"");else{var n=t.getKeyCode(t,this,e);if(isNaN(n)||!n)return;var i=t.tribute.triggers().find((function(t){return t.charCodeAt(0)===n}));void 0!==i&&t.callbacks().triggerChar(e,this,i)}t.tribute.current.mentionText.length=s.current.collection.menuShowMinLength&&s.inputEvent&&s.showMenuFor(n,!0)},enter:function(e,n){t.tribute.isActive&&t.tribute.current.filteredItems&&(e.preventDefault(),e.stopPropagation(),setTimeout((function(){t.tribute.selectItemAtIndex(t.tribute.menuSelected,e),t.tribute.hideMenu()}),0))},escape:function(e,n){t.tribute.isActive&&(e.preventDefault(),e.stopPropagation(),t.tribute.isActive=!1,t.tribute.hideMenu())},tab:function(e,n){t.callbacks().enter(e,n)},space:function(e,n){t.tribute.isActive&&(t.tribute.spaceSelectsMatch?t.callbacks().enter(e,n):t.tribute.allowSpaces||(e.stopPropagation(),setTimeout((function(){t.tribute.hideMenu(),t.tribute.isActive=!1}),0)))},up:function(e,n){if(t.tribute.isActive&&t.tribute.current.filteredItems){e.preventDefault(),e.stopPropagation();var i=t.tribute.current.filteredItems.length,s=t.tribute.menuSelected;i>s&&s>0?(t.tribute.menuSelected--,t.setActiveLi()):0===s&&(t.tribute.menuSelected=i-1,t.setActiveLi(),t.tribute.menu.scrollTop=t.tribute.menu.scrollHeight)}},down:function(e,n){if(t.tribute.isActive&&t.tribute.current.filteredItems){e.preventDefault(),e.stopPropagation();var i=t.tribute.current.filteredItems.length-1,s=t.tribute.menuSelected;i>s?(t.tribute.menuSelected++,t.setActiveLi()):i===s&&(t.tribute.menuSelected=0,t.setActiveLi(),t.tribute.menu.scrollTop=0)}},delete:function(e,n){t.tribute.isActive&&t.tribute.current.mentionText.length<1?t.tribute.hideMenu():t.tribute.isActive&&t.tribute.showMenuFor(n)}}}},{key:"setActiveLi",value:function(t){var e=this.tribute.menu.querySelectorAll("li"),n=e.length>>>0;t&&(this.tribute.menuSelected=parseInt(t));for(var i=0;ia.bottom){var r=o.bottom-a.bottom;this.tribute.menu.scrollTop+=r}else if(o.topi.width&&(s.left||s.right),a=window.innerHeight>i.height&&(s.top||s.bottom);(o||a)&&(n.tribute.menu.style.cssText="display: none",n.positionMenuAtCaret(t))}),0)}else this.tribute.menu.style.cssText="display: none"}},{key:"selectElement",value:function(t,e,n){var i,s=t;if(e)for(var o=0;o=0&&(e=i.substring(0,s))}}else{var o=this.tribute.current.element;if(o){var a=o.selectionStart;o.value&&a>=0&&(e=o.value.substring(0,a))}}return e}},{key:"getLastWordInText",value:function(t){var e=(t=t.replace(/\u00A0/g," ")).split(/\s+/);return e[e.length-1].trim()}},{key:"getTriggerInfo",value:function(t,e,n,i,s){var o,a,r,l=this,c=this.tribute.current;if(this.isContentEditable(c.element)){var d=this.getContentEditableSelectedPath(c);d&&(o=d.selected,a=d.path,r=d.offset)}else o=this.tribute.current.element;var u=this.getTextPrecedingCurrentSelection(),h=this.getLastWordInText(u);if(s)return{mentionPosition:u.length-h.length,mentionText:h,mentionSelectedElement:o,mentionSelectedPath:a,mentionSelectedOffset:r};if(null!=u){var f,m=-1;if(this.tribute.collection.forEach((function(t){var e=t.trigger,i=t.requireLeadingSpace?l.lastIndexWithLeadingSpace(u,e):u.lastIndexOf(e);i>m&&(m=i,f=e,n=t.requireLeadingSpace)})),m>=0&&(0===m||!n||/[\xA0\s]/g.test(u.substring(m-1,m)))){var p=u.substring(m+f.length,u.length);f=u.substring(m,m+f.length);var v=p.substring(0,1),g=p.length>0&&(" "===v||" "===v);e&&(p=p.trim());var b=i?/[^\S ]/g:/[\xA0\s]/g;if(this.tribute.hasTrailingSpace=b.test(p),!g&&(t||!b.test(p)))return{mentionPosition:m,mentionText:p,mentionSelectedElement:o,mentionSelectedPath:a,mentionSelectedOffset:r,mentionTriggerChar:f}}}}},{key:"lastIndexWithLeadingSpace",value:function(t,e){for(var n=t.split("").reverse().join(""),i=-1,s=0,o=t.length;s=0;c--)if(e[c]!==n[s-c]){l=!1;break}if(l&&(a||r)){i=t.length-1-s;break}}return i}},{key:"isContentEditable",value:function(t){return"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName}},{key:"isMenuOffScreen",value:function(t,e){var n=window.innerWidth,i=window.innerHeight,s=document.documentElement,o=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),r="number"==typeof t.top?t.top:a+i-t.bottom-e.height,l="number"==typeof t.right?t.right:t.left+e.width,c="number"==typeof t.bottom?t.bottom:t.top+e.height,d="number"==typeof t.left?t.left:o+n-t.right-e.width;return{top:rMath.ceil(o+n),bottom:c>Math.ceil(a+i),left:dparseInt(a.height)&&(o.overflowY="scroll")):o.overflow="hidden",s.textContent=t.value.substring(0,e),"INPUT"===t.nodeName&&(s.textContent=s.textContent.replace(/\s/g," "));var r=this.getDocument().createElement("span");r.textContent=t.value.substring(e)||".",s.appendChild(r);var l=t.getBoundingClientRect(),c=document.documentElement,d=(window.pageXOffset||c.scrollLeft)-(c.clientLeft||0),u=(window.pageYOffset||c.scrollTop)-(c.clientTop||0),h=0,f=0;this.menuContainerIsBody&&(h=l.top,f=l.left);var m={top:h+u+r.offsetTop+parseInt(a.borderTopWidth)+parseInt(a.fontSize)-t.scrollTop,left:f+d+r.offsetLeft+parseInt(a.borderLeftWidth)},p=window.innerWidth,v=window.innerHeight,g=this.getMenuDimensions(),b=this.isMenuOffScreen(m,g);b.right&&(m.right=p-m.left,m.left="auto");var w=this.tribute.menuContainer?this.tribute.menuContainer.offsetHeight:this.getDocument().body.offsetHeight;if(b.bottom){var x=w-(v-(this.tribute.menuContainer?this.tribute.menuContainer.getBoundingClientRect():this.getDocument().body.getBoundingClientRect()).top);m.bottom=x+(v-l.top-r.offsetTop),m.top="auto"}return(b=this.isMenuOffScreen(m,g)).left&&(m.left=p>g.width?d+p-g.width:d,delete m.right),b.top&&(m.top=v>g.height?u+v-g.height:u,delete m.bottom),this.getDocument().body.removeChild(s),m}},{key:"getContentEditableCaretPosition",value:function(t){var e,n=this.getWindowSelection();(e=this.getDocument().createRange()).setStart(n.anchorNode,t),e.setEnd(n.anchorNode,t),e.collapse(!1);var i=e.getBoundingClientRect(),s=document.documentElement,o=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),a=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),r={left:i.left+o,top:i.top+i.height+a},l=window.innerWidth,c=window.innerHeight,d=this.getMenuDimensions(),u=this.isMenuOffScreen(r,d);u.right&&(r.left="auto",r.right=l-i.left-o);var h=this.tribute.menuContainer?this.tribute.menuContainer.offsetHeight:this.getDocument().body.offsetHeight;if(u.bottom){var f=h-(c-(this.tribute.menuContainer?this.tribute.menuContainer.getBoundingClientRect():this.getDocument().body.getBoundingClientRect()).top);r.top="auto",r.bottom=f+(c-i.top)}return(u=this.isMenuOffScreen(r,d)).left&&(r.left=l>d.width?o+l-d.width:o,delete r.right),u.top&&(r.top=c>d.height?a+c-d.height:a,delete r.bottom),this.menuContainerIsBody||(r.left=r.left?r.left-this.tribute.menuContainer.offsetLeft:r.left,r.top=r.top?r.top-this.tribute.menuContainer.offsetTop:r.top),r}},{key:"scrollIntoView",value:function(t){var e,n=this.menu;if(void 0!==n){for(;void 0===e||0===e.height;)if(0===(e=n.getBoundingClientRect()).height&&(void 0===(n=n.childNodes[0])||!n.getBoundingClientRect))return;var i=e.top,s=i+e.height;if(i<0)window.scrollTo(0,window.pageYOffset+e.top-20);else if(s>window.innerHeight){var o=window.pageYOffset+e.top-20;o-window.pageYOffset>100&&(o=window.pageYOffset+100);var a=window.pageYOffset-(window.innerHeight-s);a>o&&(a=o),window.scrollTo(0,a)}}}},{key:"menuContainerIsBody",get:function(){return this.tribute.menuContainer===document.body||!this.tribute.menuContainer}}]),e}(),r=function(){function e(n){t(this,e),this.tribute=n,this.tribute.search=this}return n(e,[{key:"simpleFilter",value:function(t,e){var n=this;return e.filter((function(e){return n.test(t,e)}))}},{key:"test",value:function(t,e){return null!==this.match(t,e)}},{key:"match",value:function(t,e,n){n=n||{},e.length;var i=n.pre||"",s=n.post||"",o=n.caseSensitive&&e||e.toLowerCase();if(n.skip)return{rendered:e,score:0};t=n.caseSensitive&&t||t.toLowerCase();var a=this.traverse(o,t,0,0,[]);return a?{rendered:this.render(e,a.cache,i,s),score:a.score}:null}},{key:"traverse",value:function(t,e,n,i,s){if(e.length===i)return{score:this.calculateScore(s),cache:s.slice()};if(!(t.length===n||e.length-i>t.length-n)){for(var o,a,r=e[i],l=t.indexOf(r,n);l>-1;){if(s.push(l),a=this.traverse(t,e,l+1,i+1,s),s.pop(),!a)return o;(!o||o.score0&&(t[s-1]+1===i?n+=n+1:n=1),e+=n})),e}},{key:"render",value:function(t,e,n,i){var s=t.substring(0,e[0]);return e.forEach((function(o,a){s+=n+t[o]+i+t.substring(o+1,e[a+1]?e[a+1]:t.length)})),s}},{key:"filter",value:function(t,e,n){var i=this;return n=n||{},e.reduce((function(e,s,o,a){var r=s;n.extract&&((r=n.extract(s))||(r=""));var l=i.match(t,r,n);return null!=l&&(e[e.length]={string:l.rendered,score:l.score,index:o,original:s}),e}),[]).sort((function(t,e){return e.score-t.score||t.index-e.index}))}}]),e}();return function(){function e(n){var i,l=this,c=n.values,d=void 0===c?null:c,u=n.iframe,h=void 0===u?null:u,f=n.selectClass,m=void 0===f?"highlight":f,p=n.containerClass,v=void 0===p?"tribute-container":p,g=n.itemClass,b=void 0===g?"":g,w=n.trigger,x=void 0===w?"@":w,y=n.autocompleteMode,_=void 0!==y&&y,C=n.selectTemplate,k=void 0===C?null:C,M=n.menuItemTemplate,S=void 0===M?null:M,E=n.lookup,T=void 0===E?"key":E,A=n.fillAttr,$=void 0===A?"value":A,P=n.collection,L=void 0===P?null:P,z=n.menuContainer,I=void 0===z?null:z,N=n.noMatchTemplate,R=void 0===N?null:N,O=n.requireLeadingSpace,D=void 0===O||O,U=n.allowSpaces,j=void 0!==U&&U,F=n.replaceTextSuffix,H=void 0===F?null:F,B=n.positionMenu,W=void 0===B||B,q=n.spaceSelectsMatch,Y=void 0!==q&&q,V=n.searchOpts,K=void 0===V?{}:V,X=n.menuItemLimit,J=void 0===X?null:X,G=n.menuShowMinLength,Q=void 0===G?0:G;if(t(this,e),this.autocompleteMode=_,this.menuSelected=0,this.current={},this.inputEvent=!1,this.isActive=!1,this.menuContainer=I,this.allowSpaces=j,this.replaceTextSuffix=H,this.positionMenu=W,this.hasTrailingSpace=!1,this.spaceSelectsMatch=Y,this.autocompleteMode&&(x="",j=!1),d)this.collection=[{trigger:x,iframe:h,selectClass:m,containerClass:v,itemClass:b,selectTemplate:(k||e.defaultSelectTemplate).bind(this),menuItemTemplate:(S||e.defaultMenuItemTemplate).bind(this),noMatchTemplate:(i=R,"string"==typeof i?""===i.trim()?null:i:"function"==typeof i?i.bind(l):R||function(){return"
  • No Match Found!
  • "}.bind(l)),lookup:T,fillAttr:$,values:d,requireLeadingSpace:D,searchOpts:K,menuItemLimit:J,menuShowMinLength:Q}];else{if(!L)throw new Error("[Tribute] No collection specified.");this.autocompleteMode&&console.warn("Tribute in autocomplete mode does not work for collections"),this.collection=L.map((function(t){return{trigger:t.trigger||x,iframe:t.iframe||h,selectClass:t.selectClass||m,containerClass:t.containerClass||v,itemClass:t.itemClass||b,selectTemplate:(t.selectTemplate||e.defaultSelectTemplate).bind(l),menuItemTemplate:(t.menuItemTemplate||e.defaultMenuItemTemplate).bind(l),noMatchTemplate:function(t){return"string"==typeof t?""===t.trim()?null:t:"function"==typeof t?t.bind(l):R||function(){return"
  • No Match Found!
  • "}.bind(l)}(R),lookup:t.lookup||T,fillAttr:t.fillAttr||$,values:t.values,requireLeadingSpace:t.requireLeadingSpace,searchOpts:t.searchOpts||K,menuItemLimit:t.menuItemLimit||J,menuShowMinLength:t.menuShowMinLength||Q}}))}new a(this),new s(this),new o(this),new r(this)}return n(e,[{key:"triggers",value:function(){return this.collection.map((function(t){return t.trigger}))}},{key:"attach",value:function(t){if(!t)throw new Error("[Tribute] Must pass in a DOM node or NodeList.");if("undefined"!=typeof jQuery&&t instanceof jQuery&&(t=t.get()),t.constructor===NodeList||t.constructor===HTMLCollection||t.constructor===Array)for(var e=t.length,n=0;n",post:n.current.collection.searchOpts.post||"",skip:n.current.collection.searchOpts.skip,extract:function(t){if("string"==typeof n.current.collection.lookup)return t[n.current.collection.lookup];if("function"==typeof n.current.collection.lookup)return n.current.collection.lookup(t,n.current.mentionText);throw new Error("Invalid lookup attribute, lookup must be string or function.")}});n.current.collection.menuItemLimit&&(i=i.slice(0,n.current.collection.menuItemLimit)),n.current.filteredItems=i;var s=n.menu.querySelector("ul");if(n.range.positionMenuAtCaret(e),!i.length){var o=new CustomEvent("tribute-no-match",{detail:n.menu});return n.current.element.dispatchEvent(o),void("function"==typeof n.current.collection.noMatchTemplate&&!n.current.collection.noMatchTemplate()||!n.current.collection.noMatchTemplate?n.hideMenu():"function"==typeof n.current.collection.noMatchTemplate?s.innerHTML=n.current.collection.noMatchTemplate():s.innerHTML=n.current.collection.noMatchTemplate)}s.innerHTML="";var a=n.range.getDocument().createDocumentFragment();i.forEach((function(t,e){var i=n.range.getDocument().createElement("li");i.setAttribute("data-index",e),i.className=n.current.collection.itemClass,i.addEventListener("mousemove",(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],i=!0,s=!1,o=void 0;try{for(var a,r=t[Symbol.iterator]();!(i=(a=r.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return n}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(n._findLiTarget(t.target),2),i=(e[0],e[1]);0!==t.movementY&&n.events.setActiveLi(i)})),n.menuSelected===e&&i.classList.add(n.current.collection.selectClass),i.innerHTML=n.current.collection.menuItemTemplate(t),a.appendChild(i)})),s.appendChild(a)}};"function"==typeof this.current.collection.values?this.current.collection.values(this.current.mentionText,i):i(this.current.collection.values)}}},{key:"_findLiTarget",value:function(t){if(!t)return[];var e=t.getAttribute("data-index");return e?[t,e]:this._findLiTarget(t.parentNode)}},{key:"showMenuForCollection",value:function(t,e){t!==document.activeElement&&this.placeCaretAtEnd(t),this.current.collection=this.collection[e||0],this.current.externalTrigger=!0,this.current.element=t,t.isContentEditable?this.insertTextAtCursor(this.current.collection.trigger):this.insertAtCaret(t,this.current.collection.trigger),this.showMenuFor(t)}},{key:"placeCaretAtEnd",value:function(t){if(t.focus(),void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}else if(void 0!==document.body.createTextRange){var i=document.body.createTextRange();i.moveToElementText(t),i.collapse(!1),i.select()}}},{key:"insertTextAtCursor",value:function(t){var e,n;(n=(e=window.getSelection()).getRangeAt(0)).deleteContents();var i=document.createTextNode(t);n.insertNode(i),n.selectNodeContents(i),n.collapse(!1),e.removeAllRanges(),e.addRange(n)}},{key:"insertAtCaret",value:function(t,e){var n=t.scrollTop,i=t.selectionStart,s=t.value.substring(0,i),o=t.value.substring(t.selectionEnd,t.value.length);t.value=s+e+o,i+=e.length,t.selectionStart=i,t.selectionEnd=i,t.focus(),t.scrollTop=n}},{key:"hideMenu",value:function(){this.menu&&(this.menu.style.cssText="display: none;",this.isActive=!1,this.menuSelected=0,this.current={})}},{key:"selectItemAtIndex",value:function(t,e){if("number"==typeof(t=parseInt(t))&&!isNaN(t)){var n=this.current.filteredItems[t],i=this.current.collection.selectTemplate(n);null!==i&&this.replaceText(i,e,n)}}},{key:"replaceText",value:function(t,e,n){this.range.replaceTriggerText(t,!0,!0,e,n)}},{key:"_append",value:function(t,e,n){if("function"==typeof t.values)throw new Error("Unable to append to values, as it is a function.");t.values=n?e:t.values.concat(e)}},{key:"append",value:function(t,e,n){var i=parseInt(t);if("number"!=typeof i)throw new Error("please provide an index for the collection to update.");var s=this.collection[i];this._append(s,e,n)}},{key:"appendCurrent",value:function(t,e){if(!this.isActive)throw new Error("No active state. Please use append instead and pass an index.");this._append(this.current.collection,t,e)}},{key:"detach",value:function(t){if(!t)throw new Error("[Tribute] Must pass in a DOM node or NodeList.");if("undefined"!=typeof jQuery&&t instanceof jQuery&&(t=t.get()),t.constructor===NodeList||t.constructor===HTMLCollection||t.constructor===Array)for(var e=t.length,n=0;n'+(this.current.collection.trigger+t.original[this.current.collection.fillAttr])+"":this.current.collection.trigger+t.original[this.current.collection.fillAttr]}},{key:"defaultMenuItemTemplate",value:function(t){return t.string}},{key:"inputTypes",value:function(){return["TEXTAREA","INPUT"]}}]),e}()}()},6:function(t,e,n){t.exports=n("KqaD")},"8kIs":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.postPresenterContainer[data-v-4b5ccd81] {\n\tdisplay: flex;\n\talign-items: center;\n\tbackground: #fff;\n}\n.word-break[data-v-4b5ccd81] {\n\tword-break: break-all;\n}\n.small .custom-control-label[data-v-4b5ccd81] {\n\tpadding-top: 3px;\n}\n/*.reply-btn {\n\tposition: absolute;\n\tbottom: 30px;\n\tright: 20px;\n\twidth: 60px;\n\ttext-align: center;\n\tfont-size: 13px;\n\tborder-radius: 0 3px 3px 0;\n}*/\n.reply-btn[disabled][data-v-4b5ccd81] {\n\topacity: .3;\n\tcolor: #3897f0;\n}\n.replyModalTextarea[data-v-4b5ccd81] {\n\tborder: none;\n\tfont-size: 18px;\n\tresize: none;\n\twhite-space: pre-wrap;\n\toutline: none;\n}\n.has-story[data-v-4b5ccd81] {\n\twidth: 64px;\n\theight: 64px;\n\tborder-radius: 50%;\n\tpadding: 2px;\n\tbackground: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);\n}\n.has-story img[data-v-4b5ccd81] {\n\twidth: 60px;\n\theight: 60px;\n\tborder-radius: 50%;\n\tpadding: 3px;\n\tbackground: #fff;\n}\n.has-story.has-story-sm[data-v-4b5ccd81] {\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tpadding: 2px;\n\tbackground: radial-gradient(ellipse at 70% 70%, #ee583f 8%, #d92d77 42%, #bd3381 58%);\n}\n.has-story.has-story-sm img[data-v-4b5ccd81] {\n\twidth: 28px;\n\theight: 28px;\n\tborder-radius: 50%;\n\tpadding: 3px;\n\tbackground: #fff;\n}\n#ctx-reply-modal .form-control[data-v-4b5ccd81]:focus {\n\tborder: none;\n\toutline: 0;\n\tbox-shadow: none;\n}\n",""])},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,i=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var s,o=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(s=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(s)+")")}))}},"9wGH":function(t,e,n){"use strict";n.r(e);var i={props:["status"]},s=n("KHd+"),o=Object(s.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1==t.status.sensitive?n("div",[n("details",{staticClass:"details-animated"},[n("summary",[n("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),n("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),n("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:t.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},t._l(t.status.media_attachments,(function(t,e){return n("b-carousel-slide",{key:t.id+"-media"},[n("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",loop:"",alt:t.description,width:"100%",height:"100%",poster:t.preview_url},slot:"img"},[n("source",{attrs:{src:t.url,type:t.mime}})])])})),1)],1)]):n("div",[n("b-carousel",{staticStyle:{"text-shadow":"1px 1px 2px #333","background-color":"#000"},attrs:{id:t.status.id+"-carousel",controls:"","img-blank":"",background:"#ffffff",interval:0}},t._l(t.status.media_attachments,(function(t,e){return n("b-carousel-slide",{key:t.id+"-media"},[n("video",{staticClass:"embed-responsive-item",attrs:{slot:"img",preload:"none",controls:"",loop:"",alt:t.description,width:"100%",height:"100%",poster:t.preview_url},slot:"img"},[n("source",{attrs:{src:t.url,type:t.mime}})])])})),1)],1)}),[],!1,null,null,null);e.default=o.exports},BF29:function(t,e,n){var i=n("Oa72");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},BUee:function(t,e,n){var i=n("DAU9");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},DAU9:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n#storyContainer .story {\n\tmargin-right: 2rem;\n\twidth: 100%;\n\tmax-width: 60px;\n}\n.stories.carousel .story > .item-link > .item-preview {\n\theight: 60px;\n}\n#zuck-modal.with-effects {\n\twidth: 100%;\n}\n.stories.carousel .story > .item-link > .info .name {\n\tfont-weight: 500;\n\tfont-size: 11px;\n}\n.stories.carousel .story > .item-link > .info {\n}\n",""])},FAM0:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.emoji-reactions .nav-item[data-v-96c0cee2] {\n\tfont-size: 1.2rem;\n\tpadding: 9px;\n\tcursor: pointer;\n}\n.emoji-reactions[data-v-96c0cee2]::-webkit-scrollbar {\n\twidth: 0px;\n\theight: 0px;\n\tbackground: transparent;\n}\n",""])},HYYO:function(t,e,n){var i=n("8kIs");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var s=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[n].concat(o).concat([s]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},s=0;s-1:t.ctxEmbedShowCaption},on:{change:function(e){var n=t.ctxEmbedShowCaption,i=e.target,s=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.ctxEmbedShowCaption=n.concat([null])):o>-1&&(t.ctxEmbedShowCaption=n.slice(0,o).concat(n.slice(o+1)))}else t.ctxEmbedShowCaption=s}}}),t._v(" "),n("label",{staticClass:"form-check-label font-weight-light"},[t._v("\n\t\t\t\t\t\tShow Caption\n\t\t\t\t\t")])]),t._v(" "),n("div",{staticClass:"form-check mr-3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.ctxEmbedShowLikes,expression:"ctxEmbedShowLikes"}],staticClass:"form-check-input",attrs:{type:"checkbox",disabled:1==t.ctxEmbedCompactMode},domProps:{checked:Array.isArray(t.ctxEmbedShowLikes)?t._i(t.ctxEmbedShowLikes,null)>-1:t.ctxEmbedShowLikes},on:{change:function(e){var n=t.ctxEmbedShowLikes,i=e.target,s=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.ctxEmbedShowLikes=n.concat([null])):o>-1&&(t.ctxEmbedShowLikes=n.slice(0,o).concat(n.slice(o+1)))}else t.ctxEmbedShowLikes=s}}}),t._v(" "),n("label",{staticClass:"form-check-label font-weight-light"},[t._v("\n\t\t\t\t\t\tShow Likes\n\t\t\t\t\t")])]),t._v(" "),n("div",{staticClass:"form-check"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.ctxEmbedCompactMode,expression:"ctxEmbedCompactMode"}],staticClass:"form-check-input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.ctxEmbedCompactMode)?t._i(t.ctxEmbedCompactMode,null)>-1:t.ctxEmbedCompactMode},on:{change:function(e){var n=t.ctxEmbedCompactMode,i=e.target,s=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.ctxEmbedCompactMode=n.concat([null])):o>-1&&(t.ctxEmbedCompactMode=n.slice(0,o).concat(n.slice(o+1)))}else t.ctxEmbedCompactMode=s}}}),t._v(" "),n("label",{staticClass:"form-check-label font-weight-light"},[t._v("\n\t\t\t\t\t\tCompact Mode\n\t\t\t\t\t")])])]),t._v(" "),n("hr"),t._v(" "),n("button",{class:t.copiedEmbed?"btn btn-primary btn-block btn-sm py-1 font-weight-bold disabed":"btn btn-primary btn-block btn-sm py-1 font-weight-bold",attrs:{disabled:t.copiedEmbed},on:{click:t.ctxCopyEmbed}},[t._v(t._s(t.copiedEmbed?"Embed Code Copied!":"Copy Embed Code"))]),t._v(" "),n("p",{staticClass:"mb-0 px-2 small text-muted"},[t._v("By using this embed, you agree to our "),n("a",{attrs:{href:"/site/terms"}},[t._v("Terms of Use")])])])]),t._v(" "),n("b-modal",{ref:"ctxReport",attrs:{id:"ctx-report","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[n("p",{staticClass:"py-2 px-3 mb-0"}),n("div",{staticClass:"text-center font-weight-bold text-danger"},[t._v("Report")]),t._v(" "),n("div",{staticClass:"small text-center text-muted"},[t._v("Select one of the following options")]),t._v(" "),n("p"),t._v(" "),n("div",{staticClass:"list-group text-center"},[n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("spam")}}},[t._v("Spam")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("sensitive")}}},[t._v("Sensitive Content")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("abusive")}}},[t._v("Abusive or Harmful")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.openCtxReportOtherMenu()}}},[t._v("Other")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.ctxReportMenuGoBack()}}},[t._v("Cancel")])])]),t._v(" "),n("b-modal",{ref:"ctxReportOther",attrs:{id:"ctx-report-other","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[n("p",{staticClass:"py-2 px-3 mb-0"}),n("div",{staticClass:"text-center font-weight-bold text-danger"},[t._v("Report")]),t._v(" "),n("div",{staticClass:"small text-center text-muted"},[t._v("Select one of the following options")]),t._v(" "),n("p"),t._v(" "),n("div",{staticClass:"list-group text-center"},[n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("underage")}}},[t._v("Underage Account")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("copyright")}}},[t._v("Copyright Infringement")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("impersonation")}}},[t._v("Impersonation")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer font-weight-bold",on:{click:function(e){return t.sendReport("scam")}}},[t._v("Scam or Fraud")]),t._v(" "),n("div",{staticClass:"list-group-item rounded cursor-pointer text-lighter",on:{click:function(e){return t.ctxReportOtherMenuGoBack()}}},[t._v("Cancel")])])]),t._v(" "),n("b-modal",{ref:"ctxConfirm",attrs:{id:"ctx-confirm","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"sm","body-class":"list-group-flush p-0 rounded"}},[n("div",{staticClass:"d-flex align-items-center justify-content-center py-3"},[n("div",[t._v(t._s(this.confirmModalTitle))])]),t._v(" "),n("div",{staticClass:"d-flex border-top btn-group btn-group-block rounded-0",attrs:{role:"group"}},[n("button",{staticClass:"btn btn-outline-lighter border-left-0 border-top-0 border-bottom-0 border-right py-2",staticStyle:{color:"rgb(0,122,255) !important"},attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.confirmModalCancel()}}},[t._v("Cancel")]),t._v(" "),n("button",{staticClass:"btn btn-outline-lighter border-0",staticStyle:{color:"rgb(0,122,255) !important"},attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.confirmModalConfirm()}}},[t._v("Confirm")])])])],1)}),[],!1,null,null,null).exports;function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c={props:{status:{type:Object},recommended:{type:Boolean,default:!1},reactionBar:{type:Boolean,default:!0}},components:{"context-menu":r},data:function(){return{config:window.App.config,profile:{},loading:!0,replies:[],replyId:null,lightboxMedia:!1,showSuggestions:!0,showReadMore:!0,replyStatus:{},replyText:"",replyNsfw:!1,emoji:window.App.util.emoji,ctxMenuStatus:!1,ctxMenuRelationship:!1,ctxEmbedPayload:!1,copiedEmbed:!1,replySending:!1,ctxEmbedShowCaption:!0,ctxEmbedShowLikes:!1,ctxEmbedCompactMode:!1,confirmModalTitle:"Are you sure?",confirmModalIdentifer:null,confirmModalType:!1,tributeSettings:{collection:[{trigger:"@",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/mention",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){console.log(t)}))}},{trigger:"#",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/hashtag",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){console.log(t)}))}}]}}},mounted:function(){this.profile=window._sharedData.curUser},methods:(i={formatCount:function(t){return App.util.format.count(t)},statusUrl:function(t){return 1==t.local?t.url:"/i/web/post/_/"+t.account.id+"/"+t.id},profileUrl:function(t){return 1==t.local?t.account.url:"/i/web/profile/_/"+t.account.id},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},statusCardUsernameFormat:function(t){if(1==t.account.local)return t.account.username;var e=window.App.config.username.remote.format,n=window.App.config.username.remote.custom,i=t.account.username,s=document.createElement("a");switch(s.href=t.account.url,s=s.hostname,e){case"@":return i+'@'+s+"";case"from":return i+' from '+s+"";case"custom":return i+' '+n+" "+s+"";default:return i+'@'+s+""}},lightbox:function(t){window.location.href=t.media_attachments[0].url},labelRedirect:function(t){var e="/i/redirect?url="+encodeURI(this.config.features.label.covid.url);window.location.href=e},likeStatus:function(t,e){if(0!=$("body").hasClass("loggedIn")){var n=t.favourites_count;t.favourited=!t.favourited,axios.post("/i/like",{item:t.id}).then((function(e){t.favourites_count=e.data.count})).catch((function(e){t.favourited=!t.favourited,t.favourites_count=n,swal("Error","Something went wrong, please try again later.","error")})),window.navigator.vibrate(200),t.favourited&&setTimeout((function(){e.target.classList.add("animate__animated","animate__bounce")}),100)}},commentFocus:function(t,e){this.$emit("comment-focus",t)},muteProfile:function(t){var e=this;0!=$("body").hasClass("loggedIn")&&axios.post("/i/mute",{type:"user",item:t.account.id}).then((function(n){e.feed=e.feed.filter((function(e){return e.account.id!==t.account.id})),swal("Success","You have successfully muted "+t.account.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},blockProfile:function(t){var e=this;0!=$("body").hasClass("loggedIn")&&axios.post("/i/block",{type:"user",item:t.account.id}).then((function(n){e.feed=e.feed.filter((function(e){return e.account.id!==t.account.id})),swal("Success","You have successfully blocked "+t.account.acct,"success")})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},deletePost:function(t){var e=this;0!=$("body").hasClass("loggedIn")&&0!=this.ownerOrAdmin(t)&&0!=window.confirm("Are you sure you want to delete this post?")&&axios.post("/i/delete",{type:"status",item:t.id}).then((function(n){e.$emit("status-delete",t.id),e.closeModals()})).catch((function(t){swal("Error","Something went wrong. Please try again later.","error")}))},commentSubmit:function(t,e){var n=this;this.replySending=!0;var i=t.id,s=this.replyText,o=this.config.uploader.max_caption_length;if(s.length>o)return this.replySending=!1,void swal("Comment Too Long","Please make sure your comment is "+o+" characters or less.","error");axios.post("/i/comment",{item:i,comment:s,sensitive:this.replyNsfw}).then((function(t){n.replyText="",n.replies.push(t.data.entity),n.$refs.replyModal.hide()})),this.replySending=!1},moderatePost:function(t,e,n){var i=this,s=(t.account.username,""),o=this;switch(e){case"addcw":s="Are you sure you want to add a content warning to this post?",swal({title:"Confirm",text:s,icon:"warning",buttons:!0,dangerMode:!0}).then((function(n){n&&axios.post("/api/v2/moderator/action",{action:e,item_id:t.id,item_type:"status"}).then((function(e){swal("Success","Successfully added content warning","success"),t.sensitive=!0,o.ctxModMenuClose()})).catch((function(t){swal("Error","Something went wrong, please try again later.","error"),o.ctxModMenuClose()}))}));break;case"remcw":s="Are you sure you want to remove the content warning on this post?",swal({title:"Confirm",text:s,icon:"warning",buttons:!0,dangerMode:!0}).then((function(n){n&&axios.post("/api/v2/moderator/action",{action:e,item_id:t.id,item_type:"status"}).then((function(e){swal("Success","Successfully added content warning","success"),t.sensitive=!1,o.ctxModMenuClose()})).catch((function(t){swal("Error","Something went wrong, please try again later.","error"),o.ctxModMenuClose()}))}));break;case"unlist":s="Are you sure you want to unlist this post?",swal({title:"Confirm",text:s,icon:"warning",buttons:!0,dangerMode:!0}).then((function(n){n&&axios.post("/api/v2/moderator/action",{action:e,item_id:t.id,item_type:"status"}).then((function(e){i.feed=i.feed.filter((function(e){return e.id!=t.id})),swal("Success","Successfully unlisted post","success"),o.ctxModMenuClose()})).catch((function(t){o.ctxModMenuClose(),swal("Error","Something went wrong, please try again later.","error")}))}))}},followAction:function(t){var e=this,n=t.account.id;axios.post("/i/follow",{item:n}).then((function(i){e.feed.forEach((function(t){t.account.id==n&&(t.account.relationship.following=!t.account.relationship.following)}));var s=t.account.acct;t.account.relationship.following?swal("Follow successful!","You are now following "+s,"success"):swal("Unfollow successful!","You are no longer following "+s,"success")})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},owner:function(t){return this.profile.id===t.account.id},admin:function(){return 1==this.profile.is_admin},ownerOrAdmin:function(t){return this.owner(t)||this.admin()},ctxMenu:function(){this.$refs.contextMenu.open()},closeCtxMenu:function(t){this.copiedEmbed=!1,this.ctxMenuStatus=!1,this.ctxMenuRelationship=!1,this.$refs.ctxModal.hide(),this.$refs.ctxReport.hide(),this.$refs.ctxReportOther.hide(),this.closeModals()},ctxMenuCopyLink:function(){var t=this.ctxMenuStatus;navigator.clipboard.writeText(t.url),this.closeModals()},ctxMenuGoToPost:function(){var t=this.ctxMenuStatus;window.location.href=this.statusUrl(t),this.closeCtxMenu()},ctxMenuFollow:function(){var t=this,e=this.ctxMenuStatus.account.id;axios.post("/i/follow",{item:e}).then((function(e){var n=t.ctxMenuStatus.account.acct;t.closeCtxMenu(),setTimeout((function(){swal("Follow successful!","You are now following "+n,"success")}),500)}))},ctxMenuUnfollow:function(){var t=this,e=this.ctxMenuStatus.account.id;axios.post("/i/follow",{item:e}).then((function(e){var n=t.ctxMenuStatus.account.acct;"home"==t.scope&&(t.feed=t.feed.filter((function(e){return e.account.id!=t.ctxMenuStatus.account.id}))),t.closeCtxMenu(),setTimeout((function(){swal("Unfollow successful!","You are no longer following "+n,"success")}),500)}))},ctxMenuReportPost:function(){this.$refs.ctxModal.hide(),this.$refs.ctxReport.show()},ctxMenuEmbed:function(){this.closeModals(),this.$refs.ctxEmbedModal.show()},ctxMenuShare:function(){this.$refs.ctxModal.hide(),this.$refs.ctxShareModal.show()},closeCtxShareMenu:function(){this.$refs.ctxShareModal.hide(),this.$refs.ctxModal.show()},ctxCopyEmbed:function(){navigator.clipboard.writeText(this.ctxEmbedPayload),this.ctxEmbedShowCaption=!0,this.ctxEmbedShowLikes=!1,this.ctxEmbedCompactMode=!1,this.$refs.ctxEmbedModal.hide()},ctxModMenuShow:function(){this.$refs.ctxModal.hide(),this.$refs.ctxModModal.show()},ctxModOtherMenuShow:function(){this.$refs.ctxModal.hide(),this.$refs.ctxModModal.hide(),this.$refs.ctxModOtherModal.show()},ctxModMenu:function(){this.$refs.ctxModal.hide()},ctxModMenuClose:function(){this.closeModals(),this.$refs.ctxModal.show()},ctxModOtherMenuClose:function(){this.closeModals(),this.$refs.ctxModModal.show()}},l(i,"formatCount",(function(t){return App.util.format.count(t)})),l(i,"openCtxReportOtherMenu",(function(){var t=this.ctxMenuStatus;this.closeCtxMenu(),this.ctxMenuStatus=t,this.$refs.ctxReportOther.show()})),l(i,"ctxReportMenuGoBack",(function(){this.$refs.ctxReportOther.hide(),this.$refs.ctxReport.hide(),this.$refs.ctxModal.show()})),l(i,"ctxReportOtherMenuGoBack",(function(){this.$refs.ctxReportOther.hide(),this.$refs.ctxModal.hide(),this.$refs.ctxReport.show()})),l(i,"sendReport",(function(t){var e=this,n=this.ctxMenuStatus.id;swal({title:"Confirm Report",text:"Are you sure you want to report this post?",icon:"warning",buttons:!0,dangerMode:!0}).then((function(i){i?axios.post("/i/report/",{report:t,type:"post",id:n}).then((function(t){e.closeCtxMenu(),swal("Report Sent!","We have successfully received your report.","success")})).catch((function(t){swal("Oops!","There was an issue reporting this post.","error")})):e.closeCtxMenu()}))})),l(i,"closeModals",(function(){this.$refs.ctxModal.hide(),this.$refs.ctxModModal.hide(),this.$refs.ctxModOtherModal.hide(),this.$refs.ctxShareModal.hide(),this.$refs.ctxEmbedModal.hide(),this.$refs.ctxReport.hide(),this.$refs.ctxReportOther.hide(),this.$refs.ctxConfirm.hide(),this.$refs.lightboxModal.hide(),this.$refs.replyModal.hide(),this.$refs.ctxStatusModal.hide()})),l(i,"openCtxStatusModal",(function(){this.closeModals(),this.$refs.ctxStatusModal.show()})),l(i,"openConfirmModal",(function(){this.closeModals(),this.$refs.ctxConfirm.show()})),l(i,"closeConfirmModal",(function(){this.closeModals(),this.confirmModalTitle="Are you sure?",this.confirmModalType=!1,this.confirmModalIdentifer=null})),l(i,"confirmModalConfirm",(function(){var t=this;switch(this.confirmModalType){case"post.delete":axios.post("/i/delete",{type:"status",item:this.confirmModalIdentifer}).then((function(e){t.feed=t.feed.filter((function(e){return e.id!=t.confirmModalIdentifer})),t.closeConfirmModal()})).catch((function(e){t.closeConfirmModal(),swal("Error","Something went wrong. Please try again later.","error")}))}this.closeConfirmModal()})),l(i,"confirmModalCancel",(function(){this.closeConfirmModal()})),l(i,"timeAgo",(function(t){return App.util.format.timeAgo(t)})),i)},d=Object(a.a)(c,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border"},[t.status?n("div",{staticClass:"card-header d-inline-flex align-items-center bg-white"},[n("div",[n("img",{staticClass:"rounded-circle box-shadow",attrs:{src:t.status.account.avatar,width:"32px",height:"32px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})]),t._v(" "),n("div",{staticClass:"pl-2"},[n("a",{staticClass:"username font-weight-bold text-dark text-decoration-none text-break",attrs:{href:t.profileUrl(t.status)},domProps:{innerHTML:t._s(t.statusCardUsernameFormat(t.status))}},[t._v("\n\t\t\t\t\tLoading...\n\t\t\t\t")]),t._v(" "),t.status.account.is_admin?n("span",{staticClass:"fa-stack",staticStyle:{height:"1em","line-height":"1em","max-width":"19px"},attrs:{title:"Admin Account","data-toggle":"tooltip"}},[n("i",{staticClass:"fas fa-certificate text-danger fa-stack-1x"}),t._v(" "),n("i",{staticClass:"fas fa-crown text-white fa-sm fa-stack-1x",staticStyle:{"font-size":"7px"}})]):t._e(),t._v(" "),n("div",{staticClass:"d-flex align-items-center"},[t.status.place?n("a",{staticClass:"small text-decoration-none text-muted",attrs:{href:"/discover/places/"+t.status.place.id+"/"+t.status.place.slug,title:"Location","data-toggle":"tooltip"}},[n("i",{staticClass:"fas fa-map-marked-alt"}),t._v(" "+t._s(t.status.place.name)+", "+t._s(t.status.place.country))]):t._e()])]),t._v(" "),n("div",{staticClass:"text-right",staticStyle:{"flex-grow":"1"}},[n("button",{staticClass:"btn btn-link text-dark py-0",attrs:{type:"button"},on:{click:function(e){return t.ctxMenu()}}},[n("span",{staticClass:"fas fa-ellipsis-h text-lighter"}),t._v(" "),n("span",{staticClass:"sr-only"},[t._v("Post Menu")])])])]):t._e(),t._v(" "),n("div",{staticClass:"postPresenterContainer",staticStyle:{background:"#000"}},[t.config.ab.top&&"text"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("div",{staticClass:"w-100 card-img-top border-bottom rounded-0",staticStyle:{"background-image":"url(/storage/textimg/bg_1.jpg)","background-size":"cover",width:"100%",height:"540px"}},[n("div",{staticClass:"w-100 h-100 d-flex justify-content-center align-items-center"},[n("p",{staticClass:"text-center text-break h3 px-5 font-weight-bold",domProps:{innerHTML:t._s(t.status.content)}})])])]):"photo"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("photo-presenter",{attrs:{status:t.status},on:{lightbox:t.lightbox,togglecw:function(e){t.status.sensitive=!1}}})],1):"video"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("video-presenter",{attrs:{status:t.status}})],1):"photo:album"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("photo-album-presenter",{attrs:{status:t.status},on:{lightbox:t.lightbox}})],1):"video:album"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("video-album-presenter",{attrs:{status:t.status}})],1):"photo:video:album"===t.status.pf_type?n("div",{staticClass:"w-100"},[n("mixed-album-presenter",{attrs:{status:t.status},on:{lightbox:t.lightbox}})],1):n("div",{staticClass:"w-100"},[n("p",{staticClass:"text-center p-0 font-weight-bold text-white"},[t._v("Error: Problem rendering preview.")])])]),t._v(" "),t.config.features.label.covid.enabled&&t.status.label&&1==t.status.label.covid?n("div",{staticClass:"card-body border-top border-bottom py-2 cursor-pointer pr-2",on:{click:function(e){return t.labelRedirect()}}},[n("p",{staticClass:"font-weight-bold d-flex justify-content-between align-items-center mb-0"},[n("span",[n("i",{staticClass:"fas fa-info-circle mr-2"}),t._v("\n\t\t\t\t\tFor information about COVID-19, "+t._s(t.config.features.label.covid.org)+"\n\t\t\t\t")]),t._v(" "),t._m(0)])]):t._e(),t._v(" "),n("div",{staticClass:"card-body"},[t.reactionBar?n("div",{staticClass:"reactions my-1 pb-2"},[t.status.favourited?n("h3",{staticClass:"fas fa-heart text-danger pr-3 m-0 cursor-pointer",attrs:{title:"Like"},on:{click:function(e){return t.likeStatus(t.status,e)}}}):n("h3",{staticClass:"far fa-heart pr-3 m-0 like-btn text-dark cursor-pointer",attrs:{title:"Like"},on:{click:function(e){return t.likeStatus(t.status,e)}}}),t._v(" "),t.status.comments_disabled?t._e():n("h3",{staticClass:"far fa-comment text-dark pr-3 m-0 cursor-pointer",attrs:{title:"Comment"},on:{click:function(e){return t.commentFocus(t.status,e)}}}),t._v(" "),t.status.taggedPeople.length?n("span",{staticClass:"float-right"},[n("span",{staticClass:"font-weight-light small",staticStyle:{color:"#718096"}},[n("i",{staticClass:"far fa-user",attrs:{"data-toggle":"tooltip",title:"Tagged People"}}),t._v(" "),t._l(t.status.taggedPeople,(function(t,e){return n("span",{staticClass:"mr-n2"},[n("a",{attrs:{href:"/"+t.username}},[n("img",{staticClass:"border rounded-circle",attrs:{src:t.avatar,width:"20px",height:"20px","data-toggle":"tooltip",title:"@"+t.username,alt:"Avatar"}})])])}))],2)]):t._e()]):t._e(),t._v(" "),t.status.liked_by.username&&t.status.liked_by.username!==t.profile.username?n("div",{staticClass:"likes mb-1"},[n("span",{staticClass:"like-count"},[t._v("Liked by\n\t\t\t\t\t"),n("a",{staticClass:"font-weight-bold text-dark",attrs:{href:t.status.liked_by.url}},[t._v(t._s(t.status.liked_by.username))]),t._v(" "),1==t.status.liked_by.others?n("span",[t._v("\n\t\t\t\t\t\tand "),t.status.liked_by.total_count_pretty?n("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.status.liked_by.total_count_pretty))]):t._e(),t._v(" "),n("span",{staticClass:"font-weight-bold"},[t._v("others")])]):t._e()])]):t._e(),t._v(" "),"text"!=t.status.pf_type?n("div",{staticClass:"caption"},[t.status.sensitive?t._e():n("p",{staticClass:"mb-2 read-more",staticStyle:{overflow:"hidden"}},[n("span",{staticClass:"username font-weight-bold"},[n("bdi",[n("a",{staticClass:"text-dark",attrs:{href:t.profileUrl(t.status)}},[t._v(t._s(t.status.account.username))])])]),t._v(" "),n("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}})])]):t._e(),t._v(" "),n("div",{staticClass:"timestamp mt-2"},[n("p",{staticClass:"small mb-0"},[n("a",{staticClass:"text-muted text-uppercase",attrs:{href:t.statusUrl(t.status)}},[n("timeago",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],attrs:{datetime:t.status.created_at,"auto-update":60,"converter-options":{includeSeconds:!0},title:t.timestampFormat(t.status.created_at)}})],1),t._v(" "),t.recommended?n("span",[n("span",{staticClass:"px-1"},[t._v("·")]),t._v(" "),n("span",{staticClass:"text-muted"},[t._v("Based on popular and trending content")])]):t._e()])])])]),t._v(" "),n("context-menu",{ref:"contextMenu",attrs:{status:t.status,profile:t.profile}})],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("span",[e("i",{staticClass:"fas fa-chevron-right text-lighter"})])}],!1,null,null,null).exports,u={props:["status","profile"],components:{"context-menu":r},data:function(){return{ids:[],config:window.App.config,tributeSettings:{collection:[{trigger:"@",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/mention",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){console.log(t)}))}},{trigger:"#",menuShowMinLength:2,values:function(t,e){axios.get("/api/compose/v0/search/hashtag",{params:{q:t}}).then((function(t){e(t.data)})).catch((function(t){console.log(t)}))}}]},replies:[],replyId:null,replyText:"",replyNsfw:!1,replySending:!1,pagination:{},ctxMenuStatus:!1,emoji:window.App.util.emoji}},beforeMount:function(){this.fetchComments()},methods:{commentNavigateBack:function(t){$("nav").show(),$("footer").show(),$(".mobile-footer-spacer").attr("style","display:block"),$(".mobile-footer").attr("style","display:block"),this.$emit("current-layout","feed");window.history.pushState({},"","/")},trimCaption:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;return _.truncate(t,{length:e})},replyFocus:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!=$("body").hasClass("loggedIn")){if(!this.status.comments_disabled){this.replyToIndex=e,this.replyingToId=t.id,this.replyingToUsername=t.account.username,this.reply_to_profile_id=t.account.id;var i=t.account.local?"@"+t.account.username+" ":"@"+t.account.acct+" ";1==n&&(this.replyText=i),this.$refs.replyModal.show(),setTimeout((function(){$(".replyModalTextarea").focus()}),500)}}else this.redirect("/login?next="+encodeURIComponent(window.location.pathname))},commentSubmit:function(t,e){var n=this;this.replySending=!0;var i=t.id,s=this.replyText,o=this.config.uploader.max_caption_length;if(s.length>o)return this.replySending=!1,void swal("Comment Too Long","Please make sure your comment is "+o+" characters or less.","error");axios.post("/i/comment",{item:i,comment:s,sensitive:this.replyNsfw}).then((function(t){n.replyText="",n.replies.push(t.data.entity),n.$refs.replyModal.hide()})),this.replySending=!1},timeAgo:function(t){return App.util.format.timeAgo(t)},fetchComments:function(){var t=this;console.log("Fetching comments...");var e="/api/v2/comments/"+this.status.account.id+"/status/"+this.status.id;axios.get(e).then((function(e){t.replies=e.data.data,t.pagination=e.data.meta.pagination})).catch((function(t){if(t.response)switch(t.response.status){case 401:$(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("Please login to view.");break;default:$(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("An error occurred, cannot fetch comments. Please try again later.")}else $(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("An error occurred, cannot fetch comments. Please try again later.")}))},loadMoreComments:function(){var t=this;if(1!=this.pagination.total_pages&&this.pagination.current_page!=this.pagination.total_pages){$(".load-more-link").addClass("d-none"),$(".postCommentsLoader").removeClass("d-none");var e=this.pagination.links.next;axios.get(e).then((function(e){var n=e.data.data;$(".postCommentsLoader").addClass("d-none");for(var i=0;i0?n("div",{staticClass:"cursor-pointer pb-2",on:{click:function(n){return t.toggleReplies(e)}}},[n("span",{staticClass:"show-reply-bar"}),t._v(" "),n("span",{staticClass:"comment-reaction small font-weight-bold"},[t._v(t._s(e.thread?"Hide":"View")+" Replies ("+t._s(e.reply_count)+")")])]):t._e(),t._v(" "),1==e.thread?n("div",{staticClass:"comment-thread"},t._l(e.replies,(function(e,s){return n("div",{key:"cr"+e.id+"_"+i,staticClass:"py-1 media"},[n("img",{staticClass:"rounded-circle border mr-3",attrs:{src:e.account.avatar,width:"25px",height:"25px"}}),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"d-flex justify-content-between align-items-top read-more mb-0",staticStyle:{"overflow-y":"hidden"}},[n("span",{staticClass:"mr-2",staticStyle:{"font-size":"13px"}},[n("a",{staticClass:"text-dark font-weight-bold mr-1",attrs:{href:e.account.url,title:e.account.username}},[t._v(t._s(e.account.username))]),t._v(" "),n("span",{staticClass:"text-break comment-body",staticStyle:{"word-break":"break-all"},domProps:{innerHTML:t._s(e.content)}})]),t._v(" "),n("span",[n("span",{on:{click:function(n){return t.likeReply(e,n)}}},[n("i",{class:[e.favourited?"fas fa-heart fa-sm text-danger":"far fa-heart fa-sm text-lighter"]})])])]),t._v(" "),n("p",{staticClass:"mb-0"},[t._o(n("a",{staticClass:"text-muted mr-3 text-decoration-none small",staticStyle:{width:"20px"},attrs:{href:e.url},domProps:{textContent:t._s(t.timeAgo(e.created_at))}}),1,"cr"+e.id+"_"+i),t._v(" "),e.favourites_count?n("span",{staticClass:"text-muted comment-reaction font-weight-bold mr-3"},[t._v(t._s(1==e.favourites_count?"1 like":e.favourites_count+" likes"))]):t._e()])])])})),0):t._e()])])]):t._e()})),t._v(" "),t.replies.length?t._e():n("div",[n("p",{staticClass:"text-center text-muted font-weight-bold small"},[t._v("No comments yet")])])],2)]),t._v(" "),n("div",{staticClass:"card-footer mb-3"},[n("div",{staticClass:"align-middle d-flex"},[n("img",{staticClass:"rounded-circle border mr-3",attrs:{src:t.profile.avatar,width:"36",height:"36"}}),t._v(" "),n("textarea",{staticClass:"form-control rounded-pill",staticStyle:{resize:"none","overflow-y":"hidden"},attrs:{name:"comment",placeholder:"Add a comment…",autocomplete:"off",autocorrect:"off",rows:"1",maxlength:"0"},on:{click:function(e){return t.replyFocus(t.status)}}})])])])])])]),t._v(" "),n("context-menu",{ref:"cMenu",attrs:{status:t.ctxMenuStatus,profile:t.profile}}),t._v(" "),n("b-modal",{ref:"replyModal",attrs:{id:"ctx-reply-modal","hide-footer":"",centered:"",rounded:"","title-html":t.status.account?"Reply to "+t.status.account.username+"":"","title-tag":"p","title-class":"font-weight-bold text-muted",size:"md","body-class":"p-2 rounded"}},[n("div",[n("vue-tribute",{attrs:{options:t.tributeSettings}},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.replyText,expression:"replyText"}],staticClass:"form-control replyModalTextarea",attrs:{rows:"4"},domProps:{value:t.replyText},on:{input:function(e){e.target.composing||(t.replyText=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"border-top border-bottom my-2"},[n("ul",{staticClass:"nav align-items-center emoji-reactions",staticStyle:{"overflow-x":"scroll","flex-wrap":"unset"}},t._l(t.emoji,(function(e){return n("li",{staticClass:"nav-item",on:{click:function(e){return t.emojiReaction(t.status)}}},[t._v(t._s(e))])})),0)]),t._v(" "),n("div",{staticClass:"d-flex justify-content-between align-items-center"},[n("div",[n("span",{staticClass:"pl-2 small text-muted font-weight-bold text-monospace"},[n("span",{class:[t.replyText.length>t.config.uploader.max_caption_length?"text-danger":"text-dark"]},[t._v(t._s(t.replyText.length>t.config.uploader.max_caption_length?t.config.uploader.max_caption_length-t.replyText.length:t.replyText.length))]),t._v("/"+t._s(t.config.uploader.max_caption_length)+"\n\t\t\t\t\t")])]),t._v(" "),n("div",{staticClass:"d-flex align-items-center"},[n("div",{staticClass:"custom-control custom-switch mr-3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.replyNsfw,expression:"replyNsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"replyModalCWSwitch"},domProps:{checked:Array.isArray(t.replyNsfw)?t._i(t.replyNsfw,null)>-1:t.replyNsfw},on:{change:function(e){var n=t.replyNsfw,i=e.target,s=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.replyNsfw=n.concat([null])):o>-1&&(t.replyNsfw=n.slice(0,o).concat(n.slice(o+1)))}else t.replyNsfw=s}}}),t._v(" "),n("label",{class:[t.replyNsfw?"custom-control-label font-weight-bold text-dark":"custom-control-label text-lighter"],attrs:{for:"replyModalCWSwitch"}},[t._v("Mark as NSFW")])]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-2 px-4 lead text-uppercase font-weight-bold",attrs:{disabled:0==t.replyText.length},on:{click:function(e){return e.preventDefault(),t.commentSubmit(t.status,e)}}},[t._v("\n\t\t\t\t\t\t"+t._s(1==t.replySending?"POSTING":"POST")+"\n\t\t\t\t\t")])])])],1)])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("p",{staticClass:"font-weight-bold mb-0 h5"},[this._v("Comments")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("i",{staticClass:"fas fa-cog fa-lg text-white"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"postCommentsLoader text-center py-2"},[e("div",{staticClass:"spinner-border",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])])}],!1,null,"96c0cee2",null).exports);function f(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n40&&(this.loading=!1,t.complete());var n=!1;switch(this.scope){case"home":n="/api/pixelfed/v1/timelines/home";break;case"local":n="/api/pixelfed/v1/timelines/public";break;case"network":n="/api/pixelfed/v1/timelines/network"}axios.get(n,{params:{max_id:this.max_id,limit:6,recent_feed:this.recentFeed}}).then((function(n){if(n.data.length&&0==e.loading){var i=n.data,s=e;if(s.recentFeed&&-1!=s.ids.indexOf(i[0].id))return e.loading=!1,void t.complete();i.forEach((function(t,e){-1==s.ids.indexOf(t.id)&&(s.feed.push(t),s.ids.push(t.id))})),e.min_id=Math.max.apply(Math,f(e.ids)).toString(),e.max_id=Math.min.apply(Math,f(e.ids)).toString(),e.page+=1,t.loaded(),e.loading=!1}else t.complete()})).catch((function(n){e.loading=!1,t.complete()}))}},reportUrl:function(t){return"/i/report?type="+(t.in_reply_to?"comment":"post")+"&id="+t.id},commentFocus:function(t,e){t.comments_disabled||(this.status=t,this.replies={},this.replyStatus={},this.replyText="",this.replyId=t.id,this.replyStatus=t,this.fetchStatusComments(t,""),$("nav").hide(),$("footer").hide(),$(".mobile-footer-spacer").attr("style","display:none !important"),$(".mobile-footer").attr("style","display:none !important"),this.currentLayout="comments",window.history.pushState({},"",this.statusUrl(t)))},commentNavigateBack:function(t){$("nav").show(),$("footer").show(),$(".mobile-footer-spacer").attr("style","display:block"),$(".mobile-footer").attr("style","display:block"),this.currentLayout="feed";var e="home"==this.scope?"/":"/timeline/public";window.history.pushState({},"",e)},likeStatus:function(t,e){if(0!=$("body").hasClass("loggedIn")){var n=t.favourites_count;t.favourited=!t.favourited,axios.post("/i/like",{item:t.id}).then((function(e){t.favourites_count=e.data.count})).catch((function(e){t.favourited=!t.favourited,t.favourites_count=n,swal("Error","Something went wrong, please try again later.","error")})),window.navigator.vibrate(200),t.favourited&&setTimeout((function(){e.target.classList.add("animate__animated","animate__bounce")}),100)}},shareStatus:function(t,e){0!=$("body").hasClass("loggedIn")&&(this.closeModals(),axios.post("/i/share",{item:t.id}).then((function(e){t.reblogs_count=e.data.count,t.reblogged=!t.reblogged,t.reblogged?swal("Success","You shared this post","success"):swal("Success","You unshared this post","success")})).catch((function(t){swal("Error","Something went wrong, please try again later.","error")})))},timestampFormat:function(t){var e=new Date(t);return e.toDateString()+" "+e.toLocaleTimeString()},redirect:function(t){window.location.href=t},statusOwner:function(t){return t.account.id==this.profile.id},fetchStatusComments:function(t,e){var n=this,i="/api/v2/comments/"+t.account.id+"/status/"+t.id;axios.get(i).then((function(t){n.replies=_.reverse(t.data.data),n.pagination=t.data.meta.pagination,n.replies.length>0&&$(".load-more-link").removeClass("d-none"),$(".postCommentsLoader").addClass("d-none"),$(".postCommentsContainer").removeClass("d-none")})).catch((function(t){if(t.response)switch(t.response.status){case 401:$(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("Please login to view.");break;default:$(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("An error occurred, cannot fetch comments. Please try again later.")}else $(".postCommentsLoader .lds-ring").attr("style","width:100%").addClass("pt-4 font-weight-bold text-muted").text("An error occurred, cannot fetch comments. Please try again later.")}))},followingModal:function(){var t=this;this.following.length>0||(axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/following",{params:{page:this.followingCursor}}).then((function(e){t.following=e.data,t.followingCursor++})),res.data.length<10&&(this.followingMore=!1)),this.$refs.followingModal.show()},followersModal:function(){var t=this;this.followers.length>0||(axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/followers",{params:{page:this.followerCursor}}).then((function(e){t.followers=e.data,t.followerCursor++})),res.data.length<10&&(this.followerMore=!1)),this.$refs.followerModal.show()},followingLoadMore:function(){var t=this;axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/following",{params:{page:this.followingCursor}}).then((function(e){var n;e.data.length>0&&((n=t.following).push.apply(n,f(e.data)),t.followingCursor++);e.data.length<10&&(t.followingMore=!1)}))},followersLoadMore:function(){var t=this;axios.get("/api/pixelfed/v1/accounts/"+this.profile.id+"/followers",{params:{page:this.followerCursor}}).then((function(e){var n;e.data.length>0&&((n=t.followers).push.apply(n,f(e.data)),t.followerCursor++);e.data.length<10&&(t.followerMore=!1)}))},lightbox:function(t){window.location.href=t.media_attachments[0].url},expLc:function(t){return 0==this.config.ab.lc||1==this.statusOwner(t)},expRec:function(){var t=this;0!=this.config.ab.rec&&axios.get("/api/local/exp/rec").then((function(e){t.suggestions=e.data}))},expRecFollow:function(t,e){},followAction:function(t){var e=this,n=t.account.id;axios.post("/i/follow",{item:n}).then((function(i){e.feed.forEach((function(t){t.account.id==n&&(t.account.relationship.following=!t.account.relationship.following)}));var s=t.account.acct;t.account.relationship.following?swal("Follow successful!","You are now following "+s,"success"):swal("Unfollow successful!","You are no longer following "+s,"success")})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},owner:function(t){return this.profile.id===t.account.id},admin:function(){return 1==this.profile.is_admin},ownerOrAdmin:function(t){return this.owner(t)||this.admin()},hideSuggestions:function(){localStorage.setItem("pf_metro_ui.exp.rec",!1),this.showSuggestions=!1},emojiReaction:function(t){var e=event.target.innerText;0==this.replyText.length?(this.replyText=e+" ",$('textarea[name="comment"]').focus()):(this.replyText+=e+" ",$('textarea[name="comment"]').focus())},refreshSuggestions:function(){},fetchHashtagPosts:function(){var t=this;axios.get("/api/local/discover/tag/list").then((function(e){var n=e.data;if(0!=n.length){var i=n[Math.floor(Math.random(),n.length)];t.hashtagPostsName=i,axios.get("/api/v2/discover/tag",{params:{hashtag:i}}).then((function(e){e.data.tags.length>3&&(t.showHashtagPosts=!0,t.hashtagPosts=e.data.tags.splice(0,3))}))}}))},ctxCopyEmbed:function(){navigator.clipboard.writeText(this.ctxEmbedPayload),this.ctxEmbedShowCaption=!0,this.ctxEmbedShowLikes=!1,this.ctxEmbedCompactMode=!1,this.$refs.ctxEmbedModal.hide()},formatCount:function(t){return App.util.format.count(t)},statusUrl:function(t){return 1==t.local?t.url:"/i/web/post/_/"+t.account.id+"/"+t.id},profileUrl:function(t){return 1==t.local?t.account.url:"/i/web/profile/_/"+t.account.id},statusCardUsernameFormat:function(t){if(1==t.account.local)return t.account.username;var e=window.App.config.username.remote.format,n=window.App.config.username.remote.custom,i=t.account.username,s=document.createElement("a");switch(s.href=t.account.url,s=s.hostname,e){case"@":return i+'@'+s+"";case"from":return i+' from '+s+"";case"custom":return i+' '+n+" "+s+"";default:return i+'@'+s+""}},previewUrl:function(t){return t.sensitive?"/storage/no-preview.png?v="+(new Date).getTime():t.media_attachments[0].preview_url},previewBackground:function(t){return"background-image: url("+this.previewUrl(t)+");"},trimCaption:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60;return _.truncate(t,{length:e})},hasStory:function(){var t=this;axios.get("/api/stories/v0/exists/"+this.profile.id).then((function(e){t.userStory=e.data}))},rtw:function(){var t=this;this.mpPoller=setInterval((function(){var e=!1;switch(t.mpCount++,t.mpCount>10&&(t.mpInterval=3e4),t.mpCount>50&&(t.mpInterval=3e5),t.scope){case"home":e="/api/pixelfed/v1/timelines/home";break;case"local":e="/api/pixelfed/v1/timelines/public";break;case"network":e="/api/pixelfed/v1/timelines/network"}axios.get(e,{params:{max_id:0,limit:20,recent_feed:t.recentFeed}}).then((function(e){var n=t,i=t.feed.map((function(t){return t.id})),s=e.data.filter((function(t){return t.id>n.min_id&&-1==i.indexOf(t.id)})),o=s.map((function(t){return t.id}));Math.max.apply(Math,f(o)).toString()>t.min_id&&(t.morePostsAvailable=!0,t.mpData=s)}))}),this.mpInterval)},syncNewPosts:function(){var t,e=this.mpData,n=e.map((function(t){return t.id}));this.min_id=Math.max.apply(Math,f(n)).toString(),this.max_id=Math.min.apply(Math,f(n)).toString(),(t=this.feed).unshift.apply(t,f(e)),this.morePostsAvailable=!1,this.mpData=null},toggleReplies:function(t){if(t.thread)t.thread=!1;else{if(t.replies.length>0)return void(t.thread=!0);var e="/api/v2/comments/"+t.account.id+"/status/"+t.id;axios.get(e).then((function(e){t.replies=_.reverse(e.data.data),t.thread=!0}))}},replyFocus:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0!=$("body").hasClass("loggedIn")){if(!this.status.comments_disabled){this.replyToIndex=e,this.replyingToId=t.id,this.replyingToUsername=t.account.username,this.reply_to_profile_id=t.account.id;var i=t.account.local?"@"+t.account.username+" ":"@"+t.account.acct+" ";1==n&&(this.replyText=i),this.$refs.replyModal.show(),setTimeout((function(){$(".replyModalTextarea").focus()}),500)}}else this.redirect("/login?next="+encodeURIComponent(window.location.pathname))},alwaysViewOlderPosts:function(){window.localStorage.setItem("pf.feed:avop","always"),window.location.href="/"},setCurrentLayout:function(t){this.currentLayout=t},deleteStatus:function(t){this.feed=this.feed.filter((function(e){return e.id!=t}))}},beforeDestroy:function(){clearInterval(this.mpInterval)}},v=(n("ahxy"),Object(a.a)(p,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["feed"===t.currentLayout?n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[1==t.morePostsAvailable?n("div",{staticClass:"col-12 mt-5 pt-3 mb-3 fixed-top"},[n("p",{staticClass:"text-center"},[n("button",{staticClass:"btn btn-dark px-4 rounded-pill font-weight-bold shadow",on:{click:t.syncNewPosts}},[t._v("Load New Posts")])])]):t._e(),t._v(" "),n("div",{staticClass:"col-md-8 col-lg-8 px-0 mb-sm-3 timeline order-2 order-md-1"},[n("div",{staticStyle:{"margin-top":"-2px"}},[t.config.features.stories?n("story-component"):t._e()],1),t._v(" "),n("div",[t.loading?n("div",{staticClass:"text-center",staticStyle:{"padding-top":"10px"}},[t._m(0)]):t._e(),t._v(" "),t._l(t.feed,(function(e,i){return n("div",{key:"feed-"+i+"-"+e.id,attrs:{"data-status-id":e.id}},[0==i&&t.showTips&&!t.loading?n("div",{staticClass:"my-4 card-tips"},[n("announcements-card",{on:{"show-tips":function(e){t.showTips=e}}})],1):t._e(),t._v(" "),2==i&&1==t.showSuggestions&&t.suggestions.length?n("div",{staticClass:"card mb-sm-4 status-card card-md-rounded-0 shadow-none border"},[n("div",{staticClass:"card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0"},[n("h6",{staticClass:"text-muted font-weight-bold mb-0"},[t._v("Suggestions For You")]),t._v(" "),n("span",{staticClass:"cursor-pointer text-muted",on:{click:t.hideSuggestions}},[n("i",{staticClass:"fas fa-times"})])]),t._v(" "),n("div",{staticClass:"card-body row mx-0"},t._l(t.suggestions,(function(e,i){return n("div",{staticClass:"col-12 col-md-4 mb-3"},[n("div",{staticClass:"card"},[n("div",{staticClass:"card-body text-center pt-3"},[n("p",{staticClass:"mb-0"},[n("a",{attrs:{href:"/"+e.username}},[n("img",{staticClass:"img-fluid rounded-circle cursor-pointer",attrs:{src:e.avatar,width:"45px",height:"45px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})])]),t._v(" "),n("div",{staticClass:"py-3"},[n("p",{staticClass:"font-weight-bold text-dark cursor-pointer mb-0"},[n("a",{staticClass:"text-decoration-none text-dark",attrs:{href:"/"+e.username}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(e.username)+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),n("p",{staticClass:"small text-muted mb-0"},[t._v(t._s(e.message))])]),t._v(" "),n("p",{staticClass:"mb-0"},[n("a",{staticClass:"btn btn-primary btn-block font-weight-bold py-0",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),t.expRecFollow(e.id,i)}}},[t._v("Follow")])])])])])})),0)]):t._e(),t._v(" "),4==i&&t.showHashtagPosts&&t.hashtagPosts.length?n("div",{staticClass:"card mb-sm-4 status-card card-md-rounded-0 shadow-none border"},[n("div",{staticClass:"card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0"},[n("span"),t._v(" "),n("h6",{staticClass:"text-muted font-weight-bold mb-0"},[n("a",{attrs:{href:"/discover/tags/"+t.hashtagPostsName+"?src=tr"}},[t._v("#"+t._s(t.hashtagPostsName))])]),t._v(" "),n("span",{staticClass:"cursor-pointer text-muted",on:{click:function(e){t.showHashtagPosts=!1}}},[n("i",{staticClass:"fas fa-times"})])]),t._v(" "),n("div",{staticClass:"card-body row mx-0"},t._l(t.hashtagPosts,(function(e,i){return n("div",{staticClass:"col-4 p-0 p-sm-2 p-md-3 hashtag-post-square"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.status.url}},[n("div",{class:[e.status.filter?"square "+e.status.filter:"square"]},[e.status.sensitive?n("div",{staticClass:"square-content"},[t._m(1,!0),t._v(" "),n("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.status.media_attachments[0].blurhash}})],1):n("div",{staticClass:"square-content"},[n("blur-hash-image",{attrs:{width:"32",height:"32",hash:e.status.media_attachments[0].blurhash,src:e.status.media_attachments[0].preview_url}})],1),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",{staticClass:"pr-4"},[n("span",{staticClass:"far fa-heart fa-lg pr-1"}),t._v(" "+t._s(t.formatCount(e.status.favourites_count))+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")]),t._v(" "),n("span",[n("span",{staticClass:"far fa-comment fa-lg pr-1"}),t._v(" "+t._s(t.formatCount(e.status.reply_count))+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")])])])])])])})),0)]):t._e(),t._v(" "),n("status-card",{attrs:{status:e,"reaction-bar":t.reactionBar},on:{"status-delete":t.deleteStatus,"comment-focus":t.commentFocus}})],1)})),t._v(" "),!t.loading&&t.feed.length?n("div",[n("div",{staticClass:"card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border"},[n("div",{staticClass:"card-body py-5 my-5"},[n("infinite-loading",{attrs:{distance:800},on:{infinite:t.infiniteTimeline}},[n("div",{attrs:{slot:"no-more"},slot:"no-more"},[t.recentFeed?n("div",[n("p",{staticClass:"text-center"},[n("i",{staticClass:"far fa-check-circle fa-8x text-lighter"})]),t._v(" "),n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("You're All Caught Up!")]),t._v(" "),n("p",{staticClass:"text-center text-muted font-weight-light"},[t._v("You've seen all the new posts from the accounts you follow.")]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/?a=vop"}},[t._v("View Older Posts")])]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/"},on:{click:function(e){return e.preventDefault(),t.alwaysViewOlderPosts()}}},[t._v("Always show older posts on this device")])])]):n("div",[n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("You've reached the end of this feed")]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/discover"}},[t._v("Discover new posts and people")])])])]),t._v(" "),n("div",{attrs:{slot:"no-results"},slot:"no-results"},[t.recentFeed?n("div",[n("p",{staticClass:"text-center"},[n("i",{staticClass:"far fa-check-circle fa-8x text-lighter"})]),t._v(" "),n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("You're All Caught Up!")]),t._v(" "),n("p",{staticClass:"text-center text-muted font-weight-light"},[t._v("You've seen all the new posts from the accounts you follow.")]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/?a=vop"}},[t._v("View Older Posts")])]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/"},on:{click:function(e){return e.preventDefault(),t.alwaysViewOlderPosts()}}},[t._v("Always show older posts on this device")])])]):n("div",[n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("You've reached the end of this feed")]),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/discover"}},[t._v("Discover new posts and people")])])])])])],1)])]):t._e(),t._v(" "),t.loading||"home"!=t.scope||0!=t.feed.length?t._e():n("div",[n("div",{staticClass:"card rounded-0 mt-4 status-card card-md-rounded-0 shadow-none border"},["0"!=t.profile.following_count?n("div",{staticClass:"card-body py-5 my-5"},[t._m(2),t._v(" "),n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("You're All Caught Up!")]),t._v(" "),n("p",{staticClass:"text-center text-muted font-weight-light"},[t._v("You've seen all the new posts from the accounts you follow.")]),t._v(" "),t._m(3),t._v(" "),n("p",{staticClass:"text-center mb-0"},[n("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/"},on:{click:function(e){return e.preventDefault(),t.alwaysViewOlderPosts()}}},[t._v("Always show older posts on this device")])])]):n("div",{staticClass:"card-body py-5 my-5"},[t._m(4),t._v(" "),n("p",{staticClass:"text-center h3 font-weight-light"},[t._v("Hello "+t._s(t.profile.username))]),t._v(" "),n("p",{staticClass:"text-center text-muted font-weight-light"},[t._v("Accounts you follow will appear in this feed.")]),t._v(" "),t._m(5)])])]),t._v(" "),!t.loading&&"home"==t.scope&&t.recentFeed&&t.discover_feed.length?n("div",{staticClass:"pt-3"},[t._m(6)]):t._e(),t._v(" "),t._l(t.discover_feed,(function(e,i){return!t.loading&&"home"==t.scope&&t.recentFeed&&t.discover_feed.length?n("div",{key:"discover_feed-"+i+"-"+e.id,attrs:{"data-status-id":e.id}},[2==i&&1==t.showSuggestions&&t.suggestions.length?n("div",{staticClass:"card mb-sm-4 status-card card-md-rounded-0 shadow-none border"},[n("div",{staticClass:"card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0"},[n("h6",{staticClass:"text-muted font-weight-bold mb-0"},[t._v("Suggestions For You")]),t._v(" "),n("span",{staticClass:"cursor-pointer text-muted",on:{click:t.hideSuggestions}},[n("i",{staticClass:"fas fa-times"})])]),t._v(" "),n("div",{staticClass:"card-body row mx-0"},t._l(t.suggestions,(function(e,i){return n("div",{staticClass:"col-12 col-md-4 mb-3"},[n("div",{staticClass:"card"},[n("div",{staticClass:"card-body text-center pt-3"},[n("p",{staticClass:"mb-0"},[n("a",{attrs:{href:"/"+e.username}},[n("img",{staticClass:"img-fluid rounded-circle cursor-pointer",attrs:{src:e.avatar,width:"45px",height:"45px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})])]),t._v(" "),n("div",{staticClass:"py-3"},[n("p",{staticClass:"font-weight-bold text-dark cursor-pointer mb-0"},[n("a",{staticClass:"text-decoration-none text-dark",attrs:{href:"/"+e.username}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(e.username)+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),n("p",{staticClass:"small text-muted mb-0"},[t._v(t._s(e.message))])]),t._v(" "),n("p",{staticClass:"mb-0"},[n("a",{staticClass:"btn btn-primary btn-block font-weight-bold py-0",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),t.expRecFollow(e.id,i)}}},[t._v("Follow")])])])])])})),0)]):t._e(),t._v(" "),4==i&&t.showHashtagPosts&&t.hashtagPosts.length?n("div",{staticClass:"card status-card rounded-0 shadow-none border-top-0 border"},[n("div",{staticClass:"card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0"},[n("span"),t._v(" "),n("h6",{staticClass:"text-muted font-weight-bold mb-0"},[n("a",{attrs:{href:"/discover/tags/"+t.hashtagPostsName+"?src=tr"}},[t._v("#"+t._s(t.hashtagPostsName))])]),t._v(" "),n("span",{staticClass:"cursor-pointer text-muted",on:{click:function(e){t.showHashtagPosts=!1}}},[n("i",{staticClass:"fas fa-times"})])]),t._v(" "),n("div",{staticClass:"card-body row mx-0"},t._l(t.hashtagPosts,(function(e,i){return n("div",{staticClass:"col-4 p-0 p-sm-2 p-md-3 hashtag-post-square"},[n("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.status.url}},[n("div",{class:[e.status.filter?"square "+e.status.filter:"square"]},[e.status.sensitive?n("div",{staticClass:"square-content"},[t._m(7,!0),t._v(" "),n("blur-hash-canvas",{attrs:{width:"32",height:"32",hash:e.status.media_attachments[0].blurhash}})],1):n("div",{staticClass:"square-content"},[n("blur-hash-image",{attrs:{width:"32",height:"32",hash:e.status.media_attachments[0].blurhash,src:e.status.media_attachments[0].preview_url}})],1),t._v(" "),n("div",{staticClass:"info-overlay-text"},[n("h5",{staticClass:"text-white m-auto font-weight-bold"},[n("span",{staticClass:"pr-4"},[n("span",{staticClass:"far fa-heart fa-lg pr-1"}),t._v(" "+t._s(t.formatCount(e.status.favourites_count))+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")]),t._v(" "),n("span",[n("span",{staticClass:"far fa-comment fa-lg pr-1"}),t._v(" "+t._s(t.formatCount(e.status.reply_count))+"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t")])])])])])])})),0)]):t._e(),t._v(" "),n("status-card",{attrs:{status:e,recommended:!0}})],1):t._e()}))],2)]),t._v(" "),n("div",{staticClass:"col-md-4 col-lg-4 my-4 order-1 order-md-2 d-none d-md-block"},[n("div",[n("div",{staticClass:"mb-4"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.loading,expression:"!loading"}]},[n("div",{staticClass:"pb-2"},[n("div",{staticClass:"media d-flex align-items-center"},[n("a",{staticClass:"mr-3",attrs:{href:t.userStory?"/stories/"+t.profile.acct:t.profile.url}},[t.userStory?n("div",{staticClass:"has-story cursor-pointer shadow-sm",on:{click:function(e){return t.storyRedirect()}}},[n("img",{staticClass:"rounded-circle box-shadow",attrs:{src:t.profile.avatar,width:"64px",height:"64px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})]):n("div",[n("img",{staticClass:"rounded-circle box-shadow",attrs:{src:t.profile.avatar,width:"64px",height:"64px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})])]),t._v(" "),n("div",{staticClass:"media-body d-flex justify-content-between word-break"},[n("div",[n("p",{staticClass:"mb-0 px-0 font-weight-bold"},[n("a",{staticClass:"text-dark",attrs:{href:t.profile.url}},[t._v(t._s(t.profile.username||"loading..."))])]),t._v(" "),n("p",{staticClass:"my-0 text-muted pb-0"},[t._v(t._s(t.profile.display_name||"loading..."))])]),t._v(" "),t._m(8)])])])]),t._v(" "),n("div",{staticClass:"card-footer bg-transparent border-0 pt-0 pb-1"},[n("div",{staticClass:"d-flex justify-content-between text-center"},[n("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.redirect(t.profile.url)}}},[n("p",{staticClass:"mb-0 font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.statuses_count)))]),t._v(" "),n("p",{staticClass:"mb-0 small text-muted"},[t._v("Posts")])]),t._v(" "),n("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.redirect(t.profile.url+"?md=followers")}}},[n("p",{staticClass:"mb-0 font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.followers_count)))]),t._v(" "),n("p",{staticClass:"mb-0 small text-muted"},[t._v("Followers")])]),t._v(" "),n("span",{staticClass:"cursor-pointer",on:{click:function(e){return t.redirect(t.profile.url+"?md=following")}}},[n("p",{staticClass:"mb-0 font-weight-bold"},[t._v(t._s(t.formatCount(t.profile.following_count)))]),t._v(" "),n("p",{staticClass:"mb-0 small text-muted"},[t._v("Following")])])])])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:1==t.modes.notify&&!t.loading,expression:"modes.notify == true && !loading"}],staticClass:"mb-4"},[n("notification-card")],1),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:1==t.showSuggestions&&t.suggestions.length&&t.config.ab&&1==t.config.ab.rec,expression:"showSuggestions == true && suggestions.length && config.ab && config.ab.rec == true"}],staticClass:"mb-4"},[n("div",{staticClass:"card shadow-none border"},[n("div",{staticClass:"card-header bg-white d-flex align-items-center justify-content-between"},[n("a",{ref:"suggestionRefresh",staticClass:"small text-muted cursor-pointer",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.refreshSuggestions(e)}}},[n("i",{staticClass:"fas fa-sync-alt"})]),t._v(" "),n("div",{staticClass:"small text-dark text-uppercase font-weight-bold"},[t._v("Suggestions")]),t._v(" "),n("div",{staticClass:"small text-muted cursor-pointer",on:{click:t.hideSuggestions}},[n("i",{staticClass:"fas fa-times"})])]),t._v(" "),n("div",{staticClass:"card-body pt-0"},t._l(t.suggestions,(function(e,i){return n("div",{staticClass:"media align-items-center mt-3"},[n("a",{attrs:{href:"/"+e.username}},[n("img",{staticClass:"rounded-circle mr-3",attrs:{src:e.avatar,width:"32px",height:"32px",onerror:"this.onerror=null;this.src='/storage/avatars/default.png?v=2'",alt:"avatar"}})]),t._v(" "),n("div",{staticClass:"media-body"},[n("p",{staticClass:"mb-0 font-weight-bold small"},[n("a",{staticClass:"text-decoration-none text-dark",attrs:{href:"/"+e.username}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(e.username)+"\n\t\t\t\t\t\t\t\t\t\t\t\t")])]),t._v(" "),n("p",{staticClass:"mb-0 small text-muted"},[t._v(t._s(e.message))])]),t._v(" "),n("a",{staticClass:"font-weight-bold small",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),t.expRecFollow(e.id,i)}}},[t._v("Follow")])])})),0)])]),t._v(" "),t._m(9)])])])]):t._e(),t._v(" "),t.replyStatus&&t.replyStatus.hasOwnProperty("id")?n("comment-card",{attrs:{status:t.replyStatus,profile:t.profile},on:{"current-layout":t.setCurrentLayout}}):t._e(),t._v(" "),n("div",{staticClass:"modal-stack"},[n("b-modal",{ref:"replyModal",attrs:{id:"ctx-reply-modal","hide-footer":"",centered:"",rounded:"","title-html":t.replyStatus.account?"Reply to "+t.replyStatus.account.username+"":"","title-tag":"p","title-class":"font-weight-bold text-muted",size:"md","body-class":"p-2 rounded"}},[n("div",[n("vue-tribute",{attrs:{options:t.tributeSettings}},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.replyText,expression:"replyText"}],staticClass:"form-control replyModalTextarea",attrs:{rows:"4"},domProps:{value:t.replyText},on:{input:function(e){e.target.composing||(t.replyText=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"border-top border-bottom my-2"},[n("ul",{staticClass:"nav align-items-center emoji-reactions",staticStyle:{"overflow-x":"scroll","flex-wrap":"unset"}},t._l(t.emoji,(function(e){return n("li",{staticClass:"nav-item",on:{click:function(e){return t.emojiReaction(t.status)}}},[t._v(t._s(e))])})),0)]),t._v(" "),n("div",{staticClass:"d-flex justify-content-between align-items-center"},[n("div",[n("span",{staticClass:"pl-2 small text-muted font-weight-bold text-monospace"},[n("span",{class:[t.replyText.length>t.config.uploader.max_caption_length?"text-danger":"text-dark"]},[t._v(t._s(t.replyText.length>t.config.uploader.max_caption_length?t.config.uploader.max_caption_length-t.replyText.length:t.replyText.length))]),t._v("/"+t._s(t.config.uploader.max_caption_length)+"\n\t\t\t\t\t\t\t")])]),t._v(" "),n("div",{staticClass:"d-flex align-items-center"},[n("div",{staticClass:"custom-control custom-switch mr-3"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.replyNsfw,expression:"replyNsfw"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"replyModalCWSwitch"},domProps:{checked:Array.isArray(t.replyNsfw)?t._i(t.replyNsfw,null)>-1:t.replyNsfw},on:{change:function(e){var n=t.replyNsfw,i=e.target,s=!!i.checked;if(Array.isArray(n)){var o=t._i(n,null);i.checked?o<0&&(t.replyNsfw=n.concat([null])):o>-1&&(t.replyNsfw=n.slice(0,o).concat(n.slice(o+1)))}else t.replyNsfw=s}}}),t._v(" "),n("label",{class:[t.replyNsfw?"custom-control-label font-weight-bold text-dark":"custom-control-label text-lighter"],attrs:{for:"replyModalCWSwitch"}},[t._v("Mark as NSFW")])]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-2 px-4 lead text-uppercase font-weight-bold",attrs:{disabled:0==t.replyText.length},on:{click:function(e){return e.preventDefault(),t.commentSubmit(t.status,e)}}},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(1==t.replySending?"POSTING":"POST")+"\n\t\t\t\t\t\t\t")])])])],1)]),t._v(" "),n("b-modal",{ref:"ctxStatusModal",attrs:{id:"ctx-status-modal","hide-header":"","hide-footer":"",centered:"",rounded:"",size:"xl","body-class":"list-group-flush p-0 m-0 rounded"}})],1)],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"spinner-border",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-overlay-text-label"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-eye-slash fa-lg p-2 d-flex-inline"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-check-circle fa-8x text-lighter"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center mb-0"},[e("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/?a=vop"}},[this._v("View Older Posts")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center"},[e("i",{staticClass:"far fa-smile fa-8x text-lighter"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"text-center mb-0"},[e("a",{staticClass:"btn btn-link font-weight-bold px-4",attrs:{href:"/discover"}},[this._v("Discover new posts and people")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",{staticClass:"h5 font-weight-bold py-3 d-flex justify-content-between align-items-center"},[e("span",[this._v("Suggested Posts")]),this._v(" "),e("a",{staticClass:"small font-weight-bold",attrs:{href:"/?a=vop"}},[this._v("Older Posts")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"info-overlay-text-label"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-eye-slash fa-lg p-2 d-flex-inline"})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"ml-2"},[e("a",{staticClass:"text-muted",attrs:{href:"/settings/home"}},[e("i",{staticClass:"fas fa-cog fa-lg"}),this._v(" "),e("span",{staticClass:"sr-only"},[this._v("User Settings")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("footer",[n("div",{staticClass:"container px-0 pb-5"},[n("p",{staticClass:"mb-2 small text-justify"},[n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/site/about"}},[t._v("About")]),t._v(" "),n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/site/help"}},[t._v("Help")]),t._v(" "),n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/site/language"}},[t._v("Language")]),t._v(" "),n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/discover/places"}},[t._v("Places")]),t._v(" "),n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/site/privacy"}},[t._v("Privacy")]),t._v(" "),n("a",{staticClass:"text-lighter pr-2",attrs:{href:"/site/terms"}},[t._v("Terms")])]),t._v(" "),n("p",{staticClass:"mb-0 text-uppercase text-muted small"},[n("a",{staticClass:"text-lighter",attrs:{href:"http://pixelfed.org",rel:"noopener",title:"","data-toggle":"tooltip"}},[t._v("Powered by Pixelfed")])])])])}],!1,null,"4b5ccd81",null));e.default=v.exports},KqaD:function(t,e,n){Vue.component("notification-card",n("x6yo").default),Vue.component("photo-presenter",n("d+I4").default),Vue.component("video-presenter",n("2Jpm").default),Vue.component("photo-album-presenter",n("Mrqh").default),Vue.component("video-album-presenter",n("9wGH").default),Vue.component("mixed-album-presenter",n("exej").default),Vue.component("post-menu",n("yric").default),Vue.component("timeline",n("KhVi").default),Vue.component("announcements-card",n("hoKv").default),Vue.component("story-component",n("oDnJ").default)},Mrqh:function(t,e,n){"use strict";n.r(e);var i={props:["status"],data:function(){return{cursor:0}},created:function(){},beforeDestroy:function(){},methods:{loadSensitive:function(){this.$refs.carousel.onResize(),this.$refs.carousel.goToPage(0)},altText:function(t){var e=t.description;return e||"Photo was not tagged with any alt text."},keypressNavigation:function(t){var e=this.$refs.carousel;if("37"==t.keyCode){t.preventDefault();e.advancePage("backward"),e.$emit("navigation-click","backward")}if("39"==t.keyCode){t.preventDefault();e.advancePage("forward"),e.$emit("navigation-click","forward")}}}},s=(n("fRnu"),n("KHd+")),o=Object(s.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return 1==t.status.sensitive?n("div",[n("details",{staticClass:"details-animated"},[n("summary",{on:{click:t.loadSensitive}},[n("p",{staticClass:"mb-0 lead font-weight-bold"},[t._v(t._s(t.status.spoiler_text?t.status.spoiler_text:"CW / NSFW / Hidden Media"))]),t._v(" "),n("p",{staticClass:"font-weight-light"},[t._v("(click to show)")])]),t._v(" "),n("carousel",{ref:"carousel",attrs:{centerMode:!0,loop:!1,"per-page":1,paginationPosition:"bottom-overlay",paginationActiveColor:"#3897f0",paginationColor:"#dbdbdb"}},t._l(t.status.media_attachments,(function(e,i){return n("slide",{key:"px-carousel-"+e.id+"-"+i,staticClass:"w-100 h-100 d-block mx-auto text-center",attrs:{title:e.description}},[n("img",{class:e.filter_class+" img-fluid",attrs:{src:e.url,alt:t.altText(e),onerror:"this.onerror=null;this.src='/storage/no-preview.png'"}}),t._v(" "),t.status.media_attachments[0].license?n("p",{staticStyle:{"margin-bottom":"0",padding:"0 5px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",bottom:"0",right:"0","border-top-left-radius":"5px",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"}},[n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.url}},[t._v("Photo")]),t._v(" by "),n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.account.url}},[t._v("@"+t._s(t.status.account.username))]),t._v(" licensed under "),n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.media_attachments[0].license.url}},[t._v(t._s(t.status.media_attachments[0].license.title))])]):t._e()])})),1)],1)]):n("div",{staticClass:"w-100 h-100 p-0"},[n("carousel",{ref:"carousel",staticClass:"p-0 m-0",attrs:{centerMode:!0,loop:!1,"per-page":1,paginationPosition:"bottom-overlay",paginationActiveColor:"#3897f0",paginationColor:"#dbdbdb"}},t._l(t.status.media_attachments,(function(e,i){return n("slide",{key:"px-carousel-"+e.id+"-"+i,staticStyle:{background:"#000",display:"flex","align-items":"center"},attrs:{title:e.description}},[n("img",{class:e.filter_class+" img-fluid w-100 p-0",attrs:{src:e.url,alt:t.altText(e),onerror:"this.onerror=null;this.src='/storage/no-preview.png'"}}),t._v(" "),t.status.media_attachments[0].license?n("p",{staticStyle:{"margin-bottom":"0",padding:"0 5px",color:"#fff","font-size":"10px","text-align":"right",position:"absolute",bottom:"0",right:"0","border-top-left-radius":"5px",background:"linear-gradient(0deg, rgba(0,0,0,0.5), rgba(0,0,0,0.5))"}},[n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.url}},[t._v("Photo")]),t._v(" by "),n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.account.url}},[t._v("@"+t._s(t.status.account.username))]),t._v(" licensed under "),n("a",{staticClass:"font-weight-bold text-light",attrs:{href:t.status.media_attachments[0].license.url}},[t._v(t._s(t.status.media_attachments[0].license.title))])]):t._e()])})),1)],1)}),[],!1,null,"d73e370c",null);e.default=o.exports},N0po:function(t,e,n){var i=n("US+e");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},Oa72:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n#storyContainer > .story[data-v-42243767] {\n\tmargin-right: 3rem;\n}\n",""])},OizH:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.text-lighter[data-v-0ed43037] {\n\tcolor:#B8C2CC !important;\n}\n.modal-body[data-v-0ed43037] {\n\tpadding: 0;\n}\n",""])},PhXe:function(t,e,n){"use strict";n("XfSO")},S1R9:function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.card-img-top[data-v-d73e370c] {\n border-top-left-radius: 0 !important;\n border-top-right-radius: 0 !important;\n}\n",""])},"US+e":function(t,e,n){(t.exports=n("I1BE")(!1)).push([t.i,"\n.fade-enter-active[data-v-267be4b0], .fade-leave-active[data-v-267be4b0] {\n transition: opacity .5s;\n}\n.fade-enter[data-v-267be4b0], .fade-leave-to[data-v-267be4b0] {\n opacity: 0;\n}\n",""])},XfSO:function(t,e,n){var i=n("FAM0");"string"==typeof i&&(i=[[t.i,i,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};n("aET+")(i,s);i.locals&&(t.exports=i.locals)},"aET+":function(t,e,n){var i,s,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===s&&(s=i.apply(this,arguments)),s}),r=function(t,e){return e?e.querySelector(t):document.querySelector(t)},l=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var i=r.call(this,t,n);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}}(),c=null,d=0,u=[],h=n("9tPo");function f(t,e){for(var n=0;n=0&&u.splice(e,1)}function g(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return b(e,t.attrs),p(t,e),e}function b(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function w(t,e){var n,i,s,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var a=d++;n=c||(c=g(e)),i=_.bind(null,n,a,!1),s=_.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",b(e,t.attrs),p(t,e),e}(e),i=k.bind(null,n,e),s=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(e),i=C.bind(null,n),s=function(){v(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else s()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=m(t,e);return f(n,e),function(t){for(var i=[],s=0;s