import{d as D,w as k,b as B}from"./app-core.ae890a3f.js";import{C as S}from"./Index.52399193.js";import{C as T}from"./DonutChartWithLegend.3a5e7d4c.js";import{_ as y}from"./_plugin-vue_export-helper.eefbdd86.js";import{f as s,i as l,j as h,ar as L,aq as p,O as H,U as c,M as d,Q as V,Y as A,aC as b,ad as F,a0 as u,R as E,ae as w,P}from"./vendor-vue-ui.de3ab35f.js";import{a as f,c as O,_ as i}from"./vendor-other.7b559694.js";const G={},U={viewBox:"0 0 16 17",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-edit-paper"};function I(e,C){return s(),l("svg",U,[...C[0]||(C[0]=[h("path",{d:"M9.33335 15.4233V13.3733L13.0167 9.7066C13.1167 9.6066 13.2278 9.53438 13.35 9.48993C13.4722 9.44549 13.5945 9.42327 13.7167 9.42327C13.85 9.42327 13.9778 9.44827 14.1 9.49827C14.2222 9.54827 14.3334 9.62327 14.4334 9.72327L15.05 10.3399C15.1389 10.4399 15.2084 10.551 15.2584 10.6733C15.3084 10.7955 15.3334 10.9177 15.3334 11.0399C15.3334 11.1622 15.3111 11.2872 15.2667 11.4149C15.2222 11.5427 15.15 11.6566 15.05 11.7566L11.3834 15.4233H9.33335ZM10.3334 14.4233H10.9667L12.9834 12.3899L12.6834 12.0733L12.3667 11.7733L10.3334 13.7899V14.4233ZM4.00002 15.4233C3.63335 15.4233 3.31946 15.2927 3.05835 15.0316C2.79724 14.7705 2.66669 14.4566 2.66669 14.0899V3.42327C2.66669 3.0566 2.79724 2.74271 3.05835 2.4816C3.31946 2.22049 3.63335 2.08994 4.00002 2.08994H9.33335L13.3334 6.08994V8.08993H12V6.7566H8.66669V3.42327H4.00002V14.0899H8.00002V15.4233H4.00002ZM12.6834 12.0733L12.3667 11.7733L12.9834 12.3899L12.6834 12.0733Z",fill:"currentColor"},null,-1)])])}const R=y(G,[["render",I]]),N={},W={viewBox:"0 0 285 198",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-overview"};function K(e,C){return s(),l("svg",W,[...C[0]||(C[0]=[L('',2)])])}const z=y(N,[["render",K]]),o="all-in-one-seo-pack",Y={setup(){return{rootStore:B(),settingsStore:k()}},components:{CoreAlert:S,CoreDonutChartWithLegend:T,SvgEditPaper:R,SvgOverview:z},props:{isWpDashboard:{type:Boolean,default(){return!1}},toHide:{type:Array,default(){return[]}},showDescription:{type:Boolean,default(){return!0}}},data(){return{strings:{description:i("Below are the TruSEO scores of your published posts. Take some time to improve your TruSEO score to help increase your rankings.",o),choosePostType:i("Choose a Post Type",o),upgradeToPro:f(i("Get additional keywords and many more modules! %1$s",o),D.getUpsellLink("dashboard","seo-overview",i("Upgrade to Pro Today!",o),"liteUpgrade",!0)),invalidTitle:i("It looks like you haven't selected any post types yet!",o),invalidDescription:i('TruSEO scoring can imrove your search engine rankings. To see TruSEO scores for your published posts, enable at least one post type by turning on "Show in Search Results" in the Search Appearance settings.',o),invalidButton:i("Enable Post Types",o)},postTypeInitial:!0,postType:{},parts:[{slug:"needsImprovement",name:i("Needs Improvement",o),color:"#DF2A4A"},{slug:"okay",name:i("Okay",o),color:"#F18200"},{slug:"good",name:i("Good",o),color:"#00AA63"},{slug:"withoutTruSeoScore",name:i("No TruSEO Score Yet",o),color:"#E8E8EB"}]}},watch:{postType(e){if(this.postTypeInitial){this.postTypeInitial=!1;return}this.settingsStore.toggleRadio({slug:"overviewPostType",value:e.value})}},computed:{postTypes(){const e=[];return this.rootStore.aioseo.postData.postTypes.forEach(C=>{this.rootStore.aioseo.seoOverview[C.name]&&e.push({value:C.name,label:C.label})}),e},totalPosts(){return this.rootStore.aioseo.seoOverview[this.postType.value].total},totalPostsLabel(){return f(i("Total %1$s",o),this.postType.label)},sortedParts(){const e=this.parts;return e.forEach((C,t)=>{e[t].count=this.rootStore.aioseo.seoOverview[this.postType.value][C.slug],e[t].ratio=t===0?100:C.count/this.totalPosts*100,e[t].link=`${this.rootStore.aioseo.urls.editScreen}?post_status=publish&post_type=${this.postType.value}&aioseo-filter=${C.slug}`}),e.filter(C=>C.count!==0),e.forEach((C,t)=>(t===0||e.forEach((_,r)=>(t',f(O("%1$d post","%1$d posts",e,o),e),"")}},mounted(){this.$nextTick(()=>{const e=this.settingsStore.settings.toggledRadio?.overviewPostType,C=this.postTypes.findIndex(t=>e===t.value);this.postType=this.postTypes[C]||this.postTypes[0]||null})}},j={key:0,class:"aioseo-overview-description"},q={class:"aioseo-overview-selector"},Q=["value"],J=["innerHTML"],X={class:"aioseo-overview-title"},$={class:"aioseo-overview-description"},C2=["href"];function e2(e,C,t,_,r,a){const m=p("base-select"),M=p("core-donut-chart-with-legend"),x=p("core-alert"),g=p("svg-edit-paper"),v=p("base-button"),Z=p("svg-overview");return s(),l("div",{class:P(["aioseo-overview",[t.isWpDashboard?"aioseo-overview--wp-styles":"",r.postType?.value?"":"aioseo-overview--invalid"]])},[r.postType?.value?(s(),l(H,{key:0},[t.toHide.includes("description")?d("",!0):(s(),l("p",j,c(r.strings.description),1)),h("div",q,[h("strong",null,c(r.strings.choosePostType),1),t.isWpDashboard?d("",!0):(s(),V(m,{key:0,size:"medium",placeholder:r.strings.choosePostType,options:a.postTypes,modelValue:r.postType,"onUpdate:modelValue":C[0]||(C[0]=n=>r.postType=n)},null,8,["placeholder","options","modelValue"])),t.isWpDashboard?A((s(),l("select",{key:1,"onUpdate:modelValue":C[1]||(C[1]=n=>r.postType=n)},[(s(!0),l(H,null,F(a.postTypes,n=>(s(),l("option",{key:n.value,value:n},c(n.label),9,Q))),128))],512)),[[b,r.postType]]):d("",!0)]),u(M,{parts:a.sortedParts,total:a.totalPosts,label:a.totalPostsLabel,animatedNumber:!t.isWpDashboard},null,8,["parts","total","label","animatedNumber"]),h("p",{innerHTML:a.withoutFocusKeyword},null,8,J),!t.toHide.includes("upgradeAlert")&&!_.rootStore.isPro?(s(),V(x,{key:1,type:"yellow",innerHTML:r.strings.upgradeToPro},null,8,["innerHTML"])):d("",!0)],64)):(s(),l(H,{key:1},[h("div",null,[h("div",X,c(r.strings.invalidTitle),1),h("div",$,c(r.strings.invalidDescription),1),t.isWpDashboard?d("",!0):(s(),V(v,{key:0,type:"blue",size:"medium",tag:"a",href:a.searchAppearanceUrl},{default:E(()=>[u(g),w(" "+c(r.strings.invalidButton),1)]),_:1},8,["href"])),t.isWpDashboard?(s(),l("a",{key:1,href:a.searchAppearanceUrl,class:"button button-primary"},[u(g),w(" "+c(r.strings.invalidButton),1)],8,C2)):d("",!0)]),u(Z)],64))],2)}const a2=y(Y,[["render",e2]]);export{a2 as C};