1"use strict";(self["webpackChunkpeakd"]=self["webpackChunkpeakd"]||[]).push([[6495],{52478:function(e,t,s){s.r(t),s.d(t,{default:function(){return k}});var i=function(){var e=this,t=e._self._c;return t("div",[e.showHeader?t("feed-header",{attrs:{"is-loading":e.isLoading,"page-title-override":e.unifiedPageTitle,"enable-filters":"following"===e.activeAlgorithm,algorithms:e.algorithmOptions,"active-algorithm":e.activeAlgorithm,"show-algorithm-info":e.isCanonicalFeed&&"following"!==e.activeAlgorithm},on:{refresh:function(t){return e.refresh()},"algorithm-change":e.selectAlgorithm,"show-algorithm-info":e.openInfoModal,"exclude-reblog-change":e.setFilterExcludeReblog,"exclude-curated-change":e.setFilterExcludeCurated}}):e._e(),t("post-stream",{ref:"postsStream",attrs:{posts:e.feedPosts,"load-callback":e.loadMore}},[t("template",{slot:"no-results-empty"},["following"!==e.activeAlgorithm?t("span",[e._v(e._s(e.activeAlgorithmDetails.emptyState))]):e.currentUser&&e.currentUser.username===e.$route.params.username?t("span",[e._v(" Looks like there is nothing in this feed yet. Follow some users to see their posts here. "),t("div",{staticClass:"row content-group mt-15",staticStyle:{"max-width":"800px",margin:"0 auto"}},[t("div",{staticClass:"col-lg-4 col-xs-12 text-center"},[t("div",{staticClass:"panel panel-flat panel-body"},[t("router-link",{attrs:{to:"/trending"}},[t("img",{staticClass:"img-responsive",staticStyle:{"max-height":"150px","min-height":"150px",margin:"0 auto"},attrs:{src:s(69423),alt:"Topics"}})]),t("h5",[e._v("Trending Posts")])],1)]),t("div",{staticClass:"col-lg-4 col-xs-12 text-center"},[t("div",{staticClass:"panel panel-flat panel-body"},[t("router-link",{attrs:{to:"/communities"}},[t("img",{staticClass:"img-responsive",staticStyle:{"max-height":"150px","min-height":"150px",margin:"0 auto"},attrs:{src:s(94994),alt:"Communities"}})]),t("h5",[e._v("Discover Communities")])],1)]),t("div",{staticClass:"col-lg-4 col-xs-12 text-center"},[t("div",{staticClass:"panel panel-flat panel-body"},[t("router-link",{attrs:{to:"/explore"}},[t("img",{staticClass:"img-responsive",staticStyle:{"max-height":"150px","min-height":"150px",margin:"0 auto"},attrs:{src:s(90767),alt:"Services"}})]),t("h5",[e._v("More")])],1)])])]):e._e()]),"BadgeFeed"===e.$route.name?[t("div",{attrs:{slot:"left"},slot:"left"}),t("div",{attrs:{slot:"right"},slot:"right"})]:e._e()],2),e.isCanonicalFeed&&"following"!==e.activeAlgorithm?t("sweet-modal",{ref:"feedInfoModal",attrs:{"overlay-theme":"dark","enable-mobile-fullscreen":!1,width:"mobile"===e.$mq?"100%":"680px",title:e.activeAlgorithmDetails.modalTitle}},[t("div",{staticClass:"text-left"},[t("p",{staticClass:"text-muted"},[e._v(e._s(e.activeAlgorithmDetails.description))]),t("ul",{staticClass:"list list-unstyled no-margin-bottom"},[e._l(e.activeAlgorithmDetails.items,function(s,i){return t("li",{key:e.activeAlgorithm+":"+i,class:{"mb-10":i<e.activeAlgorithmDetails.items.length-1}},[t("i",{staticClass:"icon-checkmark-circle text-success position-left"}),e._v(" "+e._s(s)+" ")])}),t("li",{staticClass:"mt-10"},[t("i",{staticClass:"icon-checkmark-circle text-success position-left"}),e._v(" Hidden tags, ignored accounts, NSFW preferences, and minimum author reputation are still applied client-side after loading. ")])],2),e.activeAlgorithmDetails.moreInfoUrl?t("p",{staticClass:"mt-10 mb-0"},[t("a",{attrs:{href:e.activeAlgorithmDetails.moreInfoUrl,target:"_blank",rel:"noopener"}},[e._v("Learn more about how Affinity works")])]):e._e()]),t("div",{staticClass:"text-right",attrs:{slot:"button"},slot:"button"},[t("button",{staticClass:"btn btn-default btn-xs",on:{click:function(t){return e.$refs.feedInfoModal.close()}}},[e._v("Close")])])]):e._e()],1)},r=[],o=(s(74423),s(44114),s(18111),s(22489),s(20116),s(7588),s(61701),s(18237),s(95353)),l=s(22253),a=s(52767),n=s(94001),c=function(){var e=this,t=e._self._c;return t("div",{staticClass:"page-header page-header-default mb-20"},[t("div",{staticClass:"page-header-content",class:e.$route.path.startsWith("/explore/")?"border-top-lg border-top-primary":"border-bottom-lg border-bottom-primary"},[t("div",{staticClass:"fixed-width-content"},[t("div",{staticClass:"max-width-1200"},[t("div",{staticClass:"page-title text-center"},[t("h3",{staticClass:"text-semibold"},[e._v(" "+e._s(e.resolvedPageTitle)+" "),e.showAlgorithmInfo?t("a",{staticClass:"text-muted ml-5",attrs:{title:"How this feed works","aria-label":"How this feed works"},on:{click:function(t){return e.$emit("show-algorithm-info")}}},[t("i",{staticClass:"icon-info22"}
1)]):e._e()]),t("div",{staticClass:"heading-elements title-action-button"},[e.enableFilters?t("ul",{staticClass:"icons-list"},[t("li",[t("a",{staticClass:"text-uppercase text-semibold",class:{"text-primary":e.activeFilters},on:{click:function(t){e.showFilters=!e.showFilters}}},[t("span",{staticClass:"hidden-xs"},[e._v("Filters ")]),t("i",{staticClass:"icon-filter3 icon-large"})])])]):e._e(),"mobile"!==e.$mq?t("view-mode-selector",{}):e._e(),t("ul",{staticClass:"icons-list"},[t("li",[t("a",{staticClass:"text-default",on:{click:function(t){return e.$emit("refresh")}}},[t("i",{staticClass:"icon-reload-alt icon-large"})])])])],1)]),e.algorithms.length>1?t("div",{staticClass:"text-center feed-algorithms-selector"},["mobile"!==e.$mq?t("ul",{staticClass:"nav nav-pills text-center no-margin mb-10"},e._l(e.algorithms,function(s){return t("li",{key:s.key,class:{active:e.activeAlgorithm===s.key}},[t("router-link",{staticStyle:{"text-align":"center"},attrs:{to:s.route}},[e._v(e._s(s.label))])],1)}),0):t("div",{staticClass:"feed-algorithms-select"},[t("label",{staticClass:"sr-only",attrs:{for:"feed-algorithm"}},[e._v("Feed algorithm")]),t("select",{staticClass:"form-control",attrs:{id:"feed-algorithm","aria-label":"Feed algorithm"},domProps:{value:e.activeAlgorithm},on:{change:function(t){return e.$emit("algorithm-change",t.target.value)}}},e._l(e.algorithms,function(s){return t("option",{key:s.key,domProps:{value:s.key}},[e._v(e._s(s.label))])}),0)])]):e._e()])])]),e.showFilters&&e.enableFilters?t("div",{staticClass:"breadcrumb-line"},[t("div",{staticClass:"fixed-width-content"},[t("div",{staticClass:"max-width-1200 text-center"},[t("ul",{staticClass:"list-inline no-margin-bottom p-10"},[t("li",[t("p-check",{staticClass:"p-default p-fill p-smooth p-bigger mr-10",attrs:{name:"check",color:"info",disabled:!e.isFollowingFeed||e.isLoading},on:{change:function(t){return e.$emit("exclude-reblog-change",e.filterExcludeReblog)}},model:{value:e.filterExcludeReblog,callback:function(t){e.filterExcludeReblog=t},expression:"filterExcludeReblog"}}),t("span",{class:{"text-muted":!e.isFollowingFeed||e.isLoading}},[e._v("Exclude Reblog")])],1),t("li",[t("p-check",{staticClass:"p-default p-fill p-smooth p-bigger mr-10",attrs:{name:"check",color:"info",disabled:e.isLoading},on:{change:function(t){return e.$emit("exclude-curated-change",e.filterExcludeCurated)}},model:{value:e.filterExcludeCurated,callback:function(t){e.filterExcludeCurated=t},expression:"filterExcludeCurated"}}),t("span",{class:{" text-muted":e.isLoading}},[e._v("Exclude Voted")])],1),e.currentUser&&e.currentUser.username===e.feedAccount?[t("li",[t("p-check",{staticClass:"p-default p-fill p-smooth p-bigger mr-10",attrs:{name:"check",color:"info"},on:{change:e.changeUsersFilter},model:{value:e.filterUsersEnabled,callback:function(t){e.filterUsersEnabled=t},expression:"filterUsersEnabled"}}),t("dropdown",{staticClass:"dropdown-menu-xs",attrs:{tag:"span","menu-right":""}},[t("a",{staticClass:"text-default"},[e._v("My Favorites "),t("span",{staticClass:"caret"})]),e.filterUsersSelected&&e.filterUsersSelected.length>0?t("template",{slot:"dropdown"},[e._l(e.filterUsersSelected.slice(0,20),function(s){return t("li",{key:s.name},[t("a",{on:{click:function(e){e.stopPropagation(),s.selected=!s.selected}}},[t("p-check",{staticClass:"p-default p-fill p-smooth p-bigger",attrs:{name:"check",color:"info"},model:{value:s.selected,callback:function(t){e.$set(s,"selected",t)},expression:"user.selected"}}),e._v(" "+e._s(s.name)+" ")],1)])}),e.filterUsersSelected.length>20?t("li",[t("a",{staticClass:"text-muted"},[e._v("... and "+e._s(e.filterUsersSelected.length-20)+" more")])]):e._e(),t("li",{staticClass:"divider"}),t("li",{staticClass:"text-center"},[t("button",{staticClass:"btn btn-xxs btn-primary",attrs:{disabled:e.isLoading},on:{click:function(t){return e.applyUsersFilter()}}},[e._v("Apply")])])],2):t("template",{slot:"dropdown"},[t("li",[t("a",[t("span",{staticClass:"text-muted"},[e._v("Add users to "),t("em",[e._v("Favorites")]),e._v(" to use this filter")])])])])],2)],1),t("li",[t("p-check",{staticClass:"p-default p-fill p-smooth p-bigger mr-10",attrs:{name:"check",color:"info",disabled:!e.filterListEnabled},on:{change:e.changeListFilter},model:{value:e.filterListEnabled,callback:function(t){e.filterListEnabled=t},expression:"filterListEnabled"}}),t("dropdown",{staticClass:"dropdown-menu-xs",attrs:{tag:"span","menu-right":""}},[t("a",{staticClass:"text-default"},[e._v(e._s(e.$route.query.list||"My Lists")+" "),t("span",{staticClass:"caret"})]),t("template",{slot:"dropdown"},[0===e.currentUser.lists.length?t("li",[t("router-link",{attrs:{to:"/@"+e.currentUser.username+"/lists"}},[e._v("No lists yet. Click to organize your lists")])],1):e._l(e.currentUser.lists,function(s){return t("li",{key:s.name},[t("router-link",{attrs:{to:`/@${e.currentUser.username}/favorites?list=${s.name}`}},[e._v(e._s(s.name))])],1)}
1)],2)],2)],1)]:e._e()],2)])])]):e._e()])},u=[],d=s(65284),h={name:"FeedHeader",components:{ViewModeSelector:d.A},mixins:[],props:{isLoading:{type:Boolean,required:!0},pageTitleOverride:{type:String,default:null},enableFilters:{type:Boolean,default:!0},algorithms:{type:Array,default:()=>[]},activeAlgorithm:{type:String,default:"following"},showAlgorithmInfo:{type:Boolean,default:!1}},data(){return{showFilters:!1,filterExcludeReblog:!1,filterExcludeCurated:!1,filterUsersSelected:[],filterUsersEnabled:this.$route.path.includes("/favorites")&&void 0===this.$route.query.list,filterListEnabled:this.$route.path.includes("/favorites")&&void 0!==this.$route.query.list}},computed:{...(0,o.L8)({currentUser:"currentUser",currentUserPrefs:"currentUserPrefs"}),resolvedPageTitle:function(){return this.pageTitleOverride?this.pageTitleOverride:this.feedAccount?this.currentUser&&this.feedAccount===this.currentUser.username?this.$route.query.list?`UL / ${this.$route.query.list.charAt(0).toUpperCase()+this.$route.query.list.slice(1)}`:this.$route.path.includes("/favorites")?"UL / Favorites":this.$route.path.includes("/authors")?"UL / Custom authors":"My Following":`@${this.feedAccount}'s Following`:""},feedAccount:function(){return this.$route.params.username||null},isFollowingFeed:function(){return this.$route.name.includes("Feed")},activeFilters:function(){return this.filterExcludeReblog||this.filterExcludeCurated||this.filterUsersEnabled||this.filterListEnabled}},methods:{applyUsersFilter:function(){if(this.filterUsersSelected.length){const e=this.filterUsersSelected.filter(e=>e.selected).map(e=>e.name).join(",");this.$router.push(`/@${this.feedAccount}/favorites?users=${e}`)}else this.$router.push(`/@${this.feedAccount}/feed`)},changeUsersFilter:function(e){e?this.$router.push(`/@${this.feedAccount}/favorites`):this.$router.push(`/@${this.feedAccount}/feed`)},changeListFilter:function(e){e||this.$router.push(`/@${this.feedAccount}/feed`)},initFavoriteUsers:function(){if(!this.currentUser)return;const e=this.$route.query.users?this.$route.query.users.split(","):[];this.currentUser.preferredUsers&&this.currentUser.preferredUsers.length&&this.currentUser.preferredUsers.forEach(t=>{-1===this.filterUsersSelected.findIndex(e=>e.name===t)&&this.filterUsersSelected.push({name:t,selected:e.includes(t)})})}},beforeMount(){var e,t;this.filterExcludeReblog=this.$route.query.reblog?"false"===this.$route.query.reblog:(null===(e=this.currentUserPrefs)||void 0===e?void 0:e.filterExcludeReblog)||!1,this.filterExcludeCurated=this.$route.query.voted?"false"===this.$route.query.voted:(null===(t=this.currentUserPrefs)||void 0===t?void 0:t.filterExcludeCurated)||!1,this.initFavoriteUsers()}},f=h,g=s(81656),m=(0,g.A)(f,c,u,!1,null,"637c4a32",null),p=m.exports,v=s(4019);const y=[{key:"following",label:"Following"},{key:"fyp",label:"Affinity",modalTitle:'How "Affinity" works',description:"Affinity is a personalized recommendation feed powered by HAF FYP. It uses your public Hive activity to rank recent posts without relying on off-chain tracking.",moreInfoUrl:"https://peakd.com/hive-139531/@hdev/hdev-team-haf-updates--waggle--haf-fyp-a-for-you-feed-for-hive",items:["Ranking combines relevance to your recent activity, recency, engagement, and author credibility.","Posts from communities you subscribe to or engage with can receive an additional community boost.","If there is not enough activity to personalize the feed yet, it falls back to a globally ranked feed.","The algorithm weights and per-post ranking signals are published by the HAF FYP API."],emptyState:"Looks like there are no Affinity recommendations available yet."},{key:"discovery",label:"Discovery",modalTitle:'How "Discovery" works',description:"This feed looks at recent posts upvoted by accounts you follow, then ranks them to surface a balanced mix of fresh posts from authors you follow and authors you do not.",items:["We only use votes from accounts you follow.","We only consider votes from the last 5 days and posts from the last 5 days.","A post needs at least 2 qualifying votes from your followed accounts to become a candidate.","Ranking combines vote count, weighted vote strength, hot/trending score, and stronger freshness bonuses for newer posts.","We mix posts from authors you already follow with posts from authors you do not, while only including top-level posts that are valid, visible, and not muted."],emptyState:"Looks like there is nothing to discover yet. Follow more active curators to improve your recommendations."},{key:"reblogged",label:"Most Reblogged",modalTitle:'How "Most Reblogged" works',description:"This feed ranks posts that have been reblogged by stronger accounts recently, while filtering out low-reputation and reblog-heavy signal.",items:["We only count recent reblogs from the last 3 days on posts from the last 3 days.","Rebloggers must have at least 40 reputation to qualify.","Accounts need at least as many root posts in the last 15 days as qualifying reblogs in this feed window.","Ranking favors qualified reblog count first, then reblog freshness, then hot and trending scores."],emptyState:"Looks like there are no strongly reblogged posts to show yet."},{key:"mixed",label:"Mixed",modalTitle:'How "Mixed" works',description:"This feed interleaves multiple sources into one stream, blending social discovery with followed accounts, communities, ranking feeds, and snaps or waves.",items:["We combine discovery, following, subscribed communities, trending, hot, and snaps or waves from the last 3 days.","The source order is deterministic, so each page keeps the same mix pattern instead of filling from a single source.","Duplicate posts are removed, keeping the earliest slot where they appeared.","This first version does not adapt to engagement yet; it uses a fixed mix pattern."],emptyState:"Looks like there is nothing to mix into your discovery feed yet."}];var b={name:"Feed",components:{FeedHeader:p,PostStream:v.A},mixins:[a.Ay,n.A],props:{showHeader:{type:Boolean,default:!0},forceExcludeReblog:{type:Boolean,default:!1}},data(){return{filterExcludeReblog:null,filterExcludeCurated:null,feedPosts:[],startAuthor:null,startPermlink:null,startPostId:0,lastLoadedPost:null,fypPage:1,isLoading:!1}},watch:{hiddenTags:function(){this.refresh()},currentUserNSFWSetting:function(){"following"!==this.activeAlgorithm&&this.refresh()},filterExcludeReblog:{handler:async function(e,t){var s;null!==t&&void 0!==t&&(this.currentUser&&(null===(s=this.currentUser)||void 0===s?void 0:s.username)===this.$route.params.username&&await this.$store.dispatch("refreshFollowing"),this.refresh(),this.$store.dispatch("updatePref",{key:"filterExcludeReblog",value:this.filterExcludeReblog}))},immediate:!0},filterExcludeCurated:function(e,t){null!==t&&(this.refresh(),this.$store.dispatch("updatePref",{key:"filterExcludeCurated",value:this.filterExcludeCurated}))}},computed:{...(0,o.L8)({currentUser:"currentUser",currentUserPrefs:"currentUserPrefs",currentUserFollowing:"currentUserFollowing",currentUserIgnoredAccounts:"currentUserIgnoredAccounts",currentUserNSFWSetting:"currentUserNSFWSetting",confirmActionModal:"confirmActionModal"}),feedAccount:function(){return this.$route.params.username||null},isCanonicalFeed:function(){return"Feed"===this.$route.name&&this.$route.path===`/@${this.feedAccount}/feed`},isOwnFeed:function(){return!!this.currentUser&&this.currentUser.username===this.feedAccount},activeAlgorithm:function(){if(!this.isCanonicalFeed||!this.isOwnFeed)return"following";const e="string"===typeof this.$route.query.algorithm?this.$route.query.algorithm.toLowerCase():"following";return y.find(t=>t.key===e)?e:"following"},activeAlgorithmDetails:function(){return y.find(e=>e.key===this.activeAlgorithm)||y[0]},availableAlgorithms:function(){return this.isCanonicalFeed&&this.isOwnFeed?y:[y[0]]},algorithmOptions:function(){return this.isCanonicalFeed?this.availableAlgorithms.map(e=>({key:e.key,label:e.label,route:this.getAlgorithmRoute(e.key)})):[]},unifiedPageTitle:function(){return this.isCanonicalFeed?this.isOwnFeed?"My Feed":`@${this.feedAccount}'s Feed`:null},hiddenTags:function(){var e;return(null===(e=this.currentUserPrefs)||void 0===e?void 0:e.hiddenTags)||[]}},methods:{setFilterExcludeReblog:function(e){this.filterExcludeReblog=e},setFilterExcludeCurated:function(e){this.filterExcludeCurated=e},getAlgorithmRoute:function(e){const t={...this.$route.query};return"following"===e?delete t.algorithm:(t.algorithm=e,delete t.reblog,delete t.voted),{path:`/@${this.feedAccount}/feed`,query:t}},selectAlgorithm:function(e){this.$router.push(this.getAlgorithmRoute(e))},openInfoModal:function(){this.$refs.feedInfoModal&&this.$refs.feedInfoModal.open()},filterFollowingPosts:async function(e){let t=e.filter(e=>{const t=this.getJsonMetadata(e);if(t.hidden)return!1;if(t.original_author&&t.original_permlink&&t.original_author===e.author)return!1;if(this.hasLowAuthorReputation(e))return!1;if((this.filterExcludeReblog||"BadgeFeed"===this.$route.name)&&(!this.currentUserFollowing||!this.currentUserFollowing.has(e.author))&&e.reblogged_by&&e.reblogged_by.length>0)return!1;if(this.currentUser){if(this.filterExcludeCurated&&-1!==e.active_votes.findIndex(e=>e.voter===this.currentUser.username))return!1;if(this.hiddenTags){const s=this.getTags(e,t).concat([e.category]).map(e=>e.toLowerCase());if(this.hiddenTags.find(e=>-1!==s.indexOf(e)))return!1}
1if(this.currentUserIgnoredAccounts){if(this.currentUserIgnoredAccounts.includes(e.author))return!1;if(t.original_author&&this.currentUserIgnoredAccounts.includes(t.original_author))return!1}if("hide"===this.currentUserNSFWSetting&&this.getHasNsfwContent(e))return!1}return!0});return this.enrichWithTips(t),t},filterDiscoveryPosts:async function(e){const t=e.filter(e=>{if(!e||!e.author||!e.permlink)return!1;if(this.isPostDeleted(e))return!1;const t=this.getJsonMetadata(e);if(t.hidden)return!1;if(t.original_author&&t.original_permlink&&t.original_author===e.author)return!1;if(this.hasLowAuthorReputation(e))return!1;if(this.hiddenTags.length){const s=this.getTags(e,t).concat([e.category]).map(e=>e.toLowerCase());if(this.hiddenTags.find(e=>-1!==s.indexOf(e)))return!1}if(this.currentUserIgnoredAccounts){if(this.currentUserIgnoredAccounts.includes(e.author))return!1;if(t.original_author&&this.currentUserIgnoredAccounts.includes(t.original_author))return!1}return"hide"!==this.currentUserNSFWSetting||!this.getHasNsfwContent(e)});return t.length&&await this.enrichWithTips(t),t},loadMore:function(){return"following"===this.activeAlgorithm?this.loadMoreFollowing():this.loadMoreDiscovery()},loadMoreFollowing:async function(){if(this.isLoading)return null;if(this.isLoading=!0,console.log("Fetching more posts, current feed size: "+this.feedPosts.length),this.$route.path.includes("/favorites")||this.$route.path.includes("/authors")){let t=this.$route.query.list?"/hive/feed/list":"/hive/feed/authors",s=this.$route.query.list?{list:this.$route.query.list,sort:this.$route.query.sort}:this.$route.query.users?{authors:this.$route.query.users}:{authors:this.currentUser.preferredUsers.join(",")};if(!s.list&&!s.authors)return console.log("Cannot fetch by users with an empty list"),this.isLoading=!1,{completed:!0,size:0};try{var e;const i=await this.$http.get("/api"+t,{params:{...s,lastId:this.startPostId}});if(null===(e=i.data)||void 0===e||!e.length)return{completed:!0,size:0};this.startPostId=i.data[i.data.length-1].id;const r=await l.A.getPosts(i.data.map(e=>`${e.author}/${e.permlink}`));if(!r.length)return{completed:!0,size:0};const o=await this.filterFollowingPosts(r);return this.feedPosts=this.feedPosts.concat(o),console.log("Loaded more posts, current feed size: "+this.feedPosts.length),{completed:r.length<20,size:r.length}}finally{this.isLoading=!1}}else try{const e=await l.A.getAccountPosts({sort:"feed",account:this.feedAccount,limit:20,start_author:this.startAuthor,start_permlink:this.startPermlink});if(!Array.isArray(e))throw new Error("The response is in an invalid format");if(this.startAuthor&&e.length>0&&e[0].author===this.startAuthor&&e[0].permlink===this.startPermlink&&e.shift(),0===e.length)return{completed:!0,size:0};this.startAuthor=e[e.length-1].author,this.startPermlink=e[e.length-1].permlink;const t=await this.filterFollowingPosts(e);return this.feedPosts=this.feedPosts.concat(t),console.log("Loaded more posts, current feed size: "+this.feedPosts.length),{completed:0===e.length,size:t.length}}finally{this.isLoading=!1}},loadMoreDiscovery:async function(){if(this.isLoading)return null;if(!this.isCanonicalFeed||!this.isOwnFeed)return{completed:!0,size:0};this.isLoading=!0;try{this.currentUserIgnoredAccounts||await this.$store.dispatch("refreshIgnoredAccounts");let e=[],t=[];if("fyp"===this.activeAlgorithm)t=await this.$http.get(`https://testapi.hivescan.info/haf-fyp-api/v1/fyp/feed/${this.feedAccount}`,{params:{page:this.fypPage,"page-size":20}}).then(e=>e.data);else{if(e=await this.$http.get("/api/hive/feed/discovery",{params:{..."discovery"!==this.activeAlgorithm?{algorithm:this.activeAlgorithm}:{},...this.lastLoadedPost?{cursorAuthor:this.lastLoadedPost.author,cursorPermlink:this.lastLoadedPost.permlink}:{}}}).then(e=>e.data),!Array.isArray(e))throw new Error("The response is in an invalid format");if(!e.length)return{completed:!0,size:0};t=await l.A.getPosts(e.map(e=>`${e.author}/${e.permlink}`),!1)}if(!Array.isArray(t))throw new Error("The response is in an invalid format");if("reblogged"===this.activeAlgorithm){const s=e.reduce((e,t)=>
1(e[`${t.author}/${t.permlink}`]=t.reblogs||0,e),{});t.forEach(e=>{e.discovery_reblogs=s[`${e.author}/${e.permlink}`]||0})}const s=await this.filterDiscoveryPosts(t);return this.feedPosts=this.feedPosts.concat(s),this.lastLoadedPost=e.length?{...e[e.length-1]}:null,"fyp"===this.activeAlgorithm&&(this.fypPage+=1),await this.$nextTick(),{completed:"fyp"===this.activeAlgorithm?t.length<20:e.length<20,size:s.length}}finally{this.isLoading=!1}},refresh:function(){this.feedPosts=[],this.startAuthor=null,this.startPermlink=null,this.startPostId=0,this.lastLoadedPost=null,this.fypPage=1,this.isLoading=!1,this.$refs.postsStream&&this.$refs.postsStream.reset()}},beforeMount(){var e,t;this.forceExcludeReblog?this.filterExcludeReblog=this.forceExcludeReblog:this.filterExcludeReblog=this.$route.query.reblog?"false"===this.$route.query.reblog:(null===(t=this.currentUserPrefs)||void 0===t?void 0:t.filterExcludeReblog)||!1;this.filterExcludeCurated=this.$route.query.voted?"false"===this.$route.query.voted:(null===(e=this.currentUserPrefs)||void 0===e?void 0:e.filterExcludeCurated)||!1},mounted(){"following"!==this.activeAlgorithm&&this.currentUser&&this.$store.dispatch("refreshIgnoredAccounts")},beforeRouteEnter(e,t,s){e.path.includes("/favorites")||e.path.includes("/authors")?s(t=>{t.currentUser&&t.currentUser.username===e.params.username?s():s(`/error?path=${t.$route.fullPath}`)}):s()}},w=b,x=(0,g.A)(w,i,r,!1,null,"0a1cdb5c",null),k=x.exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.