{"version":3,"file":"SystemeLeadForm.D9mBXRSm.mjs","names":["useState","useRef","startTransition"],"sources":["https:/framerusercontent.com/modules/ylbkRBTSgFXLzYUVmVUP/QGBTyDLPZZkdOsUFzc8w/SystemeLeadForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function clean(font){const out={};if(!font)return out;for(const key of Object.keys(font)){const value=font[key];if(value!==undefined&&value!==null)out[key]=value;}return out;}const BRAND_FONT='\"Funnel Display\", \"Funnel Display Placeholder\", sans-serif';/**\r\n * Systeme Lead Form\r\n *\r\n * Formulario conectado a systeme.io para captar suscriptores.\r\n *\r\n * @framerIntrinsicWidth 420\r\n * @framerIntrinsicHeight 220\r\n *\r\n * @framerSupportedLayoutWidth any-prefer-fixed\r\n * @framerSupportedLayoutHeight auto\r\n */export default function SystemeLeadForm(props){const{actionUrl,scriptUrl,showName,namePlaceholder,emailPlaceholder,buttonLabel,accentColor,accentTextColor,fieldBackground,fieldTextColor,fieldBorderColor,fieldFocusColor,noteColor,consentLinkColor,fieldRadius,buttonRadius,gap,showConsent,consentText,consentLinkLabel,privacyUrl,errorText,note,inputFont,buttonFont,noteFont,style}=props;// Una nota en blanco (vacía, solo espacios o \"null\") no debe pintar nada.\nconst trimmedNote=typeof note===\"string\"?note.trim():\"\";const noteText=trimmedNote===\"null\"?\"\":trimmedNote;const fieldFont={fontFamily:BRAND_FONT,...clean(inputFont)};const ctaFont={fontFamily:BRAND_FONT,...clean(buttonFont)};const smallFont={fontFamily:BRAND_FONT,...clean(noteFont)};const[consent,setConsent]=useState(false);const[error,setError]=useState(false);const[focused,setFocused]=useState(\"\");const[hovered,setHovered]=useState(false);const loadedRef=useRef(false);const isStatic=RenderTarget.current()===RenderTarget.canvas||RenderTarget.current()===RenderTarget.export||RenderTarget.current()===RenderTarget.thumbnail;// Opcional: el script de systeme.io renderiza SU PROPIO formulario donde se inserta,\n// así que por defecto no se carga. El POST nativo al endpoint funciona sin él.\nuseEffect(()=>{if(isStatic)return;if(typeof document===\"undefined\")return;if(!scriptUrl)return;if(loadedRef.current)return;if(document.querySelector(`script[src=\"${scriptUrl}\"]`)){loadedRef.current=true;return;}const script=document.createElement(\"script\");script.src=scriptUrl;script.async=true;document.body.appendChild(script);loadedRef.current=true;},[scriptUrl,isStatic]);function handleSubmit(event){if(isStatic){event.preventDefault();return;}if(showConsent&&!consent){event.preventDefault();setError(true);}}function fieldStyle(name){const active=focused===name;return{width:\"100%\",boxSizing:\"border-box\",padding:\"16px 18px\",borderRadius:fieldRadius,border:`2px solid ${active?fieldFocusColor:fieldBorderColor}`,background:fieldBackground,color:fieldTextColor,outline:\"none\",appearance:\"none\",transition:\"border-color 0.18s ease, box-shadow 0.18s ease\",boxShadow:active?`0 0 0 4px ${fieldFocusColor}22`:\"none\",...fieldFont};}return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",width:\"100%\"},children:/*#__PURE__*/_jsxs(\"form\",{method:\"post\",action:actionUrl,onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:\"column\",gap,width:\"100%\",margin:0},children:[showName&&/*#__PURE__*/_jsx(\"input\",{type:\"text\",name:\"first_name\",required:true,autoComplete:\"given-name\",\"aria-label\":namePlaceholder,placeholder:namePlaceholder,style:fieldStyle(\"name\"),onFocus:()=>startTransition(()=>setFocused(\"name\")),onBlur:()=>startTransition(()=>setFocused(\"\"))}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",name:\"email\",required:true,autoComplete:\"email\",\"aria-label\":emailPlaceholder,placeholder:emailPlaceholder,style:fieldStyle(\"email\"),onFocus:()=>startTransition(()=>setFocused(\"email\")),onBlur:()=>startTransition(()=>setFocused(\"\"))}),showConsent&&/*#__PURE__*/_jsxs(\"label\",{style:{display:\"flex\",alignItems:\"flex-start\",gap:10,cursor:\"pointer\",color:noteColor,textAlign:\"left\",...smallFont},children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",checked:consent,\"aria-label\":consentText,onChange:event=>{// Estado de un input controlado: actualización\n// síncrona. Dentro de startTransition React\n// puede interrumpirla y la casilla revierte.\nconst next=event.target.checked;setConsent(next);if(next)setError(false);},style:{width:18,height:18,margin:0,marginTop:1,flexShrink:0,accentColor:accentColor,cursor:\"pointer\"}}),/*#__PURE__*/_jsxs(\"span\",{children:[consentText,\" \",/*#__PURE__*/_jsx(\"a\",{href:privacyUrl,target:\"_blank\",rel:\"noreferrer\",onClick:event=>event.stopPropagation(),style:{color:consentLinkColor,textDecoration:\"underline\",textUnderlineOffset:\"2px\"},children:consentLinkLabel})]})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",onMouseEnter:()=>startTransition(()=>setHovered(true)),onMouseLeave:()=>startTransition(()=>setHovered(false)),style:{width:\"100%\",boxSizing:\"border-box\",padding:\"18px 24px\",borderRadius:buttonRadius,border:\"none\",background:accentColor,color:accentTextColor,cursor:\"pointer\",transform:hovered?\"translateY(-2px)\":\"translateY(0)\",boxShadow:hovered?\"0 14px 26px rgba(10, 17, 40, 0.22)\":\"0 6px 14px rgba(10, 17, 40, 0.12)\",transition:\"transform 0.18s ease, box-shadow 0.18s ease\",...ctaFont},children:buttonLabel}),error&&/*#__PURE__*/_jsx(\"span\",{role:\"alert\",style:{color:\"#FF6B35\",...smallFont},children:errorText}),noteText?/*#__PURE__*/_jsx(\"span\",{style:{color:noteColor,...smallFont},children:noteText}):null]})});}addPropertyControls(SystemeLeadForm,{actionUrl:{type:ControlType.String,title:\"URL destino\",defaultValue:\"https://systeme.io/embedded/44655633/subscription\"},scriptUrl:{type:ControlType.String,title:\"URL script\",description:\"D\\xe9jalo vac\\xedo. El script de systeme monta su propio formulario al final de la p\\xe1gina y saldr\\xeda duplicado.\",defaultValue:\"\"},showName:{type:ControlType.Boolean,title:\"Pedir nombre\",defaultValue:true},namePlaceholder:{type:ControlType.String,title:\"Campo nombre\",defaultValue:\"Tu nombre\",hidden:props=>!props.showName},emailPlaceholder:{type:ControlType.String,title:\"Campo email\",defaultValue:\"Tu mejor email\"},buttonLabel:{type:ControlType.String,title:\"Texto boton\",defaultValue:\"Envi\\xe1dmela ya\"},accentColor:{type:ControlType.Color,title:\"Color acento\",defaultValue:\"#0066FF\"},accentTextColor:{type:ControlType.Color,title:\"Color texto boton\",defaultValue:\"#FFFFFF\"},fieldBackground:{type:ControlType.Color,title:\"Fondo campo\",defaultValue:\"#FFFFFF\"},fieldTextColor:{type:ControlType.Color,title:\"Texto campo\",defaultValue:\"#0A1128\"},fieldBorderColor:{type:ControlType.Color,title:\"Borde campo\",defaultValue:\"#E4EDFF\"},fieldFocusColor:{type:ControlType.Color,title:\"Borde foco\",defaultValue:\"#0066FF\"},noteColor:{type:ControlType.Color,title:\"Color nota\",defaultValue:\"#6B7280\"},consentLinkColor:{type:ControlType.Color,title:\"Color enlace\",defaultValue:\"#0066FF\"},fieldRadius:{type:ControlType.Number,title:\"Radio campo\",defaultValue:14,min:0,max:40,unit:\"px\"},buttonRadius:{type:ControlType.Number,title:\"Radio boton\",defaultValue:14,min:0,max:40,unit:\"px\"},gap:{type:ControlType.Number,title:\"Separacion\",defaultValue:12,min:0,max:40,unit:\"px\"},showConsent:{type:ControlType.Boolean,title:\"Pedir consentimiento\",defaultValue:true},consentText:{type:ControlType.String,title:\"Texto consentimiento\",defaultValue:\"He le\\xeddo y acepto la\",hidden:props=>!props.showConsent},consentLinkLabel:{type:ControlType.String,title:\"Enlace consentimiento\",defaultValue:\"pol\\xedtica de privacidad\",hidden:props=>!props.showConsent},privacyUrl:{type:ControlType.Link,title:\"URL privacidad\",defaultValue:\"/politica-privacidad\",hidden:props=>!props.showConsent},errorText:{type:ControlType.String,title:\"Texto error\",defaultValue:\"Marca la casilla para poder enviarte la gu\\xeda.\",hidden:props=>!props.showConsent},note:{type:ControlType.String,title:\"Nota\",description:\"Texto peque\\xf1o bajo el bot\\xf3n. D\\xe9jalo vac\\xedo para no mostrar nada.\",defaultValue:\"\"},inputFont:{type:ControlType.Font,title:\"Tipografia campos\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},buttonFont:{type:ControlType.Font,title:\"Tipografia boton\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\",textAlign:\"center\"}},noteFont:{type:ControlType.Font,title:\"Tipografia notas\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"13px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1.4em\"}}});SystemeLeadForm.displayName=\"Systeme Lead Form\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SystemeLeadForm\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"220\",\"framerIntrinsicWidth\":\"420\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SystemeLeadForm.map"],"mappings":"6MAAuL,SAAS,EAAM,EAAK,CAAC,IAAM,EAAI,CAAC,EAAE,GAAG,CAAC,EAAK,OAAO,EAAI,IAAI,IAAM,KAAO,OAAO,KAAK,CAAI,EAAE,CAAC,IAAM,EAAM,EAAK,GAAQ,GAA2B,OAAK,EAAI,GAAK,EAAM,CAAC,OAAO,CAAI,CAUlW,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,YAAU,YAAU,WAAS,kBAAgB,mBAAiB,cAAY,cAAY,kBAAgB,kBAAgB,iBAAe,mBAAiB,kBAAgB,YAAU,mBAAiB,cAAY,eAAa,MAAI,cAAY,cAAY,mBAAiB,aAAW,YAAU,OAAK,YAAU,aAAW,WAAS,SAAO,EAC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