{"version":3,"file":"cachedIndex.MO3dfb05.mjs","names":[],"sources":["https:/framerusercontent.com/modules/uU1mtMKXsrVAg8N5hW7w/wltkapIGIk88vadN6BJZ/cachedIndex.js"],"sourcesContent":["import{checkForCachedData,setCachedData}from\"https://framer.com/m/cache-YMiL.js@b9aplVZjN51x28yfNK16\";const VERSION=1;const defaultLocaleId=\"default\";export function isDefaultLocaleId(localeId){return!localeId||localeId===\"default\";}const INDEX_KEY=\"searchIndexCache\";function getIndexKey(localeId){if(isDefaultLocaleId(localeId))return INDEX_KEY;return`${INDEX_KEY}-${localeId}`;}const METADATA_KEY=\"searchCacheMetadata\";function getMetadataKey(localeId){if(isDefaultLocaleId(localeId))return METADATA_KEY;return`${METADATA_KEY}-${localeId}`;}export async function getCachedIndex(localeId,indexHash){// A check here for metadata can be added later if we need to\n// migrate or expire the index. Though most likely, any version change\n// should result in deleting the cache and starting again.\nconst metadataKey=getMetadataKey(localeId);const indexKey=getIndexKey(localeId);const[metadata,cachedIndex]=await Promise.all([checkForCachedData(metadataKey),checkForCachedData(indexKey)]);if(cachedIndex){return{status:indexHash&&(metadata===null||metadata===void 0?void 0:metadata.indexHash)===indexHash?\"fresh\":\"stale\",searchIndex:cachedIndex};}return{status:\"miss\"};}export function setCachedIndex(localeId,index,indexHash){const indexKey=getIndexKey(localeId);setCachedData(indexKey,index);const metadata={version:VERSION,timestamp:Date.now(),indexHash};const metadataKey=getMetadataKey(localeId);setCachedData(metadataKey,metadata);}\nexport const __FramerMetadata__ = {\"exports\":{\"getCachedIndex\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setCachedIndex\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isDefaultLocaleId\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./cachedIndex.map"],"mappings":"0HAAsJ,SAAgB,EAAkB,EAAS,CAAC,MAAM,CAAC,GAAU,IAAW,UAA8C,SAAS,EAAY,EAAS,CAAiD,OAA7C,EAAkB,EAAS,CAAQ,EAAgB,GAAG,EAAU,GAAG,IAAqD,SAAS,EAAe,EAAS,CAAoD,OAAhD,EAAkB,EAAS,CAAQ,EAAmB,GAAG,EAAa,GAAG,IAAY,eAAsB,EAAe,EAAS,EAAU,CAGxlB,IAAM,EAAY,EAAe,EAAS,CAAO,EAAS,EAAY,EAAS,CAAM,CAAC,EAAS,GAAa,MAAM,QAAQ,IAAI,CAAC,EAAmB,EAAY,CAAC,EAAmB,EAAS,CAAC,CAAC,CAA+J,OAA3J,EAAmB,CAAC,OAAO,GAAY,GAAmD,YAAa,EAAU,QAAQ,QAAQ,YAAY,EAAY,CAAQ,CAAC,OAAO,OAAO,CAAE,SAAgB,EAAe,EAAS,EAAM,EAAU,CAAsC,EAAtB,EAAY,EAAS,CAAwB,EAAM,CAAC,IAAM,EAAS,CAAC,QAAQ,EAAQ,UAAU,KAAK,KAAK,CAAC,YAAU,CAA4C,EAAzB,EAAe,EAAS,CAA2B,EAAS,wBAHvhB,CAAM,EAAQ,EAA2H,EAAU,mBAA0I,EAAa"}