{"version":3,"file":"WhenInlineSignupCard.BrSE4IOF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/jRmcSDC95NtPteRPdcaU/I26HCM29J9vA7xqEYLSG/WhenInlineSignupCard.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";function ArrowRight(){return /*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"line\",{x1:\"5\",y1:\"12\",x2:\"19\",y2:\"12\"}),/*#__PURE__*/_jsx(\"polyline\",{points:\"12 5 19 12 12 19\"})]});}function Check(){return /*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2.4\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polyline\",{points:\"20 6 9 17 4 12\"})});}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function WhenInlineSignupCard(props){const{portalId=\"49888497\",formGuid=\"2784b060-4b85-48df-9e18-910c53f15401\",heading=\"Want more insights like this?\",subtext=\"Sharp takes on workforce transitions, COBRA, Medicare, and healthcare costs.\",placeholder=\"you@company.com\",buttonLabel=\"Send me more\",successText=\"You're on the list. Thanks for subscribing!\",consentText=\"By subscribing you agree to our\",privacyLabel=\"Privacy Policy\",privacyUrl=\"/pages/privacy-policy\",accent=\"rgb(235, 94, 0)\",buttonBg=\"rgb(28, 42, 51)\",cardBg=\"rgb(248, 249, 251)\",textColor=\"rgb(28, 42, 51)\"}=props;const[email,setEmail]=useState(\"\");const[status,setStatus]=useState(\"idle\");const[error,setError]=useState(\"\");const[focused,setFocused]=useState(false);const emailValid=/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);async function submit(){setError(\"\");if(!emailValid){setError(\"Please enter a valid email address.\");return;}setStatus(\"loading\");const context={};if(typeof window!==\"undefined\"){context.pageUri=window.location.href;context.pageName=typeof document!==\"undefined\"?document.title:\"\";}try{const res=await fetch(\"https://api.hsforms.com/submissions/v3/integration/submit/\"+portalId+\"/\"+formGuid,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({fields:[{objectTypeId:\"0-1\",name:\"email\",value:email}],context:context})});if(res.ok){setStatus(\"success\");if(typeof window!==\"undefined\"){(window.dataLayer=window.dataLayer||[]).push({event:\"newsletter_signup\",signup_location:\"inline\"});}}else{const body=await res.json().catch(function(){return{};});setError(body&&body.message?body.message:\"Something went wrong. Please try again.\");setStatus(\"error\");}}catch(e){setError(\"Network error. Please try again.\");setStatus(\"error\");}}const cardStyle={width:\"100%\",position:\"relative\",boxSizing:\"border-box\",background:cardBg,border:\"1px solid rgba(28,42,51,0.1)\",borderRadius:16,padding:28,display:\"flex\",flexDirection:\"column\",gap:14,fontFamily:\"inherit\"};if(status===\"success\"){return /*#__PURE__*/_jsx(\"div\",{style:cardStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:10,color:textColor,fontSize:16,fontWeight:600},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:accent,display:\"flex\"},children:/*#__PURE__*/_jsx(Check,{})}),/*#__PURE__*/_jsx(\"span\",{children:successText})]})});}const fieldStyle={height:50,borderRadius:10,border:\"1px solid rgba(28,42,51,0.15)\",background:\"#ffffff\",padding:\"0 16px\",fontSize:15,color:textColor,outline:\"none\",boxSizing:\"border-box\",fontFamily:\"inherit\",flex:\"1 1 120px\",minWidth:110};return /*#__PURE__*/_jsxs(\"div\",{style:cardStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:20,fontWeight:600,color:textColor,lineHeight:\"1.25em\"},children:heading}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:15,fontWeight:400,color:\"rgba(28,42,51,0.7)\",lineHeight:\"1.45em\"},children:subtext}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexWrap:\"nowrap\",gap:8,alignItems:\"stretch\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",autoComplete:\"email\",\"aria-label\":\"Email address\",value:email,onChange:function(e){setEmail(e.target.value);},onFocus:function(){setFocused(true);},onBlur:function(){setFocused(false);},onKeyDown:function(e){if(e.key===\"Enter\")submit();},placeholder:placeholder,style:{...fieldStyle,borderColor:focused?accent:\"rgba(28,42,51,0.15)\",boxShadow:focused?\"0 0 0 3px rgba(235,94,0,0.2)\":\"none\"}}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:submit,disabled:status===\"loading\",\"aria-label\":\"Subscribe to insider insights\",style:{height:50,borderRadius:10,border:\"none\",background:buttonBg,color:\"#fff\",fontSize:15,fontWeight:500,padding:\"0 20px\",cursor:status===\"loading\"?\"default\":\"pointer\",display:\"flex\",alignItems:\"center\",gap:6,opacity:status===\"loading\"?.7:1,flex:\"0 0 auto\",whiteSpace:\"nowrap\",fontFamily:\"inherit\"},children:[status===\"loading\"?\"Submitting...\":buttonLabel,status===\"loading\"?null:/*#__PURE__*/_jsx(ArrowRight,{})]})]}),error?/*#__PURE__*/_jsx(\"div\",{style:{fontSize:13,color:\"#c0392b\"},children:error}):/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:12,color:\"rgba(28,42,51,0.55)\",lineHeight:\"1.4em\"},children:[consentText,\" \",/*#__PURE__*/_jsx(\"a\",{href:privacyUrl,style:{color:\"rgba(28,42,51,0.75)\",textDecoration:\"underline\"},children:privacyLabel}),\".\"]})]});}addPropertyControls(WhenInlineSignupCard,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"49888497\"},formGuid:{type:ControlType.String,title:\"Form GUID\",defaultValue:\"2784b060-4b85-48df-9e18-910c53f15401\"},heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"Want more insights like this?\"},subtext:{type:ControlType.String,title:\"Subtext\",displayTextArea:true,defaultValue:\"Sharp takes on workforce transitions, COBRA, Medicare, and healthcare costs.\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"you@company.com\"},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Send me more\"},successText:{type:ControlType.String,title:\"Success Text\",defaultValue:\"You're on the list. Thanks for subscribing!\"},consentText:{type:ControlType.String,title:\"Consent Text\",defaultValue:\"By subscribing you agree to our\"},privacyLabel:{type:ControlType.String,title:\"Privacy Label\",defaultValue:\"Privacy Policy\"},privacyUrl:{type:ControlType.Link,title:\"Privacy URL\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"rgb(235, 94, 0)\"},buttonBg:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"rgb(28, 42, 51)\"},cardBg:{type:ControlType.Color,title:\"Card BG\",defaultValue:\"rgb(248, 249, 251)\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"rgb(28, 42, 51)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WhenInlineSignupCard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WhenInlineSignupCard.map"],"mappings":"+LAAyI,SAAS,GAAY,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,MAAM,cAAc,QAAQ,eAAe,QAAQ,SAAS,CAAc,EAAK,OAAO,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC,EAAe,EAAK,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAE,CA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