"use strict";(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[50],{65294:(t,e,i)=>{i.r(e),i.d(e,{default:()=>d});var a=i(42755),n=i(88231),s=i(18303),o=i(73128),r=i(78423);function c(t){return function(t){if(Array.isArray(t))return l(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 l(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(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 l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i10?0==this.filteredFeed.length&&(this.filteredEmpty=!0):isFinite(this.max_id)&&isFinite(this.filteredMaxId)?(this.filteredIsIntersecting=!0,axios.get("/api/pixelfed/v1/notifications",{params:{max_id:this.filteredMaxId,limit:40}}).then((function(e){var i,a=e.data.map((function(t){return t.id})),n=Math.min.apply(Math,c(a));n1&&void 0!==arguments[1]?arguments[1]:40;return _.truncate(t,{length:e})}}}},13315:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});const a={props:{n:{type:Object}},data:function(){return{profile:window._sharedData.user}},methods:{truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;return t.length<=e?t:t.slice(0,e)+"..."},timeAgo:function(t){var e=Date.parse(t),i=Math.floor((new Date-e)/1e3),a=Math.floor(i/31536e3);return a>=1?a+"y":(a=Math.floor(i/604800))>=1?a+"w":(a=Math.floor(i/86400))>=1?a+"d":(a=Math.floor(i/3600))>=1?a+"h":(a=Math.floor(i/60))>=1?a+"m":Math.floor(i)+"s"},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},followProfile:function(t){var e=this,i=t.account.id;axios.post("/i/follow",{item:i}).then((function(t){e.notifications.map((function(t){t.account.id===i&&(t.relationship.following=!0)}))})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},viewContext:function(t){switch(t.type){case"follow":return this.getProfileUrl(t.account);case"mention":return t.status.url;case"like":case"favourite":case"comment":return this.getPostUrl(t.status);case"tagged":return t.tagged.post_url;case"direct":return"/account/direct/t/"+t.account.id}return"/"},displayProfileUrl:function(t){return"/i/web/profile/".concat(t.id)},displayPostUrl:function(t){return"/i/web/post/".concat(t.id)},getProfileUrl:function(t){this.$router.push({name:"profile",path:"/i/web/profile/".concat(t.id),params:{id:t.id,cachedProfile:t,cachedUser:this.profile}})},getPostUrl:function(t){this.$router.push({name:"post",path:"/i/web/post/".concat(t.id),params:{id:t.id,cachedStatus:t,cachedProfile:this.profile}})}}}},67605:(t,e,i)=>{i.r(e),i.d(e,{render:()=>a,staticRenderFns:()=>n});var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"web-wrapper notification-metro-component"},[t.isLoaded?e("div",{staticClass:"container-fluid mt-3"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-md-3 d-md-block"},[e("sidebar",{attrs:{user:t.profile}})],1),t._v(" "),e("div",{staticClass:"col-md-9 col-lg-9 col-xl-5 offset-xl-1"},[0===t.tabIndex?[e("h1",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\tNotifications\n\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"small mt-n2"},[t._v(" ")])]:10===t.tabIndex?[e("div",{staticClass:"d-flex align-items-center mb-3"},[e("a",{staticClass:"text-muted",staticStyle:{opacity:"0.3"},attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.tabIndex=0}}},[e("i",{staticClass:"far fa-chevron-circle-left fa-2x mr-3",attrs:{title:"Go back to notifications"}})]),t._v(" "),e("h1",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\t\tFollow Requests\n\t\t\t\t\t\t")])])]:[e("h1",{staticClass:"font-weight-bold"},[t._v("\n\t\t\t\t\t\t"+t._s(t.tabs[t.tabIndex].name)+"\n\t\t\t\t\t")]),t._v(" "),e("p",{staticClass:"small text-lighter mt-n2"},[t._v(t._s(t.tabs[t.tabIndex].description))])],t._v(" "),10!=t.tabIndex&&t.notificationsLoaded&&t.notifications.length?e("ul",{staticClass:"notification-filters nav nav-tabs nav-fill mb-3"},t._l(t.tabs,(function(i,a){return e("li",{staticClass:"nav-item"},[e("a",{staticClass:"nav-link",class:{active:t.tabIndex===a},attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.toggleTab(a)}}},[e("i",{staticClass:"mr-1 nav-link-icon",class:[i.icon]}),t._v(" "),e("span",{staticClass:"d-none d-xl-inline-block"},[t._v("\n\t\t\t\t\t\t\t\t"+t._s(i.name)+"\n\t\t\t\t\t\t\t")])])])})),0):t._e(),t._v(" "),t.tabSwitching?e("div",[e("placeholder")],1):e("div",[0===t.tabIndex?e("div",[t.followRequests&&t.followRequests.hasOwnProperty("accounts")&&t.followRequests.accounts.length?e("div",{staticClass:"card card-body shadow-none border border-warning rounded-pill mb-3 py-2"},[e("div",{staticClass:"media align-items-center"},[e("i",{staticClass:"far fa-exclamation-circle mr-3 text-warning"}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"mb-0"},[e("strong",[t._v(t._s(t.followRequests.count)+" follow "+t._s(t.followRequests.count>1?"requests":"request"))])])]),t._v(" "),e("a",{staticClass:"ml-2 small d-flex font-weight-bold primary text-uppercase mb-0",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showFollowRequests()}}},[t._v("\n\t\t\t\t\t\t\t\t\tView"),e("span",{staticClass:"d-none d-md-block"},[t._v(" Follow Requests")])])])]):t._e(),t._v(" "),t.notificationsLoaded?e("div",[t._l(t.notifications,(function(t,i){return e("notification",{key:"notification:".concat(i,":").concat(t.id),attrs:{n:t}})})),t._v(" "),t.notifications&&t.notificationsLoaded&&!t.notifications.length?e("div",[e("div",{staticClass:"row justify-content-center"},[e("div",{staticClass:"col-12 col-md-10 text-center"},[e("img",{staticClass:"img-fluid",staticStyle:{opacity:"0.6"},attrs:{src:"/img/illustrations/dk-nature-man-monochrome.svg"}}),t._v(" "),e("p",{staticClass:"lead text-muted font-weight-bold"},[t._v(t._s(t.$t("notifications.noneFound")))])])])]):t._e(),t._v(" "),t.canLoadMore?e("div",[e("intersect",{on:{enter:t.enterIntersect}},[e("placeholder")],1)],1):t._e()],2):e("div",[e("placeholder")],1)]):10===t.tabIndex?e("div",[t.followRequests&&t.followRequests.accounts&&t.followRequests.accounts.length?e("div",{staticClass:"list-group"},t._l(t.followRequests.accounts,(function(i,a){return e("div",{staticClass:"list-group-item"},[e("div",{staticClass:"media align-items-center"},[e("router-link",{staticClass:"primary",attrs:{to:"/i/web/profile/".concat(i.account.id)}},[e("img",{staticClass:"rounded-lg shadow mr-3",attrs:{src:i.avatar,width:"80",height:"80",onerror:"this.onerror=null;this.src='/storage/avatars/default.jpg?v=0';"}})]),t._v(" "),e("div",{staticClass:"media-body mr-3"},[e("p",{staticClass:"font-weight-bold mb-0 text-break",staticStyle:{"font-size":"17px"}},[e("router-link",{staticClass:"primary",attrs:{to:"/i/web/profile/".concat(i.account.id)}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+t._s(i.username)+"\n\t\t\t\t\t\t\t\t\t\t\t")])],1),t._v(" "),e("p",{staticClass:"mb-1 text-muted text-break",staticStyle:{"font-size":"11px"}},[t._v(t._s(t.truncate(i.account.note_text,100)))]),t._v(" "),e("div",{staticClass:"d-flex text-lighter",staticStyle:{"font-size":"11px"}},[e("span",{staticClass:"mr-3"},[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(i.account.statuses_count))]),t._v(" "),e("span",[t._v("Posts")])]),t._v(" "),e("span",[e("span",{staticClass:"font-weight-bold"},[t._v(t._s(i.account.followers_count))]),t._v(" "),e("span",[t._v("Followers")])])])]),t._v(" "),e("div",{staticClass:"d-flex flex-column d-md-block"},[e("button",{staticClass:"btn btn-outline-success py-1 btn-sm font-weight-bold rounded-pill mr-2 mb-1",on:{click:function(e){return e.preventDefault(),t.handleFollowRequest("accept",a)}}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\tAccept\n\t\t\t\t\t\t\t\t\t\t")]),t._v(" "),e("button",{staticClass:"btn btn-outline-lighter py-1 btn-sm font-weight-bold rounded-pill mb-1",on:{click:function(e){return e.preventDefault(),t.handleFollowRequest("reject",a)}}},[t._v("\n\t\t\t\t\t\t\t\t\t\t\tReject\n\t\t\t\t\t\t\t\t\t\t")])])],1)])})),0):t._e()]):e("div",[t.filteredLoaded?e("div",[t._m(0),t._v(" "),t.filteredFeed.length?e("div",t._l(t.filteredFeed,(function(t,i){return e("notification",{key:"notification:filtered:".concat(i,":").concat(t.id),attrs:{n:t}})})),1):e("div",[t.filteredEmpty?e("div",[e("p",{staticClass:"font-weight-bold"},[t._v("No results found")])]):e("placeholder")],1),t._v(" "),t.canLoadMoreFiltered?e("div",[e("intersect",{on:{enter:t.enterFilteredIntersect}},[e("placeholder")],1)],1):t._e()]):e("div",[e("placeholder")],1)])])],2)]),t._v(" "),e("drawer")],1):t._e()])},n=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"card card-body bg-transparent shadow-none border p-2 mb-3 rounded-pill text-lighter"},[e("div",{staticClass:"media align-items-center small"},[e("i",{staticClass:"far fa-exclamation-triangle mx-2"}),t._v(" "),e("div",{staticClass:"media-body"},[e("p",{staticClass:"mb-0 font-weight-bold"},[t._v("Filtering results may not include older notifications")])])])])}]},42620:(t,e,i)=>{i.r(e),i.d(e,{render:()=>a,staticRenderFns:()=>n});var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"media mb-2 align-items-center px-3 shadow-sm py-2 bg-white",staticStyle:{"border-radius":"15px"}},[e("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{href:"#",title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[e("img",{staticClass:"mr-3 shadow-sm",staticStyle:{"border-radius":"8px"},attrs:{src:t.n.account.avatar,alt:"",width:"40",height:"40",onerror:"this.onerror=null;this.src='/storage/avatars/default.jpg';"}})]),t._v(" "),e("div",{staticClass:"media-body font-weight-light"},["favourite"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.liked"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.displayPostUrl(t.n.status)},on:{click:function(e){return e.preventDefault(),t.getPostUrl(t.n.status)}}},[t._v("post")]),t._v(".\n\t\t\t")])]):"comment"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.commented"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.displayPostUrl(t.n.status)},on:{click:function(e){return e.preventDefault(),t.getPostUrl(t.n.status)}}},[t._v("post")]),t._v(".\n\t\t\t")])]):"story:react"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.reacted"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+t.n.account.id}},[t._v("story")]),t._v(".\n\t\t\t")])]):"story:comment"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.commented"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+t.n.account.id}},[t._v(t._s(t.$t("notifications.story")))]),t._v(".\n\t\t\t")])]):"mention"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.mentionUrl(t.n.status)}},[t._v(t._s(t.$t("notifications.mentioned")))]),t._v(" "+t._s(t.$t("notifications.you"))+".\n\t\t\t")])]):"follow"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.followed"))+" "+t._s(t.$t("notifications.you"))+".\n\t\t\t")])]):"share"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.shared"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.displayPostUrl(t.n.status)},on:{click:function(e){return e.preventDefault(),t.getPostUrl(t.n.status)}}},[t._v(t._s(t.$t("notifications.post")))]),t._v(".\n\t\t\t")])]):"modlog"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v(t._s(t.truncate(t.n.account.username)))]),t._v(" "+t._s(t.$t("notifications.updatedA"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.n.modlog.url}},[t._v(t._s(t.$t("notifications.modlog")))]),t._v(".\n\t\t\t")])]):"tagged"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.tagged"))+" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.n.tagged.post_url}},[t._v(t._s(t.$t("notifications.post")))]),t._v(".\n\t\t\t")])]):"direct"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.displayProfileUrl(t.n.account),title:t.n.account.acct},on:{click:function(e){return e.preventDefault(),t.getProfileUrl(t.n.account)}}},[t._v("@"+t._s(t.n.account.acct))]),t._v(" "+t._s(t.$t("notifications.sentA"))+" "),e("router-link",{staticClass:"font-weight-bold",attrs:{to:"/i/web/direct/thread/"+t.n.account.id}},[t._v(t._s(t.$t("notifications.dm")))]),t._v(".\n\t\t\t")],1)]):"group.join.approved"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[t._v("\n\t\t\t\t"+t._s(t.$t("notifications.yourApplication"))+" "),e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.n.group.url,title:t.n.group.name}},[t._v(t._s(t.truncate(t.n.group.name)))]),t._v(" "+t._s(t.$t("notifications.applicationApproved"))+"\n\t\t\t")])]):"group.join.rejected"==t.n.type?e("div",[e("p",{staticClass:"my-0"},[t._v("\n\t\t\t\t"+t._s(t.$t("notifications.yourApplication"))+" "),e("a",{staticClass:"font-weight-bold text-dark text-break",attrs:{href:t.n.group.url,title:t.n.group.name}},[t._v(t._s(t.truncate(t.n.group.name)))]),t._v(" "+t._s(t.$t("notifications.applicationRejected"))+"\n\t\t\t")])]):e("div",[e("p",{staticClass:"my-0 d-flex justify-content-between align-items-center"},[e("span",{staticClass:"font-weight-bold"},[t._v("Notification")]),t._v(" "),e("span",{staticStyle:{"font-size":"8px"}},[t._v("e_"+t._s(t.n.type)+"::"+t._s(t.n.id))])])]),t._v(" "),e("div",{staticClass:"align-items-center"},[e("span",{staticClass:"small text-muted",attrs:{"data-toggle":"tooltip","data-placement":"bottom",title:t.n.created_at}},[t._v(t._s(t.timeAgo(t.n.created_at)))])])]),t._v(" "),e("div",[t.n.status&&t.n.status&&t.n.status.media_attachments&&t.n.status.media_attachments.length?e("div",[e("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.getPostUrl(t.n.status)}}},[e("img",{attrs:{src:t.n.status.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):t.n.status&&t.n.status.parent&&t.n.status.parent.media_attachments&&t.n.status.parent.media_attachments.length?e("div",[e("a",{attrs:{href:t.n.status.parent.url}},[e("img",{attrs:{src:t.n.status.parent.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):t._e()])])},n=[]},39624:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});var a=i(1519),n=i.n(a)()((function(t){return t[1]}));n.push([t.id,".notification-metro-component .notification-filters .nav-link[data-v-0a315271]{font-size:12px}.notification-metro-component .notification-filters .nav-link.active[data-v-0a315271]{font-weight:700}.notification-metro-component .notification-filters .nav-link-icon[data-v-0a315271]:not(.active){opacity:.5}.notification-metro-component .notification-filters .nav-link[data-v-0a315271]:not(.active){color:#9ca3af}",""]);const s=n},28758:(t,e,i)=>{i.r(e),i.d(e,{default:()=>r});var a=i(93379),n=i.n(a),s=i(39624),o={insert:"head",singleton:!1};n()(s.default,o);const r=s.default.locals||{}},73209:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});var a=i(38638),n=i(52980),s={};for(const t in n)"default"!==t&&(s[t]=()=>n[t]);i.d(e,s);i(32900);const o=(0,i(51900).default)(n.default,a.render,a.staticRenderFns,!1,null,"0a315271",null).exports},18303:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});var a=i(34874),n=i(47524),s={};for(const t in n)"default"!==t&&(s[t]=()=>n[t]);i.d(e,s);const o=(0,i(51900).default)(n.default,a.render,a.staticRenderFns,!1,null,null,null).exports},52980:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});var a=i(65294),n={};for(const t in a)"default"!==t&&(n[t]=()=>a[t]);i.d(e,n);const s=a.default},47524:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});var a=i(13315),n={};for(const t in a)"default"!==t&&(n[t]=()=>a[t]);i.d(e,n);const s=a.default},38638:(t,e,i)=>{i.r(e);var a=i(67605),n={};for(const t in a)"default"!==t&&(n[t]=()=>a[t]);i.d(e,n)},34874:(t,e,i)=>{i.r(e);var a=i(42620),n={};for(const t in a)"default"!==t&&(n[t]=()=>a[t]);i.d(e,n)},32900:(t,e,i)=>{i.r(e);var a=i(28758),n={};for(const t in a)"default"!==t&&(n[t]=()=>a[t]);i.d(e,n)}}]);