var _=Object.defineProperty,g=Object.defineProperties;var m=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var p=(t,e,s)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,l=(t,e)=>{for(var s in e||(e={}))d.call(e,s)&&p(t,s,e[s]);if(a)for(var s of a(e))h.call(e,s)&&p(t,s,e[s]);return t},c=(t,e)=>g(t,m(e));import"./ToolsSettings.004b222f.js";import{d as v}from"./index.d328c175.js";import"./helpers.db3922d1.js";import{J as y}from"./JsonValues.08065e69.js";import{n as f}from"./vueComponentNormalizer.87056a83.js";import{S as x}from"./AddPlus.f69ce757.js";import{S as b}from"./index.a4161053.js";import{S as $}from"./External.8868c638.js";var O=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"aioseo-exclude-posts"},[s("base-select",{attrs:{options:t.excludeOptions,"ajax-search":t.processGetObjects,customLabel:t.searchableLabel,size:"medium",multiple:"",value:t.getJsonValues(t.optionName),placeholder:t.strings.typeToSearch},on:{input:function(o){return t.optionName=t.setJsonValues(o)}},scopedSlots:t._u([{key:"noOptions",fn:function(){return[t._v(" "+t._s(t.noOptions)+" ")]},proxy:!0},{key:"noResult",fn:function(){return[t._v(" "+t._s(t.strings.noResult)+" ")]},proxy:!0},{key:"caret",fn:function(o){var n=o.toggle;return[s("base-button",{staticClass:"multiselect-toggle",staticStyle:{padding:"10px 13px",width:"40px",position:"absolute",height:"36px",right:"2px",top:"2px","text-align":"center",transition:"transform .2s ease"},attrs:{type:"gray"},on:{click:n}},[s("svg-add-plus",{staticStyle:{width:"14px",height:"14px",color:"black"}})],1)]}},{key:"option",fn:function(o){var n=o.option,r=o.search;return[s("div",{staticClass:"option"},[s("div",{staticClass:"option-title",domProps:{innerHTML:t._s(t.getOptionTitle(n.label,r))}}),s("div",{staticClass:"option-details"},[s("span",[t._v(t._s(t.strings.id)+": #"+t._s(n.value))]),s("span",[t._v(t._s(t.strings.type)+": "+t._s(n.type))])])]),s("a",{staticClass:"option-permalink",attrs:{href:n.link,target:"_blank"},on:{click:function(i){return i.stopPropagation(),function(){}.apply(null,arguments)}}},[s("svg-external")],1)]}},{key:"tag",fn:function(o){var n=o.option,r=o.remove;return[s("div",{staticClass:"multiselect__tag"},[s("div",{staticClass:"multiselect__tag-value"},[t._v(" "+t._s(n.label)+" - #"+t._s(n.value)+" ")]),s("div",{staticClass:"multiselect__tag-remove",on:{click:function(i){return i.stopPropagation(),r(n)}}},[s("svg-close",{nativeOn:{click:function(i){return i.stopPropagation(),r(n)}}})],1)])]}}])}),s("base-button",{attrs:{type:"gray",size:"medium"},on:{click:function(o){t.optionName=[]}}},[t._v(" "+t._s(t.strings.clear)+" ")])],1)},k=[];const C={components:{SvgAddPlus:x,SvgClose:b,SvgExternal:$},mixins:[y],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(t){if(this.type==="posts"){this.options.excludePosts=t;return}this.options.excludeTerms=t}},noOptions(){return this.type==="posts"?this.strings.noOptionsPosts:this.strings.noOptionsTerms}},methods:c(l({},v(["getObjects"])),{processGetObjects(t){return this.getObjects({query:t,type:this.type}).then(e=>{this.excludeOptions=e.body.objects})},getOptionTitle(t,e){const s=new RegExp(`(${e})`,"gi");return t.replace(s,'<span class="search-term">$1</span>')},searchableLabel({value:t,label:e,slug:s}){return`${t} ${e} ${s}`}})},u={};var S=f(C,O,k,!1,P,null,null,null);function P(t){for(let e in u)this[e]=u[e]}var w=function(){return S.exports}();export{w as C};
