{"version":3,"file":"SignUpFormToN8N.Do4F6137.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/EH1k9XEPI7CruJ95LIfj/FTKcCqKwbFNcFOSzTl7O/SignUpFormToN8N.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useRef,useEffect,useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function SignUpFormToN8N(props){const{url,buttonColor,hoverButtonColor,buttonText,buttonSubText,sendAllUrlParametersWithForm}=props;const vorwahlRef=useRef(null);const telefonRef=useRef(null);const formRef=useRef(null);const[isSubmitting,setIsSubmitting]=useState(false);console.log(\"\");useEffect(()=>{const vorwahlSelect=vorwahlRef.current;const telefonInput=telefonRef.current;const form=formRef.current;function validatePhoneNumber(submit=false){let telefon=telefonInput.value.replaceAll(\" \",\"\")// Remove spaces\n;const vorwahl=vorwahlSelect.value;if(vorwahl.startsWith(\"+\")){// Process German numbers\nif(telefon.startsWith(\"4\")){telefon=telefon.slice(2);}if(telefon.startsWith(\"04\")){telefon=telefon.slice(3);}if(telefon.startsWith(\"004\")){telefon=telefon.slice(4);}if(telefon.startsWith(\"0\")){telefon=telefon.slice(1);}if(telefon.startsWith(\"+4\")){telefon=telefon.slice(3);}if(submit){telefonInput.value=telefon// Update input\n;}// Validate length (for German, Austrian, Swiss numbers)\nconst digitCount=telefon.length;if(digitCount>=8&&digitCount<=11){telefonInput.setCustomValidity(\"\");}else{telefonInput.setCustomValidity(\"Bitte gib deine korrekte WhatsApp-Nummer an.\");}}else{// Non-DAC numbers: Allow 7–15 digits\nconst digitCount=telefon.length;if(digitCount>=7&&digitCount<=15){telefonInput.setCustomValidity(\"\");}else{telefonInput.setCustomValidity(\"Bitte gib deine korrekte WhatsApp-Nummer an.\");}}}const handleInput=()=>validatePhoneNumber();const handleChange=()=>validatePhoneNumber();const handleSubmit=event=>{validatePhoneNumber(true);if(sendAllUrlParametersWithForm){const urlParams=new URLSearchParams(window.location.search);urlParams.forEach((value,key)=>{const input=document.createElement(\"input\");input.type=\"hidden\";input.name=key;input.value=value;form.appendChild(input);});}setIsSubmitting(true)// Disable further submissions\n;};telefonInput.addEventListener(\"input\",handleInput);vorwahlSelect.addEventListener(\"change\",handleChange);form.addEventListener(\"submit\",handleSubmit);// Cleanup event listeners\nreturn()=>{telefonInput.removeEventListener(\"input\",handleInput);vorwahlSelect.removeEventListener(\"change\",handleChange);form.removeEventListener(\"submit\",handleSubmit);};},[sendAllUrlParametersWithForm]);return /*#__PURE__*/_jsxs(motion.div,{style:{display:\"flex\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsxs(\"form\",{action:url,method:\"POST\",className:\"form-to-n8n\",ref:formRef,children:[/*#__PURE__*/_jsx(\"div\",{className:\"form-group\",children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",id:\"vorname\",name:\"vorname\",placeholder:\"Dein Vorname\",required:true})}),/*#__PURE__*/_jsx(\"div\",{className:\"form-group\",children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",id:\"nachname\",name:\"nachname\",placeholder:\"Dein Nachname\",required:true})}),/*#__PURE__*/_jsx(\"div\",{className:\"form-group\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"phone-group\",children:[/*#__PURE__*/_jsxs(\"select\",{name:\"vorwahl\",id:\"vorwahl\",ref:vorwahlRef,required:true,children:[/*#__PURE__*/_jsx(\"option\",{value:\"+49\",children:\"🇩🇪 +49\"}),/*#__PURE__*/_jsx(\"option\",{value:\"+43\",children:\"🇦🇹 +43\"}),/*#__PURE__*/_jsx(\"option\",{value:\"+41\",children:\"🇨🇭 +41\"}),/*#__PURE__*/_jsx(\"option\",{value:\"other\",children:\"+\"})]}),/*#__PURE__*/_jsx(\"input\",{type:\"tel\",id:\"telefon\",name:\"telefon\",placeholder:\"Deine Whatsappnummer\",pattern:\"[0-9+]*\",required:true,ref:telefonRef})]})}),/*#__PURE__*/_jsx(\"div\",{className:\"form-group\",children:/*#__PURE__*/_jsx(\"input\",{type:\"email\",id:\"email\",name:\"email\",placeholder:\"Deine beste E-Mail Adresse\",required:true})}),/*#__PURE__*/_jsxs(\"button\",{type:\"submit\",disabled:isSubmitting,children:[/*#__PURE__*/_jsx(\"p\",{children:isSubmitting?\"Wird gesendet...\":buttonText}),/*#__PURE__*/_jsx(\"p\",{className:\"subtext\",children:buttonSubText})]})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    .form-to-n8n {\n                        width: min(95vw, 300px);\n                    }\n                    .form-group {\n                        margin-bottom: 3px;\n                    }\n                    .form-group input[type=\"text\"],\n                    .form-group input[type=\"email\"] {\n                        width: 100%;\n                        box-sizing: border-box;\n                        border-radius: 4px;\n                        padding: 0px 10px 0px 12px;\n                        height: 40px;\n                        text-align: left;\n                        color: rgb(0, 0, 0);\n                        font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n                        font-size: 16px;\n                        font-weight: 400;\n                        letter-spacing: 0px;\n                        background-color: rgb(255, 255, 255);\n                        border: 1px solid rgb(148, 149, 150);\n                    }\n                    .form-group .phone-group {\n                        display: flex;\n                        align-items: center;\n                        gap: 10px;\n                        box-sizing: border-box;\n                        border-radius: 4px;\n                        background-color: rgb(255, 255, 255);\n                        border: 1px solid rgb(148, 149, 150);\n                        height: 40px;\n                    }\n                    .form-group select {\n                        width: 120px;\n                        border: none;\n                        text-align: left;\n                        color: rgb(0, 0, 0);\n                        padding: 0px 0px 0px 16px;\n                        font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n                        font-size: 16px;\n                        font-weight: 400;\n                        height: 38px;\n                        background-position: right 0px center !important;\n                    }\n                    .form-group input[type=\"tel\"] {\n                        width: 100%;\n                        padding: 0px 0px 0px 16px;\n                        text-align: left;\n                        color: rgb(0, 0, 0);\n                        font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n                        font-size: 16px;\n                        font-weight: 400;\n                        letter-spacing: 0px;\n                        height: 38px;\n                        border: none;\n                    }\n                    .form-to-n8n button {\n                        margin-top: 6px;\n                        margin-bottom: 6px;\n                        background: ${buttonColor};\n                        border-radius: 4px;\n                        border-style: none;\n                        border-color: rgb(0, 0, 0);\n                        border-width: 2px;\n                        color: rgb(255, 255, 255);\n                        font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n                        font-size: 18px;\n                        font-weight: 700;\n                        letter-spacing: 0px;\n                        font-style: normal;\n                        white-space: normal;\n                        padding-top: 0px;\n                        padding-bottom: 0px;\n                        text-align: center;\n                        word-break: break-word;\n                        align-self: flex-end;\n                        cursor: pointer;\n                        pointer-events: auto;\n                        width: 100%;\n                        /* NEU: Multi-Line Support & Zentrierung */\n                        display: flex;\n                        flex-direction: column;\n                        justify-content: center;\n                        align-items: center;\n                        /* etwas gro\\xdfz\\xfcgigere Zeilenh\\xf6he */\n                        line-height: 2.0;\n                    }\n                    .form-to-n8n button:hover {\n                        background-color: ${hoverButtonColor};\n                    }\n                    .form-to-n8n button .subtext {\n                        font-size: 14px;\n                        font-weight: 400;\n                    }\n                `})]});}addPropertyControls(SignUpFormToN8N,{url:{title:\"URL\",type:ControlType.String,defaultValue:\"https://n8n.roadtoglory.de/webhook-test/test\"},buttonText:{title:\"Button Text\",type:ControlType.String,defaultValue:\"Jetzt anmelden\"},buttonSubText:{title:\"Button SubText\",type:ControlType.String,defaultValue:\"\"},buttonColor:{title:\"Button Color\",type:ControlType.Color,defaultValue:\"#F3A813\"},hoverButtonColor:{title:\"Button Hover Color\",type:ControlType.Color,defaultValue:\"#FABC1F\"},sendAllUrlParametersWithForm:{title:\"Send all Url Parameters\",type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SignUpFormToN8N\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"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