{"version":3,"file":"Form_Hubspot.Be3HRLF-.mjs","names":[],"sources":["https:/framerusercontent.com/modules/Ro51wI2tEwqIgvhmrd6S/AQmo083Kvl1sp3NqB0bT/Form_Hubspot.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function HubSpotForm(props){const{portalId,formId,region}=props;const formRef=useRef(null);useEffect(()=>{// Clear any existing form inside the container\nif(formRef.current){formRef.current.innerHTML=\"\";}// Load the HubSpot script dynamically\nconst script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/embed/v2.js\";script.async=true;script.onload=()=>{if(window.hbspt){window.hbspt.forms.create({portalId,formId,region,target:`#hubspot-form-${formId}`,onFormSubmit:function(){// GA4 direct\nif(window.gtag){window.gtag(\"event\",\"hubspot_form_submit\",{form_id:formId,page_path:location.pathname});}}});}};document.body.appendChild(script);return()=>{// Cleanup: Remove script to prevent duplicates\nscript.remove();};},[portalId,formId,region]);return /*#__PURE__*/_jsx(\"div\",{id:`hubspot-form-${formId}`,ref:formRef,style:formContainerStyle});}// **Framer Property Controls**\naddPropertyControls(HubSpotForm,{portalId:{title:\"Portal ID\",type:ControlType.String,defaultValue:\"45694123\"},formId:{title:\"Form ID\",type:ControlType.String,defaultValue:\"d8754ba8-32dd-4ee8-bc81-5bc3e3001674\"},region:{title:\"Region\",type:ControlType.String,defaultValue:\"na1\"}});// **Styles**\nconst formContainerStyle={width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Form_Hubspot.map"],"mappings":"kTAGG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,SAAO,SAAO,CAAC,EAAY,EAAQ,EAAO,KAAK,CAI9D,MAJ+D,GAAU,IAAI,CAC3H,AAAG,EAAQ,UAAS,EAAQ,QAAQ,UAAU,IAC9C,IAAM,EAAO,SAAS,cAAc,SAAS,CACqG,OADpG,EAAO,IAAI,2CAA2C,EAAO,OAAM,EAAK,EAAO,OAAO,IAAI,CAAC,AAAG,EAAO,OAAO,EAAO,MAAM,MAAM,OAAO,CAAC,WAAS,SAAO,SAAO,QAAQ,gBAAgB,IAAS,aAAa,UAAU,CACpQ,AAAG,EAAO,MAAM,EAAO,KAAK,QAAQ,sBAAsB,CAAC,QAAQ,EAAO,UAAU,SAAS,QAAS,EAAC,AAAG,CAAC,EAAC,AAAG,EAAC,SAAS,KAAK,YAAY,EAAO,CAAO,IAAI,CAC5J,EAAO,QAAQ,AAAE,CAAE,EAAC,CAAC,EAAS,EAAO,CAAO,EAAC,CAAqB,EAAK,MAAM,CAAC,IAAI,eAAe,IAAS,IAAI,EAAQ,MAAM,CAAmB,EAAC,AAAE,gBAE5I,IATN,GAA2C,IAAoD,IAAoC,CAQnI,EAAoB,EAAY,CAAC,SAAS,CAAC,MAAM,YAAY,KAAK,EAAY,OAAO,aAAa,UAAW,EAAC,OAAO,CAAC,MAAM,UAAU,KAAK,EAAY,OAAO,aAAa,sCAAuC,EAAC,OAAO,CAAC,MAAM,SAAS,KAAK,EAAY,OAAO,aAAa,KAAM,CAAC,EAAC,CACjR,EAAmB,CAAC,MAAM,MAAO"}