{"version":3,"file":"shared-lib.C27DR2yl.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/kyK7v8W4fn1UWqgJvNb3/aEhiRtuGgm9AqD2b6dpn/DynamicNavigation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import React,{useRef}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/docs/guides/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */const LOCAL_DEV_URL=\"http://localhost:3000\";const NAVIGATION_ENDPOINT=\"/client_app/framer_navigation\";const FOOTER_ENDPOINT=\"/client_app/framer_footer\";const reInjectScriptTag=oldScriptEl=>{const newScriptEl=document.createElement(\"script\");Array.from(oldScriptEl.attributes).forEach(attr=>{newScriptEl.setAttribute(attr.name,attr.value);});// framer acts like a SPA sometimes and doesn't reload the page when navigating to other\n// framer pages sometimes. This results in the JS getting cached which the browser blocks\n// from running again (preventing the nav from initializing). As a temporary bandaid, we\n// simply cache bust the JS url so it forces the browser to reload the JS on these special\n// page redirects.\nnewScriptEl.src=`${newScriptEl.src}?cacheBust=${Math.floor(Math.random()*1e9)}`;if(oldScriptEl.innerHTML){const scriptContent=document.createTextNode(oldScriptEl.innerHTML);newScriptEl.appendChild(scriptContent);}oldScriptEl.parentNode.replaceChild(newScriptEl,oldScriptEl);};const isDevMode=()=>{// don't run on the server\nif(typeof window===\"undefined\")return false;// check for `dev` url param\nconst urlParams=new URLSearchParams(window.location.search);return urlParams.get(\"dev\");};// loads JS/CSS assets from local dev server if url param `?dev=true` exists\nconst transformHtmlForLocalDev=html=>{// don't run on the server\nif(!isDevMode())return html;// use `localhost:3000` as url base\nhtml=html.replaceAll('\"/assets',`\"${LOCAL_DEV_URL}/assets`);return html.replaceAll('\"/vite-dev',`\"${LOCAL_DEV_URL}/vite-dev`);};const fetchAndInjectHtml=async(endpoint,domElement)=>{// fetch html/js/css either from local dev or current domain\nconst response=await fetch(isDevMode()?`${LOCAL_DEV_URL}${endpoint}`:endpoint,{headers:{\"X-Requested-With\":\"XMLHttpRequest\"}});if(response.status!==200)return;// transform HTML\nlet html=await response.text();html=transformHtmlForLocalDev(html);// inject HTML into dom element\nif(!domElement||!html)return;domElement.innerHTML=html;requestAnimationFrame(()=>{setTimeout(()=>{if(!domElement)return;const scriptEls=domElement.querySelectorAll(\"script\");scriptEls.forEach(reInjectScriptTag);},0);});};export default function DynamicNavigation(props){const dynamicNavRef=useRef(null);React.useEffect(()=>{if(typeof window===\"undefined\")return;// fetch and inject nav\nfetchAndInjectHtml(NAVIGATION_ENDPOINT,dynamicNavRef.current);// fetch and inject footer\nconst footerElement=document.querySelector(\"[data-framer-footer-v2]\");if(footerElement)fetchAndInjectHtml(FOOTER_ENDPOINT,footerElement);},[]);return /*#__PURE__*/_jsx(\"div\",{ref:dynamicNavRef});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DynamicNavigation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicNavigation.map"],"mappings":"uIAmB6N,SAAwB,EAAkB,EAAM,CAAC,IAAM,EAAcA,EAAO,IAAI,EAE9J,OAFgK,EAAM,cAAc,CAAC,GAAU,IAAS,OAAY,OACnW,EAAmB,EAAoB,EAAc,OAAO,EAC5D,IAAM,EAAc,SAAS,cAAc,yBAAyB,EAAK,GAAc,EAAmB,EAAgB,CAAa,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,MAAM,CAAC,IAAI,CAAa,CAAC,CAAE,mCArBzJ,IAAiC,EAMlE,EAAc,wBAA8B,EAAoB,gCAAsC,EAAgB,4BAAkC,EAAkB,GAAa,CAAC,IAAM,EAAY,SAAS,cAAc,QAAQ,EAKlK,GALoK,MAAM,KAAK,EAAY,UAAU,CAAC,CAAC,QAAQ,GAAM,CAAC,EAAY,aAAa,EAAK,KAAK,EAAK,KAAK,CAAE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