{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/y8ko3Kyby8Do4Pal5PCE/ZR1OwnD0AmrVIafee76s/TemplateID.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Localstorage key\nconst WEBSITE_CONTEXT_KEY=\"websiteContext\";export const withSaveIdToLocalstorage=Component=>{return props=>{// Create a ref to get the rendered element\nconst ref=useRef(null);useEffect(()=>{var _ref_current;// Ensure we're in a browser environment\nif(typeof window===\"undefined\")return;// Get the text content (ID) from the rendered element\nconst id=(_ref_current=ref.current)===null||_ref_current===void 0?void 0:_ref_current.textContent;// Get existing data from localStorage\nconst existingData=localStorage.getItem(WEBSITE_CONTEXT_KEY);let websiteContext={};if(existingData){try{websiteContext=JSON.parse(existingData);}catch(error){console.error(\"Error parsing localStorage data:\",error);}}// Initialize the lastVisitedUseCaseTemplates array if it doesn't exist\nif(!websiteContext.lastVisitedUseCaseTemplates){websiteContext.lastVisitedUseCaseTemplates=[];}// Add the ID & page url to the lastVisitedUseCaseTemplates array if it's not already\nif(id&&!websiteContext.lastVisitedUseCaseTemplates.includes(id)){websiteContext.lastVisitedUseCaseTemplates=[...websiteContext.lastVisitedUseCaseTemplates||[],id];}// Update the pageUrl every time the component is rendered\ntry{websiteContext.pageUrl=new URL(window.location.href).pathname;}catch(error){console.error(\"Error updating pageUrl\",error);}// Save to localStorage\nlocalStorage.setItem(WEBSITE_CONTEXT_KEY,JSON.stringify(websiteContext));},[]);// Return the component with its original props\nreturn /*#__PURE__*/_jsx(Component,{...props,ref:ref});};};\nexport const __FramerMetadata__ = {\"exports\":{\"withSaveIdToLocalstorage\":{\"type\":\"reactHoc\",\"name\":\"withSaveIdToLocalstorage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TemplateID.map"],
  "mappings": "4GAAAA,IACA,IAAMC,EAAoB,iBAA8BC,EAAyBC,GAAmBC,GAAO,CAC3G,IAAMC,EAAIC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAIC,EAC1C,GAAG,OAAO,OAAS,IAAY,OAC/B,IAAMC,GAAID,EAAaH,EAAI,WAAW,MAAMG,IAAe,OAAO,OAAOA,EAAa,YAChFE,EAAa,aAAa,QAAQT,CAAmB,EAAMU,EAAe,CAAC,EAAE,GAAGD,EAAc,GAAG,CAACC,EAAe,KAAK,MAAMD,CAAY,CAAE,OAAOE,EAAM,CAAC,QAAQ,MAAM,mCAAmCA,CAAK,CAAE,CAClND,EAAe,8BAA6BA,EAAe,4BAA4B,CAAC,GACzFF,GAAI,CAACE,EAAe,4BAA4B,SAASF,CAAE,IAAGE,EAAe,4BAA4B,CAAC,GAAGA,EAAe,6BAA6B,CAAC,EAAEF,CAAE,GACjK,GAAG,CAACE,EAAe,QAAQ,IAAI,IAAI,OAAO,SAAS,IAAI,EAAE,QAAS,OAAOC,EAAM,CAAC,QAAQ,MAAM,yBAAyBA,CAAK,CAAE,CAC9H,aAAa,QAAQX,EAAoB,KAAK,UAAUU,CAAc,CAAC,CAAE,EAAE,CAAC,CAAC,EACzDE,EAAKV,EAAU,CAAC,GAAGC,EAAM,IAAIC,CAAG,CAAC,CAAE",
  "names": ["init_ssg_sandbox_shims", "WEBSITE_CONTEXT_KEY", "withSaveIdToLocalstorage", "Component", "props", "ref", "pe", "ue", "_ref_current", "id", "existingData", "websiteContext", "error", "p"]
}
