{"version":3,"file":"Form_test_1.BhLst8No.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/cUiXkDF35njG34tzrRbR/sjuEie9SnvJEqScqbuGi/Form_test_1.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";function TallyForm(){const[currentPageUrl,setCurrentPageUrl]=useState(\"\");useEffect(()=>{// Ensure window object is available\nif(typeof window!==\"undefined\"){// Now we are safe to use window.location.href\nconst pageUrl=window.location.href;// Extract the last part of the URL\nconst lastSegment=pageUrl.split(\"/\").pop();// Replace dashes with spaces and capitalize words as before\nlet jobTitle=lastSegment.replace(/-/g,\" \").split(\" \").map(word=>word.length>=3?word.charAt(0).toUpperCase()+word.slice(1):word).join(\" \");setCurrentPageUrl(encodeURIComponent(jobTitle));}const scriptUrl=\"https://tally.so/widgets/embed.js\";const loadTallyScript=()=>{if(typeof Tally!==\"undefined\"){Tally.loadEmbeds();}else if(!document.querySelector(`script[src=\"${scriptUrl}\"]`)){const script=document.createElement(\"script\");script.src=scriptUrl;script.onload=()=>{if(typeof Tally!==\"undefined\"){Tally.loadEmbeds();}};script.onerror=()=>{console.error(\"Failed to load the Tally script.\");};document.body.appendChild(script);}};loadTallyScript();return()=>{const script=document.querySelector(`script[src=\"${scriptUrl}\"]`);if(script){document.body.removeChild(script);}};},[]);// Use currentPageUrl state in your iframe src\nconst tallySrc=`https://tally.so/embed/wLaDYj?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1&jobTitle=${currentPageUrl}`;return /*#__PURE__*/_jsx(\"iframe\",{src:tallySrc,loading:\"lazy\",width:\"100%\",height:\"500\"// Adjust based on your Tally form's needs\n,frameBorder:\"0\",marginHeight:\"0\",marginWidth:\"0\",title:\"Apply to this job\"});}function App(){return /*#__PURE__*/_jsx(TallyForm,{});}export default App;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"App\",\"slots\":[],\"annotations\":{\"framerContractVersion\":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