{"version":3,"file":"PillarPagesFilter.DRZ7IPWS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/4SYpQBrLp0TncTdKUK1w/2yBEnaSuBIXgKRIkTl1b/PillarPagesFilter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";function getLastSlug(){if(typeof window===\"undefined\")return null;const parts=window.location.pathname.split(\"/\").filter(Boolean);return parts[parts.length-1]||null;}export function withSlugRedirect(Component){return /*#__PURE__*/forwardRef((props,ref)=>{useEffect(()=>{if(typeof window===\"undefined\")return;const node=document.querySelector('[data-framer-name=\"Allowed Pages\"]');const allowedSlugs=Array.from(node?.querySelectorAll(\"a[href]\")||[]).map(el=>{const href=el.getAttribute(\"href\")||\"\";const parts=href.split(\"/\").filter(Boolean);return parts[parts.length-1];});const currentSlug=getLastSlug();if(currentSlug&&!allowedSlugs.includes(currentSlug)){// Add <meta name=\"robots\" content=\"noindex\"> to head\nconst meta=document.createElement(\"meta\");meta.name=\"robots\";meta.content=\"noindex, nofollow\";document.head.appendChild(meta);// Then redirect\nconst pathParts=window.location.pathname.split(\"/\").filter(Boolean);const parentPath=\"/\"+pathParts.slice(0,-1).join(\"/\");window.location.replace(parentPath);}},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withSlugRedirect\":{\"type\":\"reactHoc\",\"name\":\"withSlugRedirect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PillarPagesFilter.map"],"mappings":"kIAAmF,SAAS,GAAa,CAAC,GAAU,IAAS,OAAY,OAAO,KAAK,IAAM,EAAM,EAAO,SAAS,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC,OAAO,EAAM,EAAM,OAAO,IAAI,KAAM,SAAgB,EAAiB,EAAU,CAAC,OAAoB,GAAY,EAAM,KAAO,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAK,SAAS,cAAc,qCAAqC,CAAO,EAAa,MAAM,KAAK,GAAM,iBAAiB,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,GAAI,CAAwC,IAAM,GAAlC,EAAG,aAAa,OAAO,EAAE,IAAoB,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC,OAAO,EAAM,EAAM,OAAO,IAAK,CAAO,EAAY,GAAa,CAAC,GAAG,GAAa,CAAC,EAAa,SAAS,EAAY,CAAC,CACpuB,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,KAAK,SAAS,EAAK,QAAQ,oBAAoB,SAAS,KAAK,YAAY,EAAK,CACzD,IAAM,EAAW,IAArE,EAAO,SAAS,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAgC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,EAAO,SAAS,QAAQ,EAAW,GAAI,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,sBAFlL,IAAwC"}