chunk-0ed87fba.js
15.4 KB
(window["aioseopjsonp"]=window["aioseopjsonp"]||[]).push([["chunk-0ed87fba","chunk-8ec9c532"],{"039e":function(t,e,s){"use strict";var i=s("5530"),n=(s("d81d"),s("a9e3"),s("caad"),s("2532"),s("d3b7"),s("2f62"));e["a"]={computed:Object(i["a"])(Object(i["a"])({},Object(n["e"])(["linkAssistant"])),{},{isPrioritizedPost:function(){var t=this.linkAssistant.linksReport.prioritizedPosts;return Array.isArray(t)&&(t=t.map(Number)),t.includes(parseInt(this.post.ID))}}),methods:Object(i["a"])(Object(i["a"])({},Object(n["b"])("linkAssistant",["linksRefresh"])),{},{doRefresh:function(){var t=this;this.refreshLoading=!0,this.$bus.$emit("updatingLinks",!0),this.linksRefresh({postIndex:this.postIndex,postId:this.post.ID,linksReport:!0}).finally((function(){t.refreshLoading=!1,t.$bus.$emit("updatingLinks",!1)}))}})}},"1b6a":function(t,e,s){"use strict";s("159b"),s("498a"),s("4d63"),s("ac1f"),s("25f0"),s("841c");var i=s("ab86"),n=s("5f74");e["a"]={methods:{filteredSuggestionsOutbound:function(t){var e=this,s=t.links.suggestionsOutbound.rows,i=[];return s.forEach((function(t){e.editorIsSuggestionAlreadyAdded(t)||i.push(t)})),i},editorIsSuggestionAlreadyAdded:function(t){return Object(n["a"])()?this.blockEditorIsSuggestionAlreadyAdded(t):!!Object(n["b"])()&&this.classicEditorIsSuggestionAlreadyAdded(t)},blockEditorIsSuggestionAlreadyAdded:function(t){var e=window.wp.data.select("core/block-editor").getBlocks();return!!e&&this.doesBlockHaveLink(e,t)},doesBlockHaveLink:function(t,e){var s=this,n=!1;return t.forEach((function(t){!n&&t.attributes&&e.suggestions.forEach((function(o){var a=Object(i["a"])(o.context.permalink.trim()),r=new RegExp('(<a href="'.concat(a,'"[^<>]*>)(.*)(</a[^<>]*>)'),"i");if(t.attributes.content&&-1!==t.attributes.content.search(r))n=!0;else if(t.innerBlocks){var l=s.doesBlockHaveLink(t.innerBlocks,e);l&&(n=!0)}}))})),n},classicEditorIsSuggestionAlreadyAdded:function(t){var e="",s=null,n=null;if(document.querySelector("#wp-content-wrap.tmce-active")?(s=window.tinyMCE.get("content"),e=s.getContent({format:"raw"})):(n=document.querySelector("textarea#content"),e=n?n.value:""),!e)return!1;var o=!1;return t.suggestions.forEach((function(t){var s=Object(i["a"])(t.context.permalink.trim()),n=new RegExp('(<a href="'.concat(s,'"[^<>]*>)(.*)(</a[^<>]*>)'),"i");-1!==e.search(n)&&(o=!0)})),o}}}},4673:function(t,e,s){},"95e5":function(t,e,s){"use strict";s("9c5a")},"9c5a":function(t,e,s){},d156:function(t,e,s){"use strict";s("4673")},d3eb:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"aioseo-link-assistant-links-report"},[s("base-wp-table",{key:t.tableKey,ref:"table",staticClass:"posts-table",attrs:{columns:t.columns,rows:t.linksReport.rows,totals:t.linksReport.totals,filters:t.linksReport.filters,"additional-filters":t.additionalFilters,loading:t.wpTableLoading,initialPageNumber:t.linksReport.tableFields.paginatedPage,initialSearchTerm:t.linksReport.tableFields.searchTerm,showBulkActions:!1},on:{"filter-table":t.processFilter,"additional-filter-option-selected":t.processAdditionaFilterOptionSelected,"process-additional-filters":t.processAdditionalFilters,paginate:t.processPagination,search:t.processSearch},scopedSlots:t._u([{key:"post_title",fn:function(e){var i=e.row,n=e.index,o=e.editRow;return[s("div",{staticClass:"post-title"},[s("a",{class:{active:t.isRowActive(n)},attrs:{href:"#"},on:{click:function(e){o(n),t.toggleRow(n)}}},[t._v(" "+t._s(i.post_title)+" ")])]),s("div",{staticClass:"row-actions"},[s("span",[s("a",{staticClass:"view",attrs:{href:i.context.permalink,target:"_blank"}},[s("span",[t._v(t._s(t.strings.view))])]),t._v(" | ")]),s("span",[s("a",{staticClass:"view",attrs:{href:i.context.editLink,target:"_blank"}},[s("span",[t._v(t._s(t.strings.editPost))])]),t._v(" | ")]),s("span",[s("a",{staticClass:"delete-all-links",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.maybeDeleteAllLinks(n)}}},[s("span",[t._v(t._s(t.strings.deleteAllLinks))])])])])]}},{key:"publish_date",fn:function(e){var i=e.row;return[s("span",{staticClass:"date"},[t._v(t._s(t.$moment.utc(i.post_date).tz(t.$moment.tz.guess()).format("MMMM D, YYYY")))])]}},{key:"internal",fn:function(e){var i=e.editRow,n=e.index,o=e.editRowActive;return[s("div",{staticClass:"internal-links-count"},[s("div",{on:{click:function(e){return t.maybeEditRow("inbound-internal",i,o,n)}}},[s("div",{staticClass:"aioseo-tooltip-wrapper"},[s("core-tooltip",{staticClass:"action",scopedSlots:t._u([{key:"tooltip",fn:function(){return[s("span",{domProps:{innerHTML:t._s(t.strings.inboundInternal)}})]},proxy:!0}],null,!0)},[s("svg-link-internal-inbound"),s("span",[t._v(t._s(t.$numbers.numberFormat(t.getLinksReportCounts[n].inboundInternal)))])],1)],1)]),s("div",{on:{click:function(e){return t.maybeEditRow("outbound-internal",i,o,n)}}},[s("div",{staticClass:"aioseo-tooltip-wrapper"},[s("core-tooltip",{staticClass:"action",scopedSlots:t._u([{key:"tooltip",fn:function(){return[s("span",{domProps:{innerHTML:t._s(t.strings.outboundInternal)}})]},proxy:!0}],null,!0)},[s("svg-link-internal-outbound"),s("span",[t._v(t._s(t.$numbers.numberFormat(t.getLinksReportCounts[n].outboundInternal)))])],1)],1)])])]}},{key:"suggestions",fn:function(e){var i=e.editRow,n=e.index,o=e.editRowActive;return[s("div",{on:{click:function(e){return t.maybeEditRow("link-suggestions",i,o,n)}}},[s("svg-link-suggestion"),t._v(" "+t._s(t.$numbers.numberFormat(t.getLinksReportCounts[n].suggestionsInbound+t.getLinksReportCounts[n].suggestionsOutbound))+" ")],1)]}},{key:"affiliate",fn:function(e){var i=e.editRow,n=e.index,o=e.editRowActive;return[s("div",{on:{click:function(e){return t.maybeEditRow("affiliate",i,o,n)}}},[s("svg-link-affiliate"),t._v(" "+t._s(t.$numbers.numberFormat(t.getLinksReportCounts[n].affiliate))+" ")],1)]}},{key:"external",fn:function(e){var i=e.editRow,n=e.index,o=e.editRowActive;return[s("div",{on:{click:function(e){return t.maybeEditRow("external",i,o,n)}}},[s("svg-link-external"),t._v(" "+t._s(t.$numbers.numberFormat(t.getLinksReportCounts[n].external))+" ")],1)]}},{key:"toggle-button",fn:function(e){var i=e.index,n=e.editRow;return[s("button",{staticClass:"toggle-row-button",class:{active:t.isRowActive(i)},on:{click:function(e){n(i),t.toggleRow(i)}}},[s("svg-caret")],1)]}},{key:"edit-row",fn:function(e){var i=e.row,n=e.index;return[s("LinksReportInner",{key:t.innerTableKey,attrs:{post:i,postIndex:n,postId:t.getPostId(i.ID),initialActiveTab:t.initialActiveTab}})]}}])}),s("link-assistant-confirmation-modal",{attrs:{showModal:t.showModal,selectedRows:t.selectedRows,strings:t.modalStrings},on:{doBulkAction:t.deleteAllLinks,closeModal:function(e){t.showModal=!1}}})],1)},n=[],o=s("5530"),a=(s("d3b7"),s("b0c0"),s("4de4"),s("7db0"),s("159b"),s("4fad"),s("e811")),r=s("2f62"),l={components:{LinksReportInner:a["default"]},data:function(){return{initialActiveTab:"inbound-internal",tableKey:0,innerTableKey:0,activeRow:-1,wpTableLoading:!1,showModal:!1,selectedRows:null,bulkAction:null,selectedFilters:{"post-types":"all"},additionalFilters:null,strings:{view:this.$t.__("View",this.$tdPro),editPost:this.$t.__("Edit Post",this.$tdPro),deleteAllLinks:this.$t.__("Delete All Links",this.$tdPro),inboundInternal:this.$t.sprintf(this.$t.__("%1$sInbound Internal Links%2$sLinks from other posts to this post",this.$tdPro),"<strong>","</strong><br />"),outboundInternal:this.$t.sprintf(this.$t.__("%1$sOutbound Internal Links%2$sLinks from this post to other posts",this.$tdPro),"<strong>","</strong><br />")},modalStrings:{areYouSureSingle:this.$t.__("Are you sure you want to delete all links for this domain?",this.$tdPro),actionCannotBeUndone:this.$t.__("This action cannot be undone.",this.$tdPro),yesSingle:this.$t.__("Yes, I want to delete all links",this.$tdPro),noChangedMind:this.$t.__("No, I changed my mind",this.$tdPro)}}},computed:Object(o["a"])(Object(o["a"])(Object(o["a"])({},Object(r["e"])("linkAssistant",["linksReport"])),Object(r["c"])("linkAssistant",["getLinksReportCounts"])),{},{columns:function(){return[{slug:"post_title",label:this.$t.__("Post Title",this.$tdPro),width:"100%"},{slug:"publish_date",label:this.$t.__("Publish Date",this.$tdPro),width:"170px"},{slug:"internal",label:this.$t.__("Internal",this.$tdPro),width:"150px"},{slug:"affiliate",label:this.$t.__("Affiliate",this.$tdPro),width:"90px"},{slug:"external",label:this.$t.__("External",this.$tdPro),width:"90px"},{slug:"suggestions",label:this.$t.__("Suggestions",this.$tdPro),width:"110px"},{slug:"toggle-button",label:"",width:"60px"}]}}),methods:Object(o["a"])(Object(o["a"])(Object(o["a"])({},Object(r["b"])("linkAssistant",["linksReportPaginate","linksReportSearch","linksReportFilter","linksReportAdditionalFilter","linksReportDeleteAll","setLinksReportCounts"])),Object(r["d"])("linkAssistant",["setPaginatedPage"])),{},{getPostId:function(t){return parseInt(t)},isRowActive:function(t){return t===this.activeRow},maybeEditRow:function(t,e,s,i){return s?this.initialActiveTab===t?(e(i),void this.toggleRow(i)):(this.initialActiveTab=t,void this.innerTableKey++):(this.initialActiveTab=t,e(i),void this.toggleRow(i))},toggleRow:function(t){this.activeRow!==t?this.activeRow=t:this.activeRow=-1},maybeDeleteAllLinks:function(t){!1!==t&&(this.selectedRows=t,this.showModal=!0)},deleteAllLinks:function(){var t=this;this.showModal=!1;var e=this.linksReport.rows[this.selectedRows].ID;if(e)return this.wpTableLoading=!0,this.linksReportDeleteAll({postId:e,searchTerm:this.linksReport.tableFields.searchTerm,selectedFilters:this.selectedFilters}).finally((function(){t.activeRow=-1,t.wpTableLoading=!1,t.tableKey++}))},processPagination:function(t){var e=this;this.setPaginatedPage({group:"linksReport",page:t}),this.wpTableLoading=!0,this.linksReportPaginate({page:t,selectedFilters:this.selectedFilters,searchTerm:this.linksReport.tableFields.searchTerm}).finally((function(){e.activeRow=-1,e.wpTableLoading=!1,e.tableKey++}))},processSearch:function(t){var e=this;this.wpTableLoading=!0,this.linksReport.tableFields.searchTerm=t,this.linksReportSearch({searchTerm:t,page:1}).finally((function(){e.activeRow=-1,e.wpTableLoading=!1,e.$refs.table.setPageNumber(e.linksReport.totals.page),e.tableKey++}))},processFilter:function(t){var e=this;this.wpTableLoading=!0,this.selectedFilters.mainFilter=t.slug,this.linksReportFilter({slug:t.slug}).finally((function(){e.activeRow=-1,e.wpTableLoading=!1,e.tableKey++}))},processAdditionaFilterOptionSelected:function(t){var e=this,s=t.name,i=t.selectedValue;"post-type"===s&&(this.selectedFilters.mainFilter=i),this.additionalFilters=this.linksReport.additionalFilters.filter((function(t){return"post-type"===t.name||t.dependsOn&&e.selectedFilters.mainFilter===t.dependsOn.value}))},processAdditionalFilters:function(t){var e=this,s=t.filters;if(this.wpTableLoading=!0,s.term){var i=this.additionalFilters.find((function(t){return"term"===t.name}));this.selectedFilters.term=i?s.term:""}else this.selectedFilters.term="";s["post-type"]?this.selectedFilters.mainFilter=s["post-type"]:this.selectedFilters.mainFilter="",this.linksReportAdditionalFilter({selectedFilters:this.selectedFilters}).finally((function(){e.activeRow=-1,e.wpTableLoading=!1,e.tableKey++}))}}),beforeMount:function(){var t=this;this.additionalFilters=this.linksReport.additionalFilters.filter((function(e){return"post-type"===e.name||e.dependsOn&&t.selectedFilters.mainFilter===e.dependsOn.value})),this.$route.query&&(Object.entries(this.$route.query).forEach((function(e){switch(e[0]){case"fullReport":t.processFilter({slug:"all"});break;case"postTitle":t.linksReport.tableFields.searchTerm=t.$route.query.postTitle,t.processSearch(t.$route.query.postTitle);break;case"linkingOpportunities":t.processFilter({slug:"linking-opportunities"});break;case"orphaned-posts":t.processFilter({slug:"orphaned-posts"});break;default:break}})),this.setLinksReportCounts())}},d=l,u=(s("d156"),s("2877")),c=Object(u["a"])(d,i,n,!1,null,null,null);e["default"]=c.exports},e811:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"links-report-inner"},[s("core-main-tabs",{key:t.tabsKey,staticClass:"link-tabs",attrs:{internal:"",tabs:t.tabs,active:t.activeTab},on:{changed:function(e){return t.processChangeTab(e)}},scopedSlots:t._u([{key:"button",fn:function(){return[s("base-button",{staticClass:"button-refresh",attrs:{type:"gray",size:"medium",icon:"svg-refresh",loading:t.refreshLoading,disabled:t.isPrioritizedPost},on:{click:t.doRefresh}},[t._v(" "+t._s(t.strings.refresh)+" ")])]},proxy:!0}])}),"outbound-internal"===t.activeTab?s("link-assistant-outbound-internal",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{openSuggestions:function(e){return t.processChangeTab("link-suggestions","suggestions-outbound")},linksUpdated:function(e){t.tabsKey++}}}):t._e(),"inbound-internal"===t.activeTab?s("link-assistant-inbound-internal",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{openSuggestions:function(e){return t.processChangeTab("link-suggestions","suggestions-inbound")},linksUpdated:function(e){t.tabsKey++}}}):t._e(),"affiliate"===t.activeTab?s("link-assistant-affiliate",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{linksUpdated:function(e){t.tabsKey++}}}):t._e(),"external"===t.activeTab?s("link-assistant-external",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,linksReport:""},on:{linksUpdated:function(e){t.tabsKey++}}}):t._e(),"link-suggestions"===t.activeTab?s("link-assistant-suggestions",{attrs:{post:t.post,postIndex:t.postIndex,postId:t.postId,filteredSuggestionsOutbound:t.filteredSuggestionsOutbound(t.post),initialTab:t.activeSuggestionTab,linksReport:""},on:{showStandalone:function(e){t.showStandalone=!0},suggestionsTabChanged:function(e){return t.activeSuggestionTab=e},linksUpdated:function(e){t.tabsKey++}}}):t._e()],1)},n=[],o=s("5530"),a=(s("a9e3"),s("1b6a")),r=s("039e"),l=s("2f62"),d={mixins:[a["a"],r["a"]],props:{post:{type:Object,required:!0},postIndex:{type:Number,required:!0},postId:{type:Number,required:!0},initialActiveTab:String},data:function(){return{tabsKey:0,activeTab:"inbound-internal",activeSuggestionTab:"suggestions-inbound",refreshLoading:!1,strings:{refresh:this.$t.__("Refresh",this.$t.tdPro)}}},computed:Object(o["a"])(Object(o["a"])({},Object(l["c"])("linkAssistant",["getLinksReportCounts"])),{},{tabs:function(){return[{slug:"inbound-internal",icon:"svg-link-internal-inbound",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].inboundInternal,this.$t.__("Inbound Internal",this.$tdPro))},{slug:"outbound-internal",icon:"svg-link-internal-outbound",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].outboundInternal,this.$t.__("Outbound Internal",this.$tdPro))},{slug:"affiliate",icon:"svg-link-affiliate",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].affiliate,this.$t.__("Affiliate",this.$tdPro))},{slug:"external",icon:"svg-link-external",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].external,this.$t.__("External",this.$tdPro))},{slug:"link-suggestions",icon:"svg-link-suggestion",name:this.$t.sprintf("%1$s %2$s",this.getLinksReportCounts[this.postIndex].suggestionsOutbound+this.getLinksReportCounts[this.postIndex].suggestionsInbound,this.$t.__("Link Suggestions",this.$tdPro))}]}}),methods:{processChangeTab:function(t,e){this.activeTab=t,e&&(this.activeSuggestionTab=e)}},mounted:function(){var t=this;this.initialActiveTab&&this.$nextTick((function(){t.processChangeTab(t.initialActiveTab)}))}},u=d,c=(s("95e5"),s("2877")),p=Object(c["a"])(u,i,n,!1,null,null,null);e["default"]=p.exports}}]);