{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/F4HQmFci5gNOvZGUd2gJ/tBVufYIyiYLLwwJ9EpGc/ConvertKitForm.js"],
  "sourcesContent": ["// ConvertKitForm subscription form with API integration and success message\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * ConvertKitForm subscription form with API integration\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ConvertKitForm(props){const{apiKey,formId,placeholder,buttonText,successMessage,backgroundColor,inputBackgroundColor,inputBorderColor,buttonColor,buttonTextColor,shadowColor,shadowX,shadowY,shadowBlur,textColor,borderRadius,font,buttonFont,layout}=props;const[email,setEmail]=useState(\"\");const[isLoading,setIsLoading]=useState(false);const[showSuccess,setShowSuccess]=useState(false);const[error,setError]=useState(\"\");const handleSubmit=async e=>{e.preventDefault();if(!email||!email.includes(\"@\")){startTransition(()=>setError(\"Please enter a valid email address\"));return;}if(!apiKey||!formId){startTransition(()=>setError(\"API key and Form ID are required\"));return;}startTransition(()=>{setIsLoading(true);setError(\"\");});try{const response=await fetch(`https://api.convertkit.com/v3/forms/${formId}/subscribe`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({api_key:apiKey,email:email})});if(response.ok){startTransition(()=>{setShowSuccess(true);setEmail(\"\");setIsLoading(false);});// Hide success message after 5 seconds\nsetTimeout(()=>{startTransition(()=>setShowSuccess(false));},5e3);}else{throw new Error(\"Subscription failed\");}}catch(err){startTransition(()=>{setError(\"Something went wrong. Please try again.\");setIsLoading(false);});}};const isFixedWidth=props?.style&&props.style.width===\"100%\";if(showSuccess){return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},backgroundColor:\"#131313\",border:\"2px solid #22CC66\",borderRadius,padding:32,textAlign:\"center\",color:textColor,...font},children:/*#__PURE__*/_jsx(\"div\",{style:{color:\"#fff\",fontWeight:600,lineHeight:\"1.4em\"},children:successMessage})});}return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},backgroundColor,borderRadius,padding:24,position:\"relative\"},children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:layout===\"vertical\"?\"column\":\"row\",gap:16},children:[/*#__PURE__*/_jsx(\"input\",{type:\"email\",value:email,onChange:e=>setEmail(e.target.value),placeholder:placeholder,disabled:isLoading,style:{padding:\"12px 16px\",borderRadius:borderRadius*.75,border:`1px solid ${inputBorderColor}`,backgroundColor:inputBackgroundColor,color:textColor,fontSize:\"16px\",outline:\"none\",flex:layout===\"horizontal\"?1:\"none\",...font},onFocus:e=>{e.target.style.borderColor=\"#1A65D5\";},onBlur:e=>{e.target.style.borderColor=inputBorderColor;}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:isLoading,style:{padding:\"12px 24px\",borderRadius:borderRadius*.75,border:\"none\",backgroundColor:buttonColor,color:buttonTextColor,cursor:isLoading?\"not-allowed\":\"pointer\",opacity:isLoading?.7:1,transition:\"opacity 0.2s ease\",flexShrink:0,boxShadow:`${shadowX}px ${shadowY}px ${shadowBlur}px ${shadowColor}`,...buttonFont},children:isLoading?\"Subscribing...\":buttonText}),error&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#FF5555\",fontSize:\"14px\",textAlign:\"center\",...font},children:error})]})});}addPropertyControls(ConvertKitForm,{layout:{type:ControlType.Enum,title:\"Layout\",options:[\"vertical\",\"horizontal\"],optionTitles:[\"Vertical\",\"Horizontal\"],defaultValue:\"vertical\",displaySegmentedControl:true},apiKey:{type:ControlType.String,title:\"API Key\",defaultValue:\"\",placeholder:\"Enter your ConvertKitForm API key\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"\",placeholder:\"Enter your ConvertKitForm form ID\"},placeholder:{type:ControlType.String,title:\"Email Placeholder\",defaultValue:\"Enter your email address\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Subscribe\"},successMessage:{type:ControlType.String,title:\"Success Message\",defaultValue:\"Thanks for subscribing. You're one step closer to being a master of AI.\",displayTextArea:true},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#FFFFFF\"},inputBackgroundColor:{type:ControlType.Color,title:\"Input Background\",defaultValue:\"#F5F5F5\"},inputBorderColor:{type:ControlType.Color,title:\"Input Border Color\",defaultValue:\"#E5E5E5\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\",defaultValue:\"#FFFFFF\"},shadowColor:{type:ControlType.Color,title:\"Shadow Color\",defaultValue:\"rgba(0, 0, 0, 0.15)\"},shadowX:{type:ControlType.Number,title:\"Shadow X\",defaultValue:0,min:-20,max:20,step:1,unit:\"px\"},shadowY:{type:ControlType.Number,title:\"Shadow Y\",defaultValue:2,min:-20,max:20,step:1,unit:\"px\"},shadowBlur:{type:ControlType.Number,title:\"Shadow Blur\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ConvertKitForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutW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AAa,SAAS,EAAE,iBAAiB,CAAC,KAAKA,EAAY,MAAM,MAAM,qBAAqB,aAAa,SAAS,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,eAAe,aAAa,SAAS,EAAE,gBAAgB,CAAC,KAAKA,EAAY,MAAM,MAAM,oBAAoB,aAAa,SAAS,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,eAAe,aAAa,qBAAqB,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,aAAa,EAAE,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,KAAK,IAAI,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,aAAa,EAAE,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,KAAK,IAAI,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,KAAK,IAAI,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,aAAa,CAAC,KAAKA,EAAY,OAAO,MAAM,gBAAgB,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,aAAa,CAAC,SAAS,OAAO,QAAQ,SAAS,cAAc,UAAU,WAAW,OAAO,EAAE,SAAS,WAAW,gBAAgB,YAAY,EAAE,WAAW,CAAC,KAAKA,EAAY,KAAK,MAAM,cAAc,aAAa,CAAC,SAAS,OAAO,QAAQ,WAAW,cAAc,UAAU,WAAW,KAAK,EAAE,SAAS,WAAW,gBAAgB,YAAY,CAAC,CAAC",
  "names": ["ConvertKitForm", "props", "apiKey", "formId", "placeholder", "buttonText", "successMessage", "backgroundColor", "inputBackgroundColor", "inputBorderColor", "buttonColor", "buttonTextColor", "shadowColor", "shadowX", "shadowY", "shadowBlur", "textColor", "borderRadius", "font", "buttonFont", "layout", "email", "setEmail", "ye", "isLoading", "setIsLoading", "showSuccess", "setShowSuccess", "error", "setError", "handleSubmit", "e", "Z", "isFixedWidth", "p", "u", "addPropertyControls", "ControlType"]
}
