import"./WpTable.3e09f0c1.js";import"./default-i18n.0e8bc810.js";import"./constants.e56e1512.js";import{_ as b,r as c,o as v,c as O,d as a,w as r,y as _,t as o,a as n,D as d}from"./_plugin-vue_export-helper.a81c6319.js";import"./index.4dbecc01.js";import{J as k}from"./JsonValues.870a4901.js";import"./SaveChanges.c85e9ba4.js";import{b as C}from"./vuex.esm-bundler.55d3d5b3.js";import{B as T,S as $}from"./Caret.19bf2275.js";import{B as S}from"./index.fae5bbc8.js";import{S as B}from"./AddPlus.0867f208.js";import{S as V}from"./External.bfa99ff9.js";const j={components:{BaseButton:T,BaseSelect:S,SvgAddPlus:B,SvgClose:$,SvgExternal:V},mixins:[k],props:{options:{type:Object,required:!0},type:{type:String,required:!0}},data(){return{excludeOptions:[],strings:{typeToSearch:this.$t.__("Type to search...",this.$td),noOptionsPosts:this.$t.__("Begin typing a post ID, title or slug to search...",this.$td),noOptionsTerms:this.$t.__("Begin typing a term ID or name to search...",this.$td),noResult:this.$t.__("No results found for your search. Try again!",this.$td),clear:this.$t.__("Clear",this.$td),id:this.$t.__("ID",this.$td),type:this.$t.__("Type",this.$td)}}},computed:{optionName:{get(){return this.type==="posts"?this.options.excludePosts:this.options.excludeTerms},set(e){if(this.type==="posts"){this.options.excludePosts=e;return}this.options.excludeTerms=e}},noOptions(){return this.type==="posts"?this.strings.noOptionsPosts:this.strings.noOptionsTerms}},methods:{...C(["getObjects"]),processGetObjects(e){return this.getObjects({query:e,type:this.type}).then(s=>{this.excludeOptions=s.body.objects})},getOptionTitle(e,s){const p=new RegExp(`(${s})`,"gi");return e.replace(p,'<span class="search-term">$1</span>')},searchableLabel({value:e,label:s,slug:p}){return`${e} ${s} ${p}`}}},L={class:"aioseo-exclude-posts"},N={class:"option"},P=["innerHTML"],w={class:"option-details"},A=["href","onClick"],D={class:"multiselect__tag"},E={class:"multiselect__tag-value"},R=["onClick"];function J(e,s,p,q,l,i){const h=c("svg-add-plus"),m=c("base-button"),g=c("svg-external"),y=c("svg-close"),x=c("base-select");return v(),O("div",L,[a(x,{options:l.excludeOptions,"ajax-search":i.processGetObjects,customLabel:i.searchableLabel,size:"medium",multiple:"",modelValue:e.getJsonValues(i.optionName),"onUpdate:modelValue":s[0]||(s[0]=t=>i.optionName=e.setJsonValues(t)),placeholder:l.strings.typeToSearch},{noOptions:r(()=>[_(o(i.noOptions),1)]),noResult:r(()=>[_(o(l.strings.noResult),1)]),caret:r(({toggle:t})=>[a(m,{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:r(()=>[a(h,{style:{width:"14px",height:"14px",color:"black"}})]),_:2},1032,["onClick"])]),option:r(({option:t,search:u})=>[n("div",N,[n("div",{class:"option-title",innerHTML:i.getOptionTitle(t.label,u)},null,8,P),n("div",w,[n("span",null,o(l.strings.id)+": #"+o(t.value),1),n("span",null,o(l.strings.type)+": "+o(t.type),1)])]),n("a",{class:"option-permalink",href:t.link,target:"_blank",onClick:d(()=>{},["stop"])},[a(g)],8,A)]),tag:r(({option:t,remove:u})=>[n("div",D,[n("div",E,o(t.label)+" - #"+o(t.value),1),n("div",{class:"multiselect__tag-remove",onClick:d(f=>u(t),["stop"])},[a(y,{onClick:d(f=>u(t),["stop"])},null,8,["onClick"])],8,R)])]),_:1},8,["options","ajax-search","customLabel","modelValue","placeholder"]),a(m,{type:"gray",size:"medium",onClick:s[1]||(s[1]=t=>i.optionName=[])},{default:r(()=>[_(o(l.strings.clear),1)]),_:1})])}const Z=b(j,[["render",J]]);export{Z as C};
