1import{I as m}from"./icon-uFOFjlJd.js";import{I as f}from"./input-error-B6rwKYXW.js";import{_}from"./selector-37fo5yPa.js";import{r as i,c as a,o as c,f as s,b as w,a as l,w as h,e as v,v as G,n as x}from"./runtime-dom.esm-bundler-B8eLWgJQ.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";const g={components:{Icon:m,InputError:f,Selector:_},props:{selectedGroupId:{type:Number,default:null},canRemove:{type:Boolean,default:!0},groups:{type:Array,required:!0},selectedGroupIds:{type:Array,default:()=>[]},showValidation:{type:Boolean,default:!1},allowExclusions:{type:Boolean,default:!0}},computed:{selectedGroup(){return this.groups.find(t=>t.id===this.selectedGroupId)},showError(){return this.showValidation&&!this.isValid},isValid(){return!!this.selectedGroup},selectableGroups(){const t=this.groups.filter(e=>{var o;return((o=this.selectedGroup)==null?void 0:o.id)===e.id||!this.selectedGroupIds.includes(e.id)}).map(e=>({text:`${e.name} (${e.users_count})`,value:e.id}));return t.unshift({text:"Select group",value:"",disabled:!0}),t}},methods:{handleGroupSelected(t){if(!t){this.$emit("change-group-recipient",null);return}this.$emit("change-group-recipient",this.groups.find(e=>e.id===t||null))}}},b={class:"tw-flex-1"},I={class:"select-wrapper"},V={class:"tw-ml-[11px] tw-flex-initial"};function E(t,e,o,k,B,r){const n=i("icon"),u=i("selector"),d=i("input-error");return c(),a("div",{class:x(["tw-flex tw-justify-content tw-items-center",{"recipient-error":r.showError}])},[s("div",b,[l(d,{error:r.showError?"Select a group":""},{default:h(()=>[s("div",I,[o.canRemove?(c(),a("button",{key:0,class:"tw-absolute -tw-right-[9px] -tw-top-[9px] tw-z-[2] tw-border-none tw-bg-transparent tw-p-0 active:focus:tw-outline-none",onClick:e[0]||(e[0]=p=>t.$emit("remove-group-recipient"))},[l(n,{type:"close-circle",fill:"",class:"group-recipient__icon"})])):v("",!0),l(u,{"model-value":o.selectedGroupId,options:r.selectableGroups,"onUpdate:modelValue":r.handleGroupSelected},null,8,["model-value","options","onUpdate:modelValue"])])]),_:1},8,["error"])]),w(s("div",V,[s("a",{class:"clickable tw-flex",onClick:e[1]||(e[1]=p=>t.$emit("edit-group-exclusions"))},[l(n,{type:"eye-open",fill:"",class:"group-recipient__icon"})])],512),[[G,r.selectedGroup&&r.selectedGroup.users_count&&o.allowExclusions]])],2)}const z=y(g,[["render",E],["__scopeId","data-v-5e4df0e2"]]);export{z as G};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.