import{REDOCLY_ROUTE_RBAC as f,REDOCLY_TEAMS_RBAC as s}from"@redocly/config";import{SearchIndexer as R}from"../search-indexer.js";import{extractDocumentSearchFacets as g,setDocumentSearchFacets as S}from"./search-facets.js";function E(n,i,m,c,d,l){return async t=>{if(l)return[];const o=t.metadata||{},a=new R(n,i,t.baseSlug||t.slug);a.addInfo(n.definition.info,o);for(const e of m)a.addItem(e);const h={},r=g(o,n.definition.info,c),u=a.getResult().map(e=>({...e,[s]:e[s]||t[s],[f]:t[f]||{slug:t.slug,fsPath:t.fsPath},facets:r}));return S({...r,...h},c,d),u}}export{E as searchResolver};
