{"version":3,"file":"EmailSignupForm.DvJuCDiy.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/NkiSCsqt1aBoI4yzbJ0h/giZYphWAdsN3tzcHPv4I/EmailSignupForm.js"],"sourcesContent":["// Email signup form component with dual Customer.io tracking:\n// 1) CDP via window.cioanalytics (global tracking, unchanged)\n// 2) Journeys via window._cio (only if snippet present on /blog* pages)\n// Includes console logs for debugging and updated UI (pill with embedded button)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function EmailSignupForm(props){const{emailPlaceholder,buttonText,successMessage,breakpoint,primaryColor,backgroundColor,borderColor,focusColor,textColor,placeholderColor,buttonTextColor,font}=props;const[email,setEmail]=useState(\"\");const[isSubmitted,setIsSubmitted]=useState(false);const[isSmallScreen,setIsSmallScreen]=useState(false);const containerRef=useRef(null);const scopeIdRef=useRef(`pill-${Math.random().toString(36).slice(2)}`);// Record page view on mount\nuseEffect(()=>{console.log(\"[EmailSignupForm] Mounted on page:\",window.location.pathname);if(typeof window===\"undefined\")return;const cioJourneys=window._cio;if(cioJourneys&&typeof cioJourneys.page===\"function\"){console.log(\"[EmailSignupForm] Sending page() call to Journeys\");cioJourneys.page();}else{console.warn(\"[EmailSignupForm] Journeys _cio object not found on mount.\");}const cioCDP=window.cioanalytics;if(cioCDP&&typeof cioCDP.page===\"function\"){console.log(\"[EmailSignupForm] Sending page() call to CDP\");cioCDP.page();}else{console.warn(\"[EmailSignupForm] CDP cioanalytics object not found on mount.\");}},[]);// Responsive check\nuseEffect(()=>{if(typeof window===\"undefined\")return;const checkContainerSize=()=>{if(containerRef.current){const containerWidth=containerRef.current.offsetWidth;console.log(\"[EmailSignupForm] Container width:\",containerWidth,\"breakpoint:\",breakpoint);startTransition(()=>{setIsSmallScreen(containerWidth<=breakpoint);});}};const resizeObserver=new ResizeObserver(checkContainerSize);if(containerRef.current)resizeObserver.observe(containerRef.current);checkContainerSize();return()=>{resizeObserver.disconnect();console.log(\"[EmailSignupForm] ResizeObserver disconnected\");};},[breakpoint]);const handleSubmit=e=>{e.preventDefault();console.log(\"[EmailSignupForm] Submit triggered with email:\",email);const cioCDP=window.cioanalytics;const cioJourneys=window._cio;// 1) CDP tracking (global)\nif(cioCDP&&typeof cioCDP.identify===\"function\"){console.log(\"[EmailSignupForm] CDP identify()...\");cioCDP.identify({email,subscribed:true,source:\"framer_form\",path:window.location.pathname});console.log(\"[EmailSignupForm] CDP track('blog_subscribed')...\");cioCDP.track(\"blog_subscribed\",{path:window.location.pathname,referrer:document.referrer});}else{console.warn(\"[EmailSignupForm] CDP cioanalytics not available.\");}// 2) Journeys tracking (only works if _cio snippet is present)\nif(cioJourneys&&typeof cioJourneys.identify===\"function\"){console.log(\"[EmailSignupForm] Journeys identify()...\");cioJourneys.identify({id:email,email,subscribed:true,source:\"framer_form\",path:window.location.pathname});console.log(\"[EmailSignupForm] Journeys track('blog_subscribed')...\");cioJourneys.track(\"blog_subscribed\",{path:window.location.pathname,referrer:document.referrer});}else{console.warn(\"[EmailSignupForm] Journeys _cio not available.\");}startTransition(()=>{setIsSubmitted(true);setEmail(\"\");console.log(\"[EmailSignupForm] Submission complete.\");});};const handleEmailChange=e=>{const val=e.target.value;console.log(\"[EmailSignupForm] Email changed:\",val);startTransition(()=>{setEmail(val);});};const pillHeight=56;return /*#__PURE__*/_jsxs(\"form\",{ref:containerRef,onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:\"column\",gap:\"12px\",width:\"100%\",...font},id:scopeIdRef.current,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                #${scopeIdRef.current} input::placeholder { color: ${placeholderColor}; }\n                #${scopeIdRef.current} .pill:focus-within { box-shadow: 0 0 0 2px ${focusColor}1A; }\n                @media (pointer: fine) {\n                  #${scopeIdRef.current} .cta:hover { opacity: 0.92; }\n                  #${scopeIdRef.current} .cta:active { opacity: 0.86; }\n                }\n            `}),/*#__PURE__*/_jsxs(\"div\",{className:\"pill\",style:{display:\"flex\",alignItems:\"center\",width:\"100%\",height:`${pillHeight}px`,backgroundColor,border:`1px solid ${borderColor}`,borderRadius:9999,paddingLeft:18,paddingRight:8,boxSizing:\"border-box\",gap:8},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:emailPlaceholder||\"your@email.com\",value:email,onChange:handleEmailChange,required:true,\"aria-label\":\"Email\",style:{appearance:\"none\",border:\"none\",outline:\"none\",background:\"transparent\",color:textColor,width:\"100%\",height:\"100%\",fontFamily:\"inherit\",fontSize:15},onFocus:e=>{console.log(\"[EmailSignupForm] Input focus\");e.currentTarget.parentElement.style.borderColor=focusColor;},onBlur:e=>{console.log(\"[EmailSignupForm] Input blur\");e.currentTarget.parentElement.style.borderColor=borderColor;}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",className:\"cta\",style:{flex:\"none\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",height:pillHeight-12,padding:\"0 18px\",minWidth:120,borderRadius:9999,border:\"none\",cursor:\"pointer\",backgroundColor:primaryColor,color:buttonTextColor,fontFamily:\"inherit\",fontSize:15,fontWeight:600,transition:\"opacity 0.15s ease\"},children:buttonText||\"Subscribe\"})]}),isSubmitted&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",textAlign:\"center\",fontSize:15,width:\"100%\"},children:/*#__PURE__*/_jsx(\"p\",{style:{color:focusColor,fontWeight:500,margin:0,fontFamily:\"inherit\",whiteSpace:\"nowrap\"},children:successMessage})})]});}addPropertyControls(EmailSignupForm,{emailPlaceholder:{type:ControlType.String,title:\"Email Placeholder\",defaultValue:\"your@email.com\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Subscribe\"},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"Thanks for subscribing.\"},breakpoint:{type:ControlType.Number,title:\"Mobile Breakpoint\",defaultValue:400,min:200,max:800,step:50,unit:\"px\"},primaryColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#2E2E2E\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},backgroundColor:{type:ControlType.Color,title:\"Pill Background\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Pill Border\",defaultValue:\"#E6E6E6\"},focusColor:{type:ControlType.Color,title:\"Focus/Success\",defaultValue:\"#0B0B0B\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#101010\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder\",defaultValue:\"rgba(0,0,0,0.45)\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmailSignupForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmailSignupForm.map"],"mappings":"oNAI0K,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,mBAAiB,aAAW,iBAAe,aAAW,eAAa,kBAAgB,cAAY,aAAW,YAAU,mBAAiB,kBAAgB,QAAM,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,EAAO,CAAC,EAAY,GAAgBA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAK,EAAQ,EAAaC,EAAO,IAAI,EAAQ,EAAWA,EAAO,QAAQ,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,EAChnB,MAAc,CAA4E,GAA3E,QAAQ,IAAI,qCAAqC,EAAO,SAAS,QAAQ,EAAY,IAAS,OAAY,OAAO,IAAM,EAAY,EAAO,KAAQ,GAAa,OAAO,EAAY,MAAO,YAAY,QAAQ,IAAI,mDAAmD,E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