import{u as k}from"./index.684c656d.js";import{u as C}from"./JsonValues.3fcfec97.js";import{_ as S,S as T}from"./Caret.2e43336b.js";import{b as V}from"./index.62c20ef8.js";import{S as B}from"./AddPlus.871c15d2.js";import{S as L}from"./External.9019c3ac.js";import"./translations.d159963e.js";import{y as u,o as N,d as j,H as p,w as i,a as d,t as o,e as n,J as g}from"./runtime-dom.esm-bundler.d8b05b6d.js";import{_ as P}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as a}from"./default-i18n.20001971.js";const l="all-in-one-seo-pack",w={setup(){const{getJsonValues:s,setJsonValues:e}=C();return{getJsonValues:s,optionsStore:k(),setJsonValues:e}},components:{BaseButton:S,BaseSelect:V,SvgAddPlus:B,SvgClose:T,SvgExternal:L},props:{options:{type:Object,required:!0},type:{type:String,required:!0}},data(){return{excludeOptions:[],strings:{typeToSearch:a("Type to search...",l),noOptionsPosts:a("Begin typing a post ID, title or slug to search...",l),noOptionsTerms:a("Begin typing a term ID or name to search...",l),noResult:a("No results found for your search. Try again!",l),clear:a("Clear",l),id:a("ID",l),type:a("Type",l)}}},computed:{optionName:{get(){return this.type==="posts"?this.options.excludePosts:this.options.excludeTerms},set(s){if(this.type==="posts"){this.options.excludePosts=s;return}this.options.excludeTerms=s}},noOptions(){return this.type==="posts"?this.strings.noOptionsPosts:this.strings.noOptionsTerms}},methods:{processGetObjects(s){return this.optionsStore.getObjects({query:s,type:this.type}).then(e=>{this.excludeOptions=e.body.objects})},getOptionTitle(s,e){s=s.replace(/<\/?[^>]+(>|$)/g,""),e=e.replace(/<\/?[^>]+(>|$)/g,"");const _=new RegExp(`(${e})`,"gi");return s.replace(_,'<span class="search-term">$1</span>')},searchableLabel({value:s,label:e,slug:_}){return`${s} ${e} ${_}`}}},J={class:"aioseo-exclude-posts"},R={class:"option"},A=["innerHTML"],D={class:"option-details"},E=["href"],q={class:"multiselect__tag"},H={class:"multiselect__tag-value"},I=["onClick"];function M(s,e,_,h,c,r){const x=u("svg-add-plus"),y=u("base-button"),f=u("svg-external"),b=u("svg-close"),v=u("base-select");return N(),j("div",J,[p(v,{options:c.excludeOptions,"ajax-search":r.processGetObjects,customLabel:r.searchableLabel,size:"medium",multiple:"",modelValue:h.getJsonValues(r.optionName),"onUpdate:modelValue":e[0]||(e[0]=t=>r.optionName=h.setJsonValues(t)),placeholder:c.strings.typeToSearch},{noOptions:i(()=>[d(o(r.noOptions),1)]),noResult:i(()=>[d(o(c.strings.noResult),1)]),caret:i(({toggle:t})=>[p(y,{class:"multiselect-toggle",style:{padding:"10px 13px",width:"40px",position:"absolute",height:"36px",right:"2px",top:"2px","text-align":"center",transition:"transform .2s ease"},type:"gray",onClick:t},{default:i(()=>[p(x,{style:{width:"14px",height:"14px",color:"black"}})]),_:2},1032,["onClick"])]),option:i(({option:t,search:m})=>[n("div",R,[n("div",{class:"option-title",innerHTML:r.getOptionTitle(t.label,m)},null,8,A),n("div",D,[n("span",null,o(c.strings.id)+": #"+o(t.value),1),n("span",null,o(c.strings.type)+": "+o(t.type),1)])]),n("a",{class:"option-permalink",href:t.link,target:"_blank",onClick:g(()=>{},["stop"])},[p(f)],8,E)]),tag:i(({option:t,remove:m})=>[n("div",q,[n("div",H,o(t.label)+" - #"+o(t.value),1),n("div",{class:"multiselect__tag-remove",onClick:g(O=>m(t),["stop"])},[p(b,{onClick:g(O=>m(t),["stop"])},null,8,["onClick"])],8,I)])]),_:1},8,["options","ajax-search","customLabel","modelValue","placeholder"]),p(y,{type:"gray",size:"medium",onClick:e[1]||(e[1]=t=>r.optionName=[])},{default:i(()=>[d(o(c.strings.clear),1)]),_:1})])}const $=P(w,[["render",M]]);export{$ as C};
