import{k as e}from"../../../../../vendor-element-plus.js?ver=3.1.0";import r from"./Filters.js?ver=3.1.0";import{r as i,c as t,o as s,b as a,Q as n,as as l,L as d,d as o,P as c,w as _,O as f,bK as v}from"../../../../../vendor.js?ver=3.1.0";import{_ as m,I as u}from"../../../../../fc-bits-ui.js?ver=3.1.0";import"../../../../../_AjaxSelector.js?ver=3.1.0";import"../../../../../_TaxonomyTermsSelector.js?ver=3.1.0";import"../../../../../_OptionSelector.js?ver=3.1.0";const p={class:"fcrm_rich_container"},h={class:"fcrm_rich_wrap"},b={class:"fcrm_rich_filter"},y={class:"fcrm_filter_group_header"},j={class:"fcrm_and_label"},O={key:0,class:"fcrm_cond_or"},R={class:"icon","aria-hidden":"true"},G={class:"fcrm_cond_or"},g={class:"icon","aria-hidden":"true"};const C=m({name:"RichFilterContainer",components:{Icons:u,RichFilter:r},props:{advanced_filters:{type:Array,default:function(){return[[]]}},add_label:{type:String,default:function(){return this.$t("Filters.instruction")}},filterOptions:{type:Array,default:function(){return[]}}},methods:{maybeRemoveGroup(e){this.advanced_filters.length>1&&this.advanced_filters.splice(e,1)},addConditionGroup(){this.advanced_filters.push([])}},mounted(){this.advanced_filters&&v(this.advanced_filters)&&0!=this.advanced_filters.length||(this.advanced_filters=[[]])}},[["render",function(r,v,m,u,C,k){const x=i("rich-filter"),A=i("Icons"),$=e;return s(),t("div",p,[a("div",h,[(s(!0),t(n,null,l(m.advanced_filters,(e,i)=>(s(),t("div",{key:i},[a("div",b,[a("div",y,[a("div",j,c(r.$t("And")),1),o(x,{filterOptions:m.filterOptions,add_label:m.add_label,button_text:r.$t("Add Property"),canDeleteGroup:m.advanced_filters.length>1,onMaybeRemove:e=>k.maybeRemoveGroup(i),items:e},null,8,["filterOptions","add_label","button_text","canDeleteGroup","onMaybeRemove","items"])])]),i<m.advanced_filters.length-1?(s(),t("div",O,[v[2]||(v[2]=a("div",{class:"fcrm_or_divider_line"},null,-1)),o($,{size:"small",onClick:v[0]||(v[0]=e=>k.addConditionGroup())},{default:_(()=>[a("span",R,[o(A,{"icon-name":"plus"})]),f(" "+c(r.$t("OR")),1)],void 0),_:1}),v[3]||(v[3]=a("div",{class:"fcrm_or_divider_line"},null,-1))])):d("",!0)]))),128))]),a("div",G,[v[4]||(v[4]=a("div",{class:"fcrm_or_divider_line"},null,-1)),o($,{size:"small",onClick:v[1]||(v[1]=e=>k.addConditionGroup())},{default:_(()=>[a("span",g,[o(A,{"icon-name":"plus"})]),f(" "+c(r.$t("OR")),1)],void 0),_:1}),v[5]||(v[5]=a("div",{class:"fcrm_or_divider_line"},null,-1))])])}]]);export{C as default};
