{"version":3,"file":"NewsletterForm.BFOjgGDW.mjs","names":["React.useState","React.useRef"],"sources":["https:/framerusercontent.com/modules/nuu26pZbejHyxVVifF1Q/LfW3UNF3FuWvUW6y2uY9/NewsletterForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * MailchimpForm — Jeanda Agency\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 520\n */export default function MailchimpForm(props){const{workerUrl,mailchimpTag,buttonText,successMessage,showInterests,accentColor,textColor,hoverTextColor,turnstileSiteKey,font}=props;const[fname,setFname]=React.useState(\"\");const[lname,setLname]=React.useState(\"\");const[email,setEmail]=React.useState(\"\");const[interest,setInterest]=React.useState(\"\");const[status,setStatus]=React.useState(\"idle\");const[errorMsg,setErrorMsg]=React.useState(\"\");// --- Bot protection ---\nconst[token,setToken]=React.useState(\"\");const[honeypot,setHoneypot]=React.useState(\"\");const mountedAt=React.useRef(Date.now());const turnstileRef=React.useRef(null);const widgetId=React.useRef(null);React.useEffect(()=>{if(!turnstileSiteKey)return;function render(){const ts=window.turnstile;if(!ts||!turnstileRef.current||widgetId.current!==null)return;widgetId.current=ts.render(turnstileRef.current,{sitekey:turnstileSiteKey,theme:\"light\",callback:t=>setToken(t),\"expired-callback\":()=>setToken(\"\"),\"error-callback\":()=>setToken(\"\")});}if(window.turnstile){render();return;}const existing=document.querySelector('script[src*=\"challenges.cloudflare.com/turnstile\"]');if(existing){existing.addEventListener(\"load\",render);return;}const s=document.createElement(\"script\");s.src=\"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit\";s.async=true;s.defer=true;s.onload=render;document.head.appendChild(s);},[turnstileSiteKey]);function resetTurnstile(){const ts=window.turnstile;if(ts&&widgetId.current!==null){ts.reset(widgetId.current);setToken(\"\");}}const interests=[\"Santa Fe\",\"Charleston\",\"wellness travel & events\",\"partner opportunities\"];function handleSubmit(e){e.preventDefault();if(!email||!fname||!lname){setStatus(\"error\");setErrorMsg(\"Please fill in all fields.\");return;}// Honeypot: solo un bot llena este campo oculto\nif(honeypot){setStatus(\"success\");return;}// Time-trap: envío en menos de 3s = bot\nif(Date.now()-mountedAt.current<3e3){setStatus(\"error\");setErrorMsg(\"Please take a moment to review your answers.\");return;}if(turnstileSiteKey&&!token){setStatus(\"error\");setErrorMsg(\"Please complete the verification below.\");return;}setStatus(\"loading\");sendToWorker();}// Envia al Worker de Cloudflare, que reenvia a Mailchimp desde el\n// servidor. Evita que navegadores con proteccion antirastreo (Firefox)\n// bloqueen la peticion por ir directo a un dominio de email marketing.\nasync function sendToWorker(){const payload={FNAME:fname,LNAME:lname,EMAIL:email,tag:mailchimpTag,token:token};if(showInterests&&interest)payload.MMERGE14=interest;try{const res=await fetch(workerUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(payload)});const data=await res.json();if(data.result===\"success\"){setStatus(\"success\");return;}setStatus(\"error\");setErrorMsg(data.msg||\"Something went wrong.\");resetTurnstile();}catch(err){setStatus(\"error\");setErrorMsg(\"We couldn't send your submission. Please try again, or email us directly.\");resetTurnstile();}}const inputStyle={width:\"100%\",border:\"none\",borderBottom:`1px solid ${textColor}`,borderRadius:0,background:\"transparent\",padding:\"8px 0\",fontSize:13,letterSpacing:\"0.12em\",textTransform:\"uppercase\",color:textColor,outline:\"none\",fontFamily:\"inherit\"};const labelPlaceholderCss=`\n        .mc-jeanda input::placeholder {\n            font-size: 11px;\n            font-weight: 500;\n            letter-spacing: 0.12em;\n            text-transform: uppercase;\n            color: ${textColor};\n            opacity: 1;\n        }\n        .mc-jeanda input:focus {\n            border-bottom-color: ${accentColor} !important;\n        }\n    `;if(status===\"success\"){return /*#__PURE__*/_jsx(\"div\",{style:{...font,color:textColor,fontSize:14,letterSpacing:\"0.08em\",textTransform:\"uppercase\",padding:\"24px 0\"},children:successMessage});}return /*#__PURE__*/_jsxs(\"form\",{className:\"mc-jeanda\",onSubmit:handleSubmit,style:{...font,width:\"100%\",display:\"flex\",flexDirection:\"column\"},children:[/*#__PURE__*/_jsx(\"style\",{children:labelPlaceholderCss}),/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:36},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",placeholder:\"First Name\",value:fname,onChange:e=>setFname(e.target.value),style:inputStyle})}),/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:36},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",placeholder:\"Last Name\",value:lname,onChange:e=>setLname(e.target.value),style:inputStyle})}),/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:36},children:/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:\"Email\",value:email,onChange:e=>setEmail(e.target.value),style:inputStyle})}),showInterests&&/*#__PURE__*/_jsxs(\"div\",{style:{marginBottom:36},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:11,fontWeight:500,letterSpacing:\"0.12em\",textTransform:\"uppercase\",color:textColor,marginBottom:10},children:\"I'm most interested in\"}),interests.map(opt=>/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",alignItems:\"center\",gap:8,fontSize:14,color:textColor,marginBottom:8,cursor:\"pointer\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"radio\",name:\"MMERGE14\",value:opt,checked:interest===opt,onChange:()=>setInterest(opt),style:{accentColor}}),opt]},opt))]}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",left:-5e3,opacity:0,height:0,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"input\",{type:\"text\",tabIndex:-1,autoComplete:\"off\",name:\"b_75dbce5ade206019896fdc80d_aed5186a18\",value:honeypot,onChange:e=>setHoneypot(e.target.value)})}),turnstileSiteKey&&/*#__PURE__*/_jsx(\"div\",{ref:turnstileRef,style:{marginBottom:24}}),status===\"error\"&&/*#__PURE__*/_jsx(\"div\",{style:{color:accentColor,fontSize:13,marginBottom:16},children:errorMsg}),/*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:status===\"loading\",style:{display:\"inline-block\",background:\"transparent\",border:`1px solid ${accentColor}`,borderRadius:999,color:accentColor,fontSize:12,fontWeight:500,letterSpacing:\"0.15em\",textTransform:\"uppercase\",padding:\"16px 40px\",lineHeight:1,cursor:status===\"loading\"?\"wait\":\"pointer\",fontFamily:\"inherit\",transition:\"background 0.2s, color 0.2s\",opacity:status===\"loading\"?.6:1},onMouseEnter:e=>{e.currentTarget.style.background=accentColor;e.currentTarget.style.color=hoverTextColor;},onMouseLeave:e=>{e.currentTarget.style.background=\"transparent\";e.currentTarget.style.color=accentColor;},children:status===\"loading\"?\"...\":buttonText})})]});}MailchimpForm.defaultProps={workerUrl:\"https://elevate-forms.nicole-517.workers.dev\",mailchimpTag:\"\",buttonText:\"Stay Connected\",successMessage:\"Thank you for subscribing!\",showInterests:true,accentColor:\"#E8622C\",textColor:\"#2B2B2B\",hoverTextColor:\"#FFFFFF\"};addPropertyControls(MailchimpForm,{workerUrl:{type:ControlType.String,title:\"Worker URL\"},mailchimpTag:{type:ControlType.String,title:\"MC Tag\"},buttonText:{type:ControlType.String,title:\"Button Text\"},successMessage:{type:ControlType.String,title:\"Success Msg\"},showInterests:{type:ControlType.Boolean,title:\"Interests\"},accentColor:{type:ControlType.Color,title:\"Accent\"},textColor:{type:ControlType.Color,title:\"Text\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\"},turnstileSiteKey:{type:ControlType.String,title:\"Turnstile Key\",placeholder:\"0x4AAA...\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",displayFontSize:false,displayTextAlignment:false,defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MailchimpForm\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"520\",\"framerContractVersion\":\"1\",\"framerSupportedLay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