{"version":3,"file":"Blog.DB3udNGA.mjs","names":["useCallback","id"],"sources":["https:/framerusercontent.com/modules/vAWw0NC0Nax8WElX2ReY/10VaOI3iISSeRByTswj0/Blog.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback}from\"react\";export function addTags(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const combinedRef=useCallback(node=>{if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;if(!node)return;// Add id to the root element\nnode.id=\"blog-content\";// Process headings inside this component\nconst headings=node.querySelectorAll(\"h2, h3, h4, h5, h6\");headings.forEach(heading=>{if(!heading.id){const text=heading.textContent||\"\";heading.id=slugify(text);}heading.style.scrollMarginTop=\"60px\";});//const links = node.querySelectorAll(\"a[href^='./#']\")\n// Matches all hash links, not just starting with './#'\nconst links=node.querySelectorAll(\"a[href*='#']\");links.forEach(link=>{const href=link.getAttribute(\"href\");if(!href)return;// CASE 1: Same-page anchor\nif(href?.startsWith(\"../#\")){const id=href.replace(/^(#|\\.{2}\\/#)/,\"\");link.setAttribute(\"href\",`#${id}`);link.addEventListener(\"click\",e=>{e.preventDefault();e.stopPropagation();//const id = href.replace(\"../#\", \"\")\nconst id=href.replace(/^(#|\\.{2}\\/#)/,\"\");const scrollToTarget=()=>{const target=document.getElementById(id);if(!target)return;target.scrollIntoView({behavior:\"smooth\",block:\"start\"});//history.replaceState(null, \"\", `#${id}`)\nhistory.pushState(null,null,\"\",`#${id}`);};// If the target already exists (likely), scroll now on next frame\nif(document.getElementById(id)){requestAnimationFrame(scrollToTarget);return;}// If not, wait for DOM updates using MutationObserver\nconst observer=new MutationObserver(()=>{const target=document.getElementById(id);if(target){observer.disconnect();requestAnimationFrame(scrollToTarget);}});observer.observe(document.body,{childList:true,subtree:true});});}else if(href.includes(\"#\")&&!href.startsWith(\"#\")&&// not a raw fragment\n!href.startsWith(\"./#\")&&// not legacy pattern\n!href.startsWith(\"../#\")&&// not same-page anchor\nhref.startsWith(\"/\")// internal link only\n){// Add click handler to allow Framer navigation to work\nlink.addEventListener(\"click\",e=>{e.preventDefault();e.stopPropagation();// Manually trigger navigation so Framer doesn't block it\nwindow.location.href=href;});}// End case 2\n});},[ref]);return /*#__PURE__*/_jsx(Component,{ref:combinedRef,...props});});}// Utility: generate a clean, anchor-safe ID from heading text\nfunction slugify(text){let slug=text.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\").replace(/[^a-z0-9\\s-]/g,\"\").trim().replace(/\\s+/g,\"-\").replace(/-+/g,\"-\");// IDs must not start with a digit\nif(/^\\d/.test(slug)){slug=\"section-\"+slug;}return slug;}\nexport const __FramerMetadata__ = {\"exports\":{\"addTags\":{\"type\":\"reactHoc\",\"name\":\"addTags\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog.map"],"mappings":"0MAAqF,SAAgB,EAAQ,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAYA,EAAY,GAAM,CAAmE,GAA/D,OAAO,GAAM,WAAW,EAAI,GAAc,IAAI,EAAI,QAAQ,GAAQ,CAAC,EAAK,OACrR,EAAK,GAAG,eACR,IAAM,EAAS,EAAK,iBAAiB,sBAAsB,EAAS,QAAQ,GAAS,CAAC,GAAG,CAAC,EAAQ,GAAG,CAAC,IAAM,EAAK,EAAQ,aAAa,GAAG,EAAQ,GAAG,EAAQ,EAAO,GAAQ,MAAM,gBAAgB,MAAQ,GAEzM,IAAM,EAAM,EAAK,iBAAiB,gBAAgB,EAAM,QAAQ,GAAM,CAAC,IAAM,EAAK,EAAK,aAAa,QAAY,KAChH,GAAG,GAAM,WAAW,QAAQ,CAAC,IAAM,EAAG,EAAK,QAAQ,gBAAgB,IAAI,EAAK,aAAa,OAAO,IAAI,KAAM,EAAK,iBAAiB,QAAQ,GAAG,CAAC,EAAE,iBAAiB,EAAE,kBACjK,IAAMC,EAAG,EAAK,QAAQ,g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