{"version":3,"file":"SpamFilter.BcWWcJls.mjs","names":[],"sources":["https:/framerusercontent.com/modules/47V89uJIoxq02KydJlvV/RlvaXEorIm4vaec1CLwd/SpamFilter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function withHoneypot(Component){return props=>{useEffect(()=>{const attachHandler=()=>{const form=document.querySelector(\"form\");if(!form)return false;if(form._honeypotAttached)return false;form._honeypotAttached=true;const honeypotField=form.querySelector('input[name=\"customer_email_lead\"]');if(!honeypotField){console.error(\"⚠️ HONEYPOT FIELD NOT FOUND\");return false;}console.log(\"✅ Honeypot protection active\");// Hide from users but keep accessible to bots\nhoneypotField.style.position=\"absolute\";honeypotField.style.left=\"-9999px\";honeypotField.style.width=\"1px\";honeypotField.style.height=\"1px\";honeypotField.style.opacity=\"0\";honeypotField.setAttribute(\"tabindex\",\"-1\");honeypotField.setAttribute(\"autocomplete\",\"off\");honeypotField.setAttribute(\"aria-hidden\",\"true\");// Clear any value autofill may have already set\nhoneypotField.value=\"\";const handleSubmit=e=>{// Block if honeypot has ANY value — real users can't see or fill this\nif(honeypotField.value!==\"\"){e.preventDefault();e.stopPropagation();console.log(\"Spam blocked: honeypot filled\");return false;}};form.addEventListener(\"submit\",handleSubmit,true);return()=>{form.removeEventListener(\"submit\",handleSubmit,true);delete form._honeypotAttached;};};const cleanup=attachHandler();if(!cleanup){let cleanupFn;const observer=new MutationObserver(()=>{const result=attachHandler();if(result){cleanupFn=result;observer.disconnect();}});observer.observe(document.body,{childList:true,subtree:true});return()=>{observer.disconnect();cleanupFn?.();};}return cleanup;},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function withAdvancedHoneypot(Component){return props=>{useEffect(()=>{const formLoadTime=Date.now();const attachHandler=()=>{const form=document.querySelector(\"form\");if(!form)return false;if(form._advancedHoneypotAttached)return false;form._advancedHoneypotAttached=true;const honeypotField=form.querySelector('input[name=\"customer_email_lead\"]');if(!honeypotField){console.warn('Honeypot field \"customer_email_lead\" not found');return false;}// Hide from users but keep accessible to bots\nhoneypotField.style.position=\"absolute\";honeypotField.style.left=\"-9999px\";honeypotField.style.width=\"1px\";honeypotField.style.height=\"1px\";honeypotField.style.opacity=\"0\";honeypotField.setAttribute(\"tabindex\",\"-1\");// Critical: prevent browser autofill targeting this field\nhoneypotField.setAttribute(\"autocomplete\",\"off\");honeypotField.setAttribute(\"aria-hidden\",\"true\");// Clear any value that autofill may have already set on page load\nhoneypotField.value=\"\";const showFakeSuccess=reason=>{console.log(\"Spam blocked:\",reason);const submitButton=form.querySelector('button[type=\"submit\"]');if(submitButton){const originalText=submitButton.textContent;submitButton.textContent=\"Submitted!\";submitButton.disabled=true;setTimeout(()=>{submitButton.textContent=originalText;submitButton.disabled=false;},2e3);}};const hasRandomCase=text=>{const body=text.slice(1);const upperCount=(body.match(/[A-Z]/g)||[]).length;const lowerCount=(body.match(/[a-z]/g)||[]).length;const totalLetters=upperCount+lowerCount;if(totalLetters<5)return false;const upperRatio=upperCount/totalLetters;return upperRatio>.3&&upperRatio<.9;};const hasExcessiveConsonants=text=>{return/[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]{4,}/.test(text);};const hasInsufficientVowels=text=>{if(text.length<5)return false;const vowelCount=(text.match(/[aeiouAEIOU]/g)||[]).length;const vowelRatio=vowelCount/text.length;return vowelRatio<.25;};const isGibberishPattern=text=>{if(text.length<8)return false;return!text.includes(\" \")&&text.length>8;};const nameHasNoSpace=name=>{return name.length>10&&!name.includes(\" \");};const handleSubmit=e=>{const timeTaken=Date.now()-formLoadTime;// Block if honeypot has ANY value at all — real users never fill this\nif(honeypotField.value!==\"\"){e.preventDefault();e.stopPropagation();showFakeSuccess(\"honeypot filled\");return false;}// Block if submitted in under 2 seconds\nif(timeTaken<2e3){e.preventDefault();e.stopPropagation();showFakeSuccess(\"submitted too quickly\");return false;}const nameField=form.querySelector('input[name=\"name\"]');const notesField=form.querySelector('textarea[name=\"notes\"], input[name=\"notes\"]');const nameValue=nameField?.value||\"\";const notesValue=notesField?.value||\"\";const nameIsSuspicious=nameValue.length>0&&(nameHasNoSpace(nameValue)||hasExcessiveConsonants(nameValue)||hasRandomCase(nameValue)||hasInsufficientVowels(nameValue));const notesAreSuspicious=notesValue.length>0&&(hasExcessiveConsonants(notesValue)||hasRandomCase(notesValue)||hasInsufficientVowels(notesValue)||isGibberishPattern(notesValue));console.log(\"🤖 Spam detection:\",{timeTaken:`${timeTaken}ms`,nameValue,notesValue,nameIsSuspicious,notesAreSuspicious});if(nameHasNoSpace(nameValue)||nameIsSuspicious&&notesAreSuspicious){e.preventDefault();e.stopPropagation();showFakeSuccess(\"suspicious patterns detected\");return false;}};form.addEventListener(\"submit\",handleSubmit,true);return()=>{form.removeEventListener(\"submit\",handleSubmit,true);delete form._advancedHoneypotAttached;};};const cleanup=attachHandler();if(!cleanup){let cleanupFn;const observer=new MutationObserver(()=>{const result=attachHandler();if(result){cleanupFn=result;observer.disconnect();}});observer.observe(document.body,{childList:true,subtree:true});return()=>{observer.disconnect();cleanupFn?.();};}return cleanup;},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHoneypot\":{\"type\":\"reactHoc\",\"name\":\"withHoneypot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAdvancedHoneypot\":{\"type\":\"reactHoc\",\"name\":\"withAdvancedHoneypot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SpamFilter.map"],"mappings":"kHAGioB,SAAgB,EAAqB,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAC,IAAM,EAAa,KAAK,KAAK,CAAO,MAAkB,CAAC,IAAM,EAAK,SAAS,cAAc,OAAO,CAAuB,GAAnB,CAAC,GAAqB,EAAK,0BAA0B,MAAO,GAAM,EAAK,0BAA0B,GAAK,IAAM,EAAc,EAAK,cAAc,oCAAoC,CAAC,GAAG,CAAC,E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