"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[863],{13310:(t,e,i)=>{i.r(e),i.d(e,{default:()=>d});vara=i(42755),n=i(88231),s=i(18303),o=i(73128),r=i(78423);functionc(t){returnfunction(t){if(Array.isArray(t))returnl(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returnl(t,e);vari=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)returnArray.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))returnl(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionl(t,e){(null==e||e>t.length)&&(e=t.length);for(vari=0,a=newArray(e);i<e;i++)a[i]=t[i];returna}constd={components:{drawer:a.default,sidebar:n.default,intersect:r.default,notification:s.default,placeholder:o.default},data:function(){return{isLoaded:!1,profile:void0,ids:[],notifications:void0,notificationsLoaded:!1,max_id:void0,canLoadMore:!0,isIntersecting:!1,tabIndex:0,tabs:[{id:"all",name:"All",icon:"far fa-bell",types:[]},{id:"mentions",name:"Mentions",description:"Replies to your posts and posts you were mentioned in",icon:"far fa-at",types:["comment","mention"]},{id:"likes",name:"Likes",description:"Accounts that liked your posts",icon:"far fa-heart",types:["favourite"]},{id:"followers",name:"Followers",description:"Accounts that followed you",icon:"far fa-user-plus",types:["follow"]},{id:"reblogs",name:"Reblogs",description:"Accounts that shared or reblogged your posts",icon:"far fa-retweet",types:["share"]},{id:"direct",name:"DMs",description:"Direct messages you have with other accounts",icon:"far fa-envelope",types:["direct"]}],tabSwitching:!1,filteredFeed:[],filteredLoaded:!1,filteredIsIntersecting:!1,filteredMaxId:void0,canLoadMoreFiltered:!0,filterPaginationTimeout:void0,filteredIterations:0,filteredEmpty:!1,followRequests:[],followRequestsChecked:!1,followRequestsPage:1}},updated:function(){},mounted:function(){this.profile=window._sharedData.user,this.isLoaded=!0,this.profile.locked&&this.fetchFollowRequests(),this.fetchNotifications()},methods:{fetchNotifications:function(){vart=this;axios.get("/api/pixelfed/v1/notifications?pg=true").then((function(e){vari,a=e.data.filter((function(t){return!("share"==t.type&&!t.status)&&(!("comment"==t.type&&!t.status)&&(!("mention"==t.type&&!t.status)&&(!("favourite"==t.type&&!t.status)&&!("follow"==t.type&&!t.account))))})),n=e.data.map((function(t){returnt.id}));t.max_id=Math.min.apply(Math,c(n)),(i=t.ids).push.apply(i,c(n)),t.notifications=a,t.notificationsLoaded=!0}))},enterIntersect:function(){vart=this;this.isIntersecting||isFinite(this.max_id)&&(this.isIntersecting=!0,axios.get("/api/pixelfed/v1/notifications",{params:{max_id:this.max_id}}).then((function(e){vari;e.data.length||(t.canLoadMore=!1);vara=e.data.map((function(t){returnt.id}));t.max_id=Math.min.apply(Math,c(a)),(i=t.notifications).push.apply(i,c(e.data)),t.isIntersecting=!1})))},toggleTab:function(t){this.tabSwitching=!0,this.filteredEmpty=!1,this.filteredIterations=0,this.filterFeed(this.tabs[t].id)},filterFeed:function(t){vare=this;switch(t){case"all":this.tabIndex=0,this.filteredFeed=[],this.filteredLoaded=!1,this.filteredIsIntersecting=!1,this.filteredMaxId=void0,this.canLoadMoreFiltered=!1,this.tabSwitching=!1;break;case"mentions":this.tabIndex=1,this.filteredMaxId=this.max_id,this.filteredFeed=this.notifications.filter((function(t){returne.tabs[e.tabIndex].types.includes(t.type)})),this.filteredIsIntersecting=!1,this.tabSwitching=!1,this.canLoadMoreFiltered=!0,this.filteredLoaded=!0;break;case"likes":this.tabIndex=2,this.filteredMaxId=this.max_id,this.filteredFeed=this.notifications.filter((function(t){return"favourite"===t.type})),this.filteredIsIntersecting=!1,this.tabSwitching=!1,this.canLoadMoreFiltered=!0,this.filteredLoaded=!0;brea