import{SEARCH_GROUP_FACET_FIELD as f}from"../../../../constants/common.js";import{SEARCH_GROUP_NAME_API as u}from"../../../constants/plugins/search.js";function h(r,a){const e=r.getSearchFacets();for(const[s,t]of Object.entries(a)){const c=e.get(s);if(c){const o=new Set(c.values??[]);t instanceof Set?[...t].forEach(n=>c.values=Array.from(o.add(n))):c.values=Array.from(o.add(t))}}r.setSearchFacets(e)}function F(r,a){const e={[f]:u};if(!a)return e;const s=r.getSearchFacets();for(const[t,c]of Object.entries(a))s.has(t)&&(e[t]=String(c));return e}export{F as extractDocumentSearchFacets,h as setDocumentSearchFacets};
