'use strict';
import { getAllInternalResourceMetas } from './internal-resource-meta.js';
import { tryGetFromCoreCache, setCoreCache } from '../../../../fd-toolbox/server/cachings/core-cache.js';
import { cacheKeys } from '../../../../fd-toolbox/constants/cache-keys.js';
import { getObjectValues } from '../../../../fd-toolbox/lib/utils.js';

var __defProp=Object['defineProperty'],__name=(_0x1ee219,_0x520d68)=>__defProp(_0x1ee219,'name',{'value':_0x520d68,'configurable':!![]});async function getSearchableResources(){const _0x27caab=new Map(),_0x2affec=cacheKeys['searchableResources'],_0x4ee61d=await tryGetFromCoreCache(_0x2affec);if(_0x4ee61d)return new Map(Object['entries'](_0x4ee61d));for(const _0x4c4239 of getObjectValues(await getAllInternalResourceMetas())){addSearchableProperties(_0x4c4239,_0x27caab);}const _0x2b62af={};return _0x27caab['forEach']((_0x174dc9,_0x292385)=>{_0x2b62af[_0x292385]=_0x174dc9;}),await setCoreCache(_0x2affec,_0x2b62af),_0x27caab;}__name(getSearchableResources,'getSearchableResources');function addSearchableProperties(_0x3b515e,_0x1f443d){for(const [_0x1fa461,_0x548cde]of Object['entries'](_0x3b515e['properties'])){_0x548cde['isSearchable']&&addPropertyToSearchableResources(_0x3b515e['name'],_0x1fa461,_0x1f443d);}}__name(addSearchableProperties,'addSearchableProperties');function addPropertyToSearchableResources(_0x313f0f,_0x3d08ec,_0x5ec157){!_0x5ec157['has'](_0x313f0f)&&_0x5ec157['set'](_0x313f0f,[]);const _0xf0367f=_0x5ec157['get'](_0x313f0f);_0xf0367f&&!_0xf0367f['includes'](_0x3d08ec)&&_0xf0367f['push'](_0x3d08ec);}__name(addPropertyToSearchableResources,'addPropertyToSearchableResources');

export { getSearchableResources };
