import{a as A}from"./index.4b887428.js";import{u as k}from"./PostTypes.4e006733.js";import{B}from"./HighlightToggle.51ada893.js";import{C as D}from"./Index.2a391835.js";import{C as N}from"./Tooltip.23c7170d.js";import{G as S,a as I}from"./Row.bb9acf3f.js";import"./translations.e71e2202.js";import{_ as R}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as p}from"./default-i18n.65d58dd6.js";import{a6 as m,o as c,c as f,_ as n,a1 as _,a2 as a,$ as o,a7 as g,a4 as h,F as w,af as L,l as x,ae as G}from"./runtime-core.esm-bundler.ce5add0b.js";const d="all-in-one-seo-pack",O={setup(){const{getPostIconClass:e}=k();return{getPostIconClass:e,rootStore:A()}},components:{BaseHighlightToggle:B,CoreAlert:D,CoreTooltip:N,GridColumn:S,GridRow:I},props:{type:{type:String,required:!0},options:{type:Object,required:!0},registeredPostTypes:Object,excluded:{type:Array,default(){return[]}},supports:{type:Array,default(){return[]}}},data(){return{strings:{label:p("Label:",d),name:p("Slug:",d),noPostTypes:p("No post types available.",d),noTaxonomies:p("No taxonomies available.",d),noPostTypesDescription:p("All post types are set to noindex or your site does not have any post types registered that are supported by this feature.",d),noTaxonomiesDescription:p("All taxonomies are set to noindex or your site does not have any taxonomies registered that are supported by this feature.",d)}}},computed:{getRegisteredPostTypes(){return this.registeredPostTypes||this.rootStore.aioseo.postData},postTypes(){return this.getRegisteredPostTypes[this.type].filter(e=>{let r=!0;return this.supports.length&&e.supports.length&&(r=this.supports.every(t=>e.supports.includes(t))),r&&!this.excluded.includes(e.name)})}},methods:{emitInput(e){this.$emit("input",e)},updateValue(e,r){if(e){const l=this.options[this.type].included;l.push(r.name),this.options[this.type].included=l;return}const t=this.options[this.type].included.findIndex(l=>l===r.name);t!==-1&&this.options[this.type].included.splice(t,1)},getValue(e){return this.options[this.type].included.includes(e.name)},isActive(e){return this.options[this.type].included.findIndex(t=>t===e.name)!==-1}}},U={class:"aioseo-post-type-options-toggle"},j={class:"post-type-options-settings"},q={class:"aioseo-description"},z=n("br",null,null,-1);function F(e,r,t,l,u,i){const y=m("core-alert"),T=m("core-tooltip"),b=m("base-highlight-toggle"),v=m("grid-column"),C=m("grid-row");return c(),f("div",U,[n("div",j,[i.postTypes.length===0&&t.type==="postTypes"?(c(),_(y,{key:0,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noPostTypes),1),g(" "+o(u.strings.noPostTypesDescription),1)]),_:1})):h("",!0),i.postTypes.length===0&&t.type==="taxonomies"?(c(),_(y,{key:1,type:"blue"},{default:a(()=>[n("strong",null,o(u.strings.noTaxonomies),1),g(" "+o(u.strings.noTaxonomiesDescription),1)]),_:1})):h("",!0),0<i.postTypes.length?(c(),_(C,{key:2},{default:a(()=>[(c(!0),f(w,null,L(i.postTypes,(s,P)=>(c(),_(v,{md:"6",key:P},{default:a(()=>[x(b,{size:"medium",active:i.isActive(s),name:s.name,type:"checkbox",modelValue:i.getValue(s),"onUpdate:modelValue":V=>i.updateValue(V,s)},{default:a(()=>[x(T,null,{tooltip:a(()=>[n("div",q,[g(o(u.strings.label)+" ",1),n("strong",null,o(s.label),1),z,g(" "+o(u.strings.name)+" ",1),n("strong",null,o(s.name),1)])]),default:a(()=>[n("span",{class:G(["icon dashicons",l.getPostIconClass(s.icon)])},null,2)]),_:2},1024),g(" "+o(s.label),1)]),_:2},1032,["active","name","modelValue","onUpdate:modelValue"])]),_:2},1024))),128))]),_:1})):h("",!0)])])}const $=R(O,[["render",F]]);export{$ as C};
